same fixes as libs2.

Plus:
- do the login/logout in konsole_grantpty. It's just a question of opening
the tty slave so that login() won't get confused.
This commit is contained in:
espie 2001-04-22 13:23:38 +00:00
parent f2d3f33a01
commit 153be3513b
14 changed files with 226 additions and 25 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.14 2001/04/18 15:01:25 espie Exp $
# $OpenBSD: Makefile,v 1.15 2001/04/22 13:23:38 espie Exp $
COMMENT= "X11 toolkit, basic applications"
CATEGORIES= x11 x11/kde
@ -12,11 +12,16 @@ MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${VERSION}/distribution/tar/generic/src/
EXTRACT_SUFX= .tar.bz2
# Parts of kde want shared libraries to work, as some symbols are
# duplicated over the place.
NOT_FOR_ARCHS=${NO_SHARED_ARCHS}
USE_MOTIF= any
LIB_DEPENDS= kdecore.3.::x11/kde/libs2 \
ldap.2::databases/openldap
BUILD_DEPENDS= uic::x11/qt2-designer
BUILD_DEPENDS+= zsh:zsh-*:shells/zsh
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --with-qt-includes=${LOCALBASE}/include/X11/qt2
@ -37,8 +42,13 @@ CONFIGURE_ENV= MOC=${LOCALBASE}/bin/moc2 \
RUN_KAPPFINDER=no KDEDIR=${LOCALBASE}
MAKE_ENV= ${CONFIGURE_ENV}
pre-build:
# Let zsh act as an sh replacement
ln -sf $(LOCALBASE)/bin/zsh ${WRKBUILD}/sh
# Ensure qt2 will always be at the front
MAKE_FLAGS=CXXLD='--tag CXX ${CXX} -L${LOCALBASE}/lib/qt2'
MAKE_FLAGS+=LIBTOOL='$(WRKBUILD)/sh $(WRKBUILD)/libtool'
# GPL
PERMIT_DISTFILES_CDROM= Yes

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-aclocal_m4,v 1.1 2001/04/22 13:23:38 espie Exp $
--- aclocal.m4.orig Sat Apr 21 18:03:55 2001
+++ aclocal.m4 Sat Apr 21 18:04:15 2001
@@ -4638,19 +4638,7 @@ netbsd*)
;;
openbsd* )
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
- i*86 )
- changequote(,)dnl
- lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library'
- changequote([, ])dnl
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
+ lt_cv_deplibs_check_method=pass_all
;;
newsos6)

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-admin_libtool_m4_in,v 1.1 2001/04/22 13:23:38 espie Exp $
--- admin/libtool.m4.in.orig Sat Apr 21 18:03:05 2001
+++ admin/libtool.m4.in Sat Apr 21 18:03:42 2001
@@ -623,19 +623,7 @@ netbsd*)
;;
openbsd* )
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
- i*86 )
- changequote(,)dnl
- lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library'
- changequote([, ])dnl
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
+ lt_cv_deplibs_check_method=pass_all
;;
newsos6)

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-admin_ltcf-c_sh,v 1.1 2001/04/22 13:23:38 espie Exp $
--- admin/ltcf-c.sh.orig Sat Apr 21 18:05:03 2001
+++ admin/ltcf-c.sh Sat Apr 21 18:06:45 2001
@@ -425,10 +425,14 @@ else
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
+ archive_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ archive_expsym_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ old_archive_cmds="$old_archive_cmds~"'$RANLIB $oldlib'
+ hardcode_libdir_flag_spec='${wl}-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
+ remove_lgcc=yes
+ output_verbose_link_cmds='$CC $ac_cv_prog_cc_pic -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
;;
os2*)

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-admin_ltcf-cxx_sh,v 1.4 2001/03/12 16:18:34 espie Exp $
$OpenBSD: patch-admin_ltcf-cxx_sh,v 1.5 2001/04/22 13:23:38 espie Exp $
--- admin/ltcf-cxx.sh.orig Mon Feb 19 12:20:49 2001
+++ admin/ltcf-cxx.sh Sun Mar 11 15:42:15 2001
@@ -355,14 +355,14 @@ case "$host_os" in

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-admin_ltconfig,v 1.3 2001/03/12 16:18:34 espie Exp $
$OpenBSD: patch-admin_ltconfig,v 1.4 2001/04/22 13:23:38 espie Exp $
--- admin/ltconfig.orig Sat Mar 10 15:05:21 2001
+++ admin/ltconfig Sat Mar 10 15:07:50 2001
@@ -1162,6 +1162,8 @@ openbsd*)

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-kcontrol_thememgr_Makefile_in,v 1.2 2001/03/14 16:09:31 espie Exp $
--- kcontrol/thememgr/Makefile.in.orig Thu Mar 8 20:36:41 2001
+++ kcontrol/thememgr/Makefile.in Thu Mar 8 20:38:48 2001
@@ -643,10 +643,13 @@ maintainer-clean-generic clean mostlycle
$OpenBSD: patch-kcontrol_thememgr_Makefile_in,v 1.3 2001/04/22 13:23:39 espie Exp $
--- kcontrol/thememgr/Makefile.in.orig Tue Mar 20 18:01:18 2001
+++ kcontrol/thememgr/Makefile.in Sun Apr 22 14:49:32 2001
@@ -654,10 +654,13 @@ maintainer-clean-generic clean mostlycle
install-data-local:

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-kcontrol_thememgr_Makefile_in.orig,v 1.1 2001/04/22 13:23:39 espie Exp $
--- kcontrol/thememgr/Makefile.in.orig Thu Mar 8 20:36:41 2001
+++ kcontrol/thememgr/Makefile.in Thu Mar 8 20:38:48 2001
@@ -643,10 +643,13 @@ maintainer-clean-generic clean mostlycle
install-data-local:
- cd $(srcdir)/Themes; \
+ rm -rf $(srcdir)/Archive; \
+ cp -rp $(srcdir)/Themes $(srcdir)/Archive; \
+ find $(srcdir)/Archive -type d -name CVS -print -prune|xargs rm -rf; \
+ cd $(srcdir)/Archive; \
for f in *; do \
- if [ -d $$f -a $$f != "CVS" ]; then \
- tar --exclude CVS -b 16 -c -f - $$f | gzip -c > $(DESTDIR)$(themesdir)/$$f.ktheme; \
+ if [ -d $$f ]; then \
+ tar -b 16 -zcf $(DESTDIR)$(themesdir)/$$f.ktheme $$f; \
fi; \
done

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-konsole_src_Makefile_am,v 1.1 2001/04/22 13:23:39 espie Exp $
--- konsole/src/Makefile.am.orig Sun Apr 22 15:08:25 2001
+++ konsole/src/Makefile.am Sun Apr 22 15:08:51 2001
@@ -58,6 +58,7 @@ konsole_LDFLAGS = $(all_libraries) $(KDE
konsole_grantpty_SOURCES = konsole_grantpty.c
konsole_grantpty_LDFLAGS = $(KDE_RPATH)
+konsole_grantpty_LIBADD = $(LIBUTIL)
install-data-local:
@echo ""

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-konsole_src_Makefile_in,v 1.1 2001/04/22 13:23:39 espie Exp $
--- konsole/src/Makefile.in.orig Sun Apr 22 15:07:19 2001
+++ konsole/src/Makefile.in Sun Apr 22 15:08:21 2001
@@ -307,6 +307,7 @@ konsole_LDFLAGS = $(all_libraries) $(KDE
konsole_grantpty_SOURCES = konsole_grantpty.c
konsole_grantpty_LDFLAGS = $(KDE_RPATH)
+konsole_grantpty_LIBADD = $(LIBUTIL)
# Not AUTO here, because there are some unused files
#>- METASOURCES = TEWidget.moc TEmuVt102.moc session.moc konsole.moc TEmulation.moc TEPty.moc kwrited.moc konsole_part.moc
@@ -544,7 +545,7 @@ konsole$(EXEEXT): $(konsole_OBJECTS) $(k
konsole_grantpty$(EXEEXT): $(konsole_grantpty_OBJECTS) $(konsole_grantpty_DEPENDENCIES)
@rm -f konsole_grantpty$(EXEEXT)
- $(LINK) $(konsole_grantpty_LDFLAGS) $(konsole_grantpty_OBJECTS) $(konsole_grantpty_LDADD) $(LIBS)
+ $(LINK) $(konsole_grantpty_LDFLAGS) $(konsole_grantpty_OBJECTS) $(konsole_grantpty_LDADD) $(konsole_grantpty_LIBADD) $(LIBS)
kwrited$(EXEEXT): $(kwrited_OBJECTS) $(kwrited_DEPENDENCIES)
@rm -f kwrited$(EXEEXT)

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-konsole_src_TEPty_C,v 1.7 2001/04/22 13:23:39 espie Exp $
--- konsole/src/TEPty.C.orig Sun Apr 22 15:06:36 2001
+++ konsole/src/TEPty.C Sun Apr 22 15:07:12 2001
@@ -126,6 +126,10 @@ extern "C" {
#include <utmp.h>
#endif
+#ifdef __OpenBSD__
+/* Let konsole_grantpty do it */
+# undef USE_LOGIN
+#endif
#include <signal.h>
#ifdef HAVE_TERMIOS_H

View File

@ -0,0 +1,75 @@
$OpenBSD: patch-konsole_src_konsole_grantpty_c,v 1.1 2001/04/22 13:23:39 espie Exp $
--- konsole/src/konsole_grantpty.c.orig Sun Apr 22 15:04:38 2001
+++ konsole/src/konsole_grantpty.c Sun Apr 22 15:06:31 2001
@@ -40,6 +40,11 @@
# include <dirent.h>
#endif
+#ifdef __OpenBSD__
+# include <util.h>
+# include <fcntl.h>
+#endif
+
#define PTY_FILENO 3 /* keep in sync with grantpty */
#define TTY_GROUP "tty"
@@ -52,6 +57,8 @@ int main (int argc, char *argv[])
uid_t uid;
mode_t mod;
char* tty;
+ char* rtty;
+ int log_in;
/* check preconditions **************************************************/
if (argc != 2 || (strcmp(argv[1],"--grant") && strcmp(argv[1],"--revoke")))
@@ -77,11 +84,13 @@ int main (int argc, char *argv[])
{
uid = getuid(); /* current user id */
mod = S_IRUSR|S_IWUSR|S_IWGRP;
+ log_in = 1;
}
else
{
uid = 0; /* root */
mod = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
+ log_in = 0;
}
/* Get the group ID of the special `tty' group. */
p = getgrnam(TTY_GROUP); /* posix */
@@ -175,5 +184,36 @@ int main (int argc, char *argv[])
return 1; /* FAIL */
}
+#ifdef __OpenBSD__
+ /* Make sure the tty is fd 0, to help login work */
+ dup2(open(tty, O_RDWR), 0);
+ rtty = strrchr(tty, '/');
+ if (rtty)
+ rtty++;
+ else
+ rtty = tty;
+ if (log_in)
+ {
+ char *str_ptr;
+ struct utmp l_struct;
+ memset(&l_struct, 0, sizeof(struct utmp));
+
+ if (! (str_ptr=getlogin()) ) {
+ return 1;
+ }
+ strncpy(l_struct.ut_name, str_ptr, UT_NAMESIZE);
+
+ if (gethostname(l_struct.ut_host, UT_HOSTSIZE) == -1) {
+ if (errno != ENOMEM)
+ return 1;
+ l_struct.ut_host[UT_HOSTSIZE]=0;
+ }
+
+ strncpy(l_struct.ut_line, rtty, UT_LINESIZE);
+ time(&l_struct.ut_time);
+ login(&l_struct);
+ } else
+ logout(rtty);
+#endif
return 0; /* OK */
}

View File

@ -1,12 +0,0 @@
--- konsole/src/main.C.orig Sun Feb 18 16:28:29 2001
+++ konsole/src/main.C Tue Mar 6 21:52:42 2001
@@ -67,7 +67,9 @@ public:
/* --| main |------------------------------------------------------ */
int main(int argc, char* argv[])
{
+#ifndef __OpenBSD__
setuid(getuid()); setgid(getgid()); // drop privileges
+#endif
// deal with shell/command ////////////////////////////
bool login_shell = false;

View File

@ -1,15 +1,10 @@
@comment $OpenBSD: PLIST,v 1.14 2001/03/30 12:32:07 espie Exp $
@comment $OpenBSD: PLIST,v 1.15 2001/04/22 13:23:40 espie Exp $
@mode u+s
@owner root
bin/konsole_grantpty
bin/kcheckpass
@mode
@owner
@group utmp
@mode g+s
bin/konsole
@group
@mode
bin/appletproxy
bin/chooser
bin/conttest