summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-06-23 16:56:30 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-06-23 16:56:30 +0400
commit721170f1212cd6274948cdfc9697ea0a3741906d (patch)
tree4fdb06a4f65ce659acb19d5af266d8f89993dc37 /libc
parent7fa02f4d010169b077a225737ff40a49d5681a82 (diff)
downloadillumos-packaging-721170f1212cd6274948cdfc9697ea0a3741906d.tar.gz
libc (2.10-16) unstable; urgency=low
* Added libutil with openpty(), forkpty() and login_tty(); Added pty.h header, patched utmp.h to define login_tty() as an extension. Based on FreeBSD.
Diffstat (limited to 'libc')
-rw-r--r--libc/debian/changelog8
-rw-r--r--libc/debian/libc1-dev-illumos-i386.install1
-rw-r--r--libc/debian/libc1-dev.install2
-rw-r--r--libc/debian/libc1-illumos-i386.install1
-rw-r--r--libc/debian/libc1-illumos-i386.symbols5
-rw-r--r--libc/debian/libc1.install1
-rw-r--r--libc/debian/libc1.symbols.illumos-amd645
-rw-r--r--libc/debian/patches/add-libutil-openpty-forkpty.patch337
-rw-r--r--libc/debian/patches/series1
-rwxr-xr-xlibc/debian/rules1
10 files changed, 362 insertions, 0 deletions
diff --git a/libc/debian/changelog b/libc/debian/changelog
index 4b8d822..673f73b 100644
--- a/libc/debian/changelog
+++ b/libc/debian/changelog
@@ -1,3 +1,11 @@
+libc (2.10-16) unstable; urgency=low
+
+ * Added libutil with openpty(), forkpty() and login_tty(); Added pty.h
+ header, patched utmp.h to define login_tty() as an extension. Based on
+ FreeBSD.
+
+ -- Igor Pashev <pashev.igor@gmail.com> Sun, 23 Jun 2013 16:55:48 +0400
+
libc (2.10-15) unstable; urgency=low
* Implement getgrouplist() [from OpenBSD]
diff --git a/libc/debian/libc1-dev-illumos-i386.install b/libc/debian/libc1-dev-illumos-i386.install
index bedd641..98ecc12 100644
--- a/libc/debian/libc1-dev-illumos-i386.install
+++ b/libc/debian/libc1-dev-illumos-i386.install
@@ -12,3 +12,4 @@ usr/lib32/librt.so
usr/lib32/libsecdb.so
usr/lib32/libsocket.so
usr/lib32/libthread.so
+usr/lib32/libutil.so
diff --git a/libc/debian/libc1-dev.install b/libc/debian/libc1-dev.install
index 1ba5a5b..6848a12 100644
--- a/libc/debian/libc1-dev.install
+++ b/libc/debian/libc1-dev.install
@@ -14,6 +14,7 @@ usr/lib/*/librt.so
usr/lib/*/libsecdb.so
usr/lib/*/libsocket.so
usr/lib/*/libthread.so
+usr/lib/*/libutil.so
debian/compat_headers/* usr/include/
@@ -116,6 +117,7 @@ usr/include/priv_utils.h
usr/include/procfs.h
usr/include/prof_attr.h
usr/include/pthread.h
+usr/include/pty.h
usr/include/pwd.h
usr/include/rctl.h
usr/include/re_comp.h
diff --git a/libc/debian/libc1-illumos-i386.install b/libc/debian/libc1-illumos-i386.install
index 56ef5ce..eb9fe29 100644
--- a/libc/debian/libc1-illumos-i386.install
+++ b/libc/debian/libc1-illumos-i386.install
@@ -29,4 +29,5 @@ lib32/security/crypt_sunmd5.so.1
usr/lib32/crle
usr/lib32/lddstub
usr/lib32/libcrypt.so.1
+usr/lib32/libutil.so.1
lib32/libsecdb.so.1
diff --git a/libc/debian/libc1-illumos-i386.symbols b/libc/debian/libc1-illumos-i386.symbols
index a8bbd53..0610133 100644
--- a/libc/debian/libc1-illumos-i386.symbols
+++ b/libc/debian/libc1-illumos-i386.symbols
@@ -4782,6 +4782,11 @@ libsunelf.so.1 libc1-illumos-i386 #MINVER#
gelf_xlatetof@SUNW_1.2 2.10-1
gelf_xlatetom@SUNW_1.2 2.10-1
nlist@SUNW_0.7 2.10-1
+libutil.so.1 libc1-illumos-i386 #MINVER#
+ LIBUTIL_1.0@LIBUTIL_1.0 2.10-16
+ forkpty@LIBUTIL_1.0 2.10-16
+ login_tty@LIBUTIL_1.0 2.10-16
+ openpty@LIBUTIL_1.0 2.10-16
libxnet.so.1 libc1-illumos-i386 #MINVER#
SUNW_1.1@SUNW_1.1 2.10-1
SUNW_1.2@SUNW_1.2 2.10-1
diff --git a/libc/debian/libc1.install b/libc/debian/libc1.install
index b8ebd10..3154589 100644
--- a/libc/debian/libc1.install
+++ b/libc/debian/libc1.install
@@ -30,4 +30,5 @@ lib/*/security/crypt_sunmd5.so.1
usr/lib/*/crle
usr/lib/*/lddstub
usr/lib/*/libcrypt.so.1
+usr/lib/*/libutil.so.1
usr/src/cmd/netfiles/netconfig /etc/
diff --git a/libc/debian/libc1.symbols.illumos-amd64 b/libc/debian/libc1.symbols.illumos-amd64
index 81c3c96..c307a95 100644
--- a/libc/debian/libc1.symbols.illumos-amd64
+++ b/libc/debian/libc1.symbols.illumos-amd64
@@ -4647,6 +4647,11 @@ libsunelf.so.1 libc1 #MINVER#
gelf_xlatetof@SUNW_1.2 2.10-1
gelf_xlatetom@SUNW_1.2 2.10-1
nlist@SUNW_0.7 2.10-1
+libutil.so.1 libc1 #MINVER#
+ LIBUTIL_1.0@LIBUTIL_1.0 2.10-16
+ forkpty@LIBUTIL_1.0 2.10-16
+ login_tty@LIBUTIL_1.0 2.10-16
+ openpty@LIBUTIL_1.0 2.10-16
libxnet.so.1 libc1 #MINVER#
SUNW_1.1@SUNW_1.1 2.10-1
SUNW_1.2@SUNW_1.2 2.10-1
diff --git a/libc/debian/patches/add-libutil-openpty-forkpty.patch b/libc/debian/patches/add-libutil-openpty-forkpty.patch
new file mode 100644
index 0000000..228bc6b
--- /dev/null
+++ b/libc/debian/patches/add-libutil-openpty-forkpty.patch
@@ -0,0 +1,337 @@
+Description: add libutil with openpty(), forkpty() and login_tty()
+ Taken from FreeBSD, adopted for illumos
+Index: libc/usr/src/head/pty.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/head/pty.h 2013-06-23 15:33:28.508699869 +0400
+@@ -0,0 +1,39 @@
++/*
++Copyright: 2013, Igor Pashev <pashev.igor@gmail.com>
++License: WTFPL-2
++ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
++ Version 2, December 2004
++
++ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
++
++ Everyone is permitted to copy and distribute verbatim or modified
++ copies of this license document, and changing it is allowed as long
++ as the name is changed.
++
++ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++ 0. You just DO WHAT THE FUCK YOU WANT TO.
++
++ */
++
++#ifndef _PTY_H
++#define _PTY_H 1
++
++#include <termios.h>
++#include <sys/ioctl.h>
++
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++int openpty (int *, int *, char *, const struct termios *, const struct winsize *);
++int forkpty (int *, char *, const struct termios *, const struct winsize *);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* pty.h */
++
+Index: libc/usr/src/head/utmp.h
+===================================================================
+--- libc.orig/usr/src/head/utmp.h 2012-10-08 04:25:37.000000000 +0400
++++ libc/usr/src/head/utmp.h 2013-06-23 15:35:24.157441770 +0400
+@@ -171,6 +171,10 @@
+
+ #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
+
++#if defined(__EXTENSIONS__) || defined(_BSD_SOURCE)
++int login_tty (int);
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif
+Index: libc/usr/src/lib/libutil/Makefile
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/lib/libutil/Makefile 2013-06-23 15:44:47.866517676 +0400
+@@ -0,0 +1,23 @@
++include ../Makefile.lib
++
++SUBDIRS = $(MACH)
++$(BUILD64)SUBDIRS += $(MACH64)
++
++all := TARGET = all
++clean := TARGET = clean
++clobber := TARGET = clobber
++install := TARGET = install
++lint := TARGET = lint
++
++.KEEP_STATE:
++
++all clean clobber install lint: $(SUBDIRS)
++
++install: $(SUBDIRS)
++
++$(SUBDIRS): FRC
++ @cd $@; pwd; $(MAKE) $(TARGET)
++
++FRC:
++
++include ../Makefile.targ
+Index: libc/usr/src/head/Makefile
+===================================================================
+--- libc.orig/usr/src/head/Makefile 2013-06-23 15:30:13.580887726 +0400
++++ libc/usr/src/head/Makefile 2013-06-23 15:41:10.560728945 +0400
+@@ -141,6 +141,7 @@
+ prof.h \
+ project.h \
+ pthread.h \
++ pty.h \
+ pw.h \
+ pwd.h \
+ rctl.h \
+Index: libc/usr/src/lib/libutil/Makefile.com
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/lib/libutil/Makefile.com 2013-06-23 16:00:21.896649995 +0400
+@@ -0,0 +1,21 @@
++LIBRARY = libutil.a
++VERS = .1
++OBJECTS = pty.o login_tty.o
++
++include ../../Makefile.lib
++
++LIBS = $(DYNLIB) $(LINTLIB)
++
++SRCDIR = ../common
++
++LDLIBS += -lc
++
++$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
++
++.KEEP_STATE:
++
++all: $(LIBS)
++
++lint: lintcheck
++
++include ../../Makefile.targ
+Index: libc/usr/src/lib/libutil/amd64/Makefile
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/lib/libutil/amd64/Makefile 2013-06-23 16:00:35.891418774 +0400
+@@ -0,0 +1,5 @@
++include ../Makefile.com
++include ../../Makefile.lib.64
++
++install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
++
+Index: libc/usr/src/lib/libutil/i386/Makefile
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/lib/libutil/i386/Makefile 2013-06-23 15:44:16.312088855 +0400
+@@ -0,0 +1,4 @@
++include ../Makefile.com
++
++install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
++
+Index: libc/usr/src/lib/libutil/common/login_tty.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/lib/libutil/common/login_tty.c 2013-06-23 15:55:48.065726038 +0400
+@@ -0,0 +1,52 @@
++/*-
++ * Copyright (c) 1990, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#include <sys/param.h>
++
++#include <stdlib.h>
++#include <termios.h>
++#include <unistd.h>
++
++int
++login_tty(int fd)
++{
++ pid_t s;
++
++ s = setsid();
++ if (s == -1)
++ s = getsid(0);
++ if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
++ return (-1);
++ (void) dup2(fd, 0);
++ (void) dup2(fd, 1);
++ (void) dup2(fd, 2);
++ if (fd > 2)
++ (void) close(fd);
++ return (0);
++}
+Index: libc/usr/src/lib/libutil/common/pty.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/lib/libutil/common/pty.c 2013-06-23 16:00:02.474110042 +0400
+@@ -0,0 +1,113 @@
++/*-
++ * Copyright (c) 1990, 1993, 1994
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++
++#include <sys/types.h>
++#include <sys/ioctl.h>
++#include <sys/stat.h>
++
++#include <errno.h>
++#include <fcntl.h>
++#include <grp.h>
++#include <stdlib.h>
++#include <string.h>
++#include <termios.h>
++#include <unistd.h>
++
++#ifndef _BSD_SOURCE
++#define _BSD_SOURCE
++#endif
++#include <utmp.h>
++
++int
++openpty(int *amaster, int *aslave, char *name, struct termios *termp,
++ struct winsize *winp)
++{
++ const char *slavename;
++ int master, slave;
++
++ master = posix_openpt(O_RDWR|O_NOCTTY);
++ if (master == -1)
++ return (-1);
++
++ if (grantpt(master) == -1)
++ goto bad;
++
++ if (unlockpt(master) == -1)
++ goto bad;
++
++ slavename = ptsname(master);
++ if (slavename == NULL)
++ goto bad;
++
++ slave = open(slavename, O_RDWR);
++ if (slave == -1)
++ goto bad;
++
++ *amaster = master;
++ *aslave = slave;
++
++ if (name)
++ strcpy(name, slavename);
++ if (termp)
++ tcsetattr(slave, TCSAFLUSH, termp);
++ if (winp)
++ ioctl(slave, TIOCSWINSZ, (char *)winp);
++
++ return (0);
++
++bad: close(master);
++ return (-1);
++}
++
++int
++forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp)
++{
++ int master, slave, pid;
++
++ if (openpty(&master, &slave, name, termp, winp) == -1)
++ return (-1);
++ switch (pid = fork()) {
++ case -1:
++ return (-1);
++ case 0:
++ /*
++ * child
++ */
++ (void) close(master);
++ login_tty(slave);
++ return (0);
++ }
++ /*
++ * parent
++ */
++ *amaster = master;
++ (void) close(slave);
++ return (pid);
++}
+Index: libc/usr/src/lib/libutil/common/mapfile-vers
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libc/usr/src/lib/libutil/common/mapfile-vers 2013-06-23 15:57:55.752871631 +0400
+@@ -0,0 +1,11 @@
++$mapfile_version 2
++
++SYMBOL_VERSION LIBUTIL_1.0 {
++ global:
++ openpty;
++ forkpty;
++ login_tty;
++ local:
++ *;
++};
++
diff --git a/libc/debian/patches/series b/libc/debian/patches/series
index 167fa73..46f46a4 100644
--- a/libc/debian/patches/series
+++ b/libc/debian/patches/series
@@ -79,3 +79,4 @@ nss_status-glibc-compat.patch
libc-add-sig_t.patch
libc-add-fts.patch
libc-add-getgrouplist.patch
+add-libutil-openpty-forkpty.patch
diff --git a/libc/debian/rules b/libc/debian/rules
index 2f2c426..c5c761a 100755
--- a/libc/debian/rules
+++ b/libc/debian/rules
@@ -23,6 +23,7 @@ libs_core := \
common \
libavl \
libc \
+libutil \
libgen \
libcrypt \
libmd \