head 1.7; access; symbols OPENPKG_E1_MP_HEAD:1.6 OPENPKG_E1_MP:1.6 OPENPKG_E1_MP_2_STABLE:1.5.2.1 OPENPKG_E1_FP:1.5.2.1 OPENPKG_2_STABLE_MP:1.6 OPENPKG_2_STABLE_20061018:1.5.2.1 OPENPKG_2_STABLE_20060622:1.5 OPENPKG_2_STABLE:1.5.0.2 OPENPKG_2_STABLE_BP:1.5 OPENPKG_2_5_RELEASE:1.2 OPENPKG_2_5_SOLID:1.2.0.10 OPENPKG_2_5_SOLID_BP:1.2 OPENPKG_2_4_RELEASE:1.2 OPENPKG_2_4_SOLID:1.2.0.8 OPENPKG_2_4_SOLID_BP:1.2 OPENPKG_CW_FP:1.2 OPENPKG_2_3_RELEASE:1.2 OPENPKG_2_3_SOLID:1.2.0.6 OPENPKG_2_3_SOLID_BP:1.2 OPENPKG_2_2_RELEASE:1.2 OPENPKG_2_2_SOLID:1.2.0.4 OPENPKG_2_2_SOLID_BP:1.2 OPENPKG_2_1_RELEASE:1.2 OPENPKG_2_1_SOLID:1.2.0.2 OPENPKG_2_1_SOLID_BP:1.2 OPENPKG_2_0_RELEASE:1.1 OPENPKG_2_0_SOLID:1.1.0.6 OPENPKG_2_0_SOLID_BP:1.1 OPENPKG_1_2_SOLID:1.1.0.4 OPENPKG_1_3_SOLID:1.1.0.2; locks; strict; comment @# @; 1.7 date 2007.04.23.09.40.32; author rse; state Exp; branches; next 1.6; commitid 0JQgnVIWXi7Udbfs; 1.6 date 2006.07.13.17.09.24; author cs; state Exp; branches; next 1.5; commitid wzt0ZnnzCp7SPIEr; 1.5 date 2006.02.10.22.00.37; author rse; state Exp; branches 1.5.2.1; next 1.4; commitid i88Nb5rdI5vGm5lr; 1.4 date 2006.01.11.15.56.42; author rse; state Exp; branches; next 1.3; commitid PR6k6wDkbsuDjchr; 1.3 date 2005.11.08.10.03.01; author rse; state Exp; branches; next 1.2; commitid gufauKHErX9QpW8r; 1.2 date 2004.05.27.12.04.43; author ms; state Exp; branches 1.2.10.1; next 1.1; 1.1 date 2003.11.27.19.14.31; author rse; state Exp; branches 1.1.2.1 1.1.4.1; next ; 1.5.2.1 date 2006.10.16.14.56.07; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; 1.2.10.1 date 2005.11.08.10.03.51; author rse; state Exp; branches; next 1.2.10.2; commitid j96xzMGE31N7qW8r; 1.2.10.2 date 2006.02.25.18.30.17; author rse; state Exp; branches; next ; commitid rlFHBYvxlYYDIZmr; 1.1.2.1 date 2003.11.28.11.19.31; author thl; state Exp; branches; next ; 1.1.4.1 date 2003.11.28.11.20.28; author thl; state Exp; branches; next ; desc @@ 1.7 log @port to AIX @ text @+--------------------------------------------------------------------------- | Security Bugfix | http://www.securityfocus.com/archive/1/345844/2003-11-24/2003-11-30/0 +--------------------------------------------------------------------------- Index: ansi.c --- ansi.c.orig 2003-12-05 14:57:05 +0100 +++ ansi.c 2006-07-13 17:08:06 +0200 @@@@ -559,7 +559,7 @@@@ { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - if (curr->w_NumArgs < MAXARGS) + if (curr->w_NumArgs >= 0 && curr->w_NumArgs < MAXARGS) { if (curr->w_args[curr->w_NumArgs] < 100000000) curr->w_args[curr->w_NumArgs] = Index: resize.c --- resize.c.orig 2003-09-08 16:26:31 +0200 +++ resize.c 2006-07-13 17:08:06 +0200 @@@@ -682,6 +682,17 @@@@ if (wi == 0) he = hi = 0; + if (wi > 1000) + { + Msg(0, "Window width too large, truncated"); + wi = 1000; + } + if (he > 1000) + { + Msg(0, "Window height too large, truncated"); + he = 1000; + } + if (p->w_width == wi && p->w_height == he && p->w_histheight == hi) { debug("ChangeWindowSize: No change.\n"); +--------------------------------------------------------------------------- | In Solaris 10, the setenv() function has been added. +--------------------------------------------------------------------------- Index: misc.c --- misc.c.orig 2003-12-05 14:45:41 +0100 +++ misc.c 2006-07-13 18:00:46 +0200 @@@@ -613,7 +613,7 @@@@ */ # endif /* NEEDSETENV */ #else /* USESETENV */ -# if defined(linux) || defined(__convex__) || (BSD >= 199103) +# if defined(linux) || defined(__convex__) || (BSD >= 199103) || defined(__sun) || defined(_AIX) setenv(var, value, 1); # else setenv(var, value); +--------------------------------------------------------------------------- | Mainly NetBSD specific patches taken from pkgsrc, partly relevant to | FreeBSD and Solaris as well +--------------------------------------------------------------------------- Index: config.h.in --- config.h.in.orig 2003-12-05 14:59:39 +0100 +++ config.h.in 2006-07-13 17:42:35 +0200 @@@@ -431,6 +431,11 @@@@ #undef HAVE_DIRENT_H /* + * Define HAVE_SYS_STROPTS_H if your system has + */ +#undef HAVE_SYS_STROPTS_H + +/* * If your system has getutent(), pututline(), etc. to write to the * utmp file, define GETUTENT. */ @@@@ -514,6 +519,15 @@@@ */ #undef USEVARARGS +#ifdef __NetBSD__ +/* + * XXX gcc 3.3 on some NetBSD platforms fails the configure test for this + * so force it on anyway. + */ +#undef USEVARARGS +#define USEVARARGS 1 +#endif + /* * If your system has strerror() define this. */ Index: configure --- configure.orig 2003-12-05 14:46:53 +0100 +++ configure 2006-07-13 17:54:05 +0200 @@@@ -3911,7 +3911,7 @@@@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(SVR4) && defined(sun) +#if defined(__SVR4) && defined(__sun) yes #endif @@@@ -4042,7 +4042,7 @@@@ main () { -#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news) +#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(__sun) && defined(__SVR4)) || defined(ISC) || defined(sony_news) seteuid_is_broken(0); #else seteuid(0); @@@@ -5572,9 +5572,15 @@@@ #include /* to get time_t on SCO */ #include -#if defined(SVR4) && !defined(DGUX) +#include +#if defined(__SVR4) && !defined(DGUX) \ + || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) #include #define utmp utmpx +# ifdef __NetBSD__ +# define pututline pututxline +# define getutent getutxent +# endif #else #include #endif @@@@ -5624,7 +5630,7 @@@@ #include #include -#if defined(SVR4) && !defined(DGUX) +#if defined(__SVR4) && !defined(DGUX) #include #define utmp utmpx #else @@@@ -5680,7 +5686,7 @@@@ #include #include -#if defined(SVR4) && !defined(DGUX) +#if defined(__SVR4) && !defined(DGUX) #include #define utmp utmpx #else @@@@ -6316,7 +6322,7 @@@@ _CUT_HERE_ -#if !defined(LOADAV_GETLOADAVG) && ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || (defined(SVR4) && !defined(__hpux)) || defined(sony_news) || (!defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) +#if !defined(LOADAV_GETLOADAVG) && ((defined(hp300) && !defined(__hpux)) || defined(__sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || (defined(__SVR4) && !defined(__hpux)) || defined(sony_news) || (!defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) loadtype=long # if defined(apollo) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) loadscale=65536 @@@@ -6329,7 +6335,7 @@@@ loadtype=int loadscale=1024 # else -# if defined(MIPS) || defined(SVR4) || defined(m88k) +# if defined(MIPS) || defined(__SVR4) || defined(m88k) loadscale=256 # else /* not MIPS */ loadscale=1000 /* our default value */ @@@@ -7501,6 +7507,147 @@@@ fi +for ac_header in sys/stropts.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + echo "$as_me:$LINENO: checking for setenv" >&5 echo $ECHO_N "checking for setenv... $ECHO_C" >&6 Index: configure.in --- configure.in.orig 2003-06-03 13:58:24 +0200 +++ configure.in 2006-07-13 17:50:35 +0200 @@@@ -206,7 +206,7 @@@@ AC_CHECKING(for Solaris 2.x) AC_EGREP_CPP(yes, -[#if defined(SVR4) && defined(sun) +[#if defined(__SVR4) && defined(__sun) yes #endif ], LIBS="$LIBS -lsocket -lnsl -lkstat") @@@@ -270,7 +270,7 @@@@ dnl multiuser screen sessions AC_CHECKING(seteuid) AC_TRY_LINK(,[ -#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news) +#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(__sun) && defined(__SVR4)) || defined(ISC) || defined(sony_news) seteuid_is_broken(0); #else seteuid(0); @@@@ -815,9 +815,15 @@@@ AC_TRY_LINK([ #include /* to get time_t on SCO */ #include -#if defined(SVR4) && !defined(DGUX) +#include +#if defined(__SVR4) && !defined(DGUX) \ + || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) #include #define utmp utmpx +# ifdef __NetBSD__ +# define pututline pututxline +# define getutent getutxent +# endif #else #include #endif @@@@ -832,7 +838,7 @@@@ AC_TRY_LINK([ #include #include -#if defined(SVR4) && !defined(DGUX) +#if defined(__SVR4) && !defined(DGUX) #include #define utmp utmpx #else @@@@ -848,7 +854,7 @@@@ AC_TRY_COMPILE([ #include #include -#if defined(SVR4) && !defined(DGUX) +#if defined(__SVR4) && !defined(DGUX) #include #define utmp utmpx #else @@@@ -979,7 +985,7 @@@@ #include #include ],[ -#if !defined(LOADAV_GETLOADAVG) && ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || (defined(SVR4) && !defined(__hpux)) || defined(sony_news) || (!defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) +#if !defined(LOADAV_GETLOADAVG) && ((defined(hp300) && !defined(__hpux)) || defined(__sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || (defined(__SVR4) && !defined(__hpux)) || defined(sony_news) || (!defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) loadtype=long # if defined(apollo) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) loadscale=65536 @@@@ -992,7 +998,7 @@@@ loadtype=int loadscale=1024 # else -# if defined(MIPS) || defined(SVR4) || defined(m88k) +# if defined(MIPS) || defined(__SVR4) || defined(m88k) loadscale=256 # else /* not MIPS */ loadscale=1000 /* our default value */ @@@@ -1209,6 +1215,7 @@@@ AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no)) AC_HEADER_DIRENT +AC_CHECK_HEADERS(sys/stropts.h) AC_MSG_CHECKING(for setenv) AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV), Index: os.h --- os.h.orig 2002-01-08 16:42:33 +0100 +++ os.h 2006-07-13 17:37:58 +0200 @@@@ -25,6 +25,7 @@@@ #include #include +#include #include /* In strict ANSI mode, HP-UX machines define __hpux but not hpux */ @@@@ -161,7 +162,7 @@@@ # define setregid(rgid, egid) setresgid(rgid, egid, -1) #endif -#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) +#if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && __FreeBSD_version < 500000 # define USE_SETEUID #endif @@@@ -260,9 +261,15 @@@@ #endif #if defined(UTMPOK) || defined(BUGGYGETLOGIN) -# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) +# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) \ + || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) # include -# define UTMPFILE UTMPX_FILE +# ifdef __NetBSD__ +# define UTMPFILE _PATH_UTMPX +# define NetBSD_UTMP +# else +# define UTMPFILE UTMPX_FILE +# endif # define utmp utmpx # define getutent getutxent # define getutid getutxid Index: process.c --- process.c.orig 2003-09-18 14:53:54 +0200 +++ process.c 2006-07-13 17:43:26 +0200 @@@@ -5466,7 +5466,7 @@@@ *buf = 0; return; } - act.nr = (int)data; + act.nr = (int)(long)data; act.args = noargs; act.argl = 0; DoAction(&act, -1); Index: pty.c --- pty.c.orig 2003-09-08 16:26:18 +0200 +++ pty.c 2006-07-13 17:41:29 +0200 @@@@ -33,10 +33,12 @@@@ # include #endif +#ifndef __FreeBSD__ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ -#ifdef HAVE_SVR4_PTYS +#ifdef HAVE_SYS_STROPTS_H # include #endif +#endif #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL) # include @@@@ -332,6 +334,46 @@@@ /***************************************************************/ +#if defined(__NetBSD__) && !defined(PTY_DONE) +#define PTY_DONE + +#include +#include + +int +OpenPTY(ttyn) +char **ttyn; +{ + int m, s, f; + char *t; + + do + { + if (openpty(&m, &s, TtyName, NULL, NULL) < 0) + return -1; + close(m); + close(s); + + strcpy(PtyName, TtyName); + t = strrchr(PtyName, '/'); + if ((t == NULL ) || (*++t != 't')) + return -1; + *t = 'p'; + + f = open(PtyName, O_RDWR | O_NOCTTY); + } + while (f < 0); + + initmaster(f); + *ttyn = TtyName; + + return f; +} +#endif + +/***************************************************************/ + + #ifndef PTY_DONE int OpenPTY(ttyn) Index: utmp-netbsd.c --- utmp-netbsd.c.orig 1970-01-01 01:00:00 +0100 +++ utmp-netbsd.c 2006-07-13 17:57:44 +0200 @@@@ -0,0 +1,80 @@@@ +#include +#if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000) + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct utmp saved_utmp; +static int saved_utmp_ok = 0; + +int +lineslot(line) +char *line; +{ + int slot; + struct ttyent *ttyp; + + setttyent(); + for (slot = 1; (ttyp = getttyent()) != NULL; ++slot) + if (!strcmp(ttyp->ty_name, line)) { + endttyent(); + return(slot); + } + endttyent(); + return(0); +} + +void +utmp_login(line) +char *line; +{ + int fd; + int tty; + + if (!saved_utmp_ok) + return; + + tty = lineslot(line); + if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { + (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); + (void)write(fd, &saved_utmp, sizeof(struct utmp)); + (void)close(fd); + } +} + +void +utmp_logout(const char *line) +{ + int fd; + struct utmp ut; + + if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) + return; + while (read(fd, &ut, sizeof(ut)) == sizeof(ut)) { + if (!ut.ut_name[0] || strncmp(ut.ut_line, line, UT_LINESIZE)) + continue; + memcpy(&saved_utmp, &ut, sizeof(ut)); + saved_utmp_ok = 1; + memset(ut.ut_name, 0, UT_NAMESIZE); + memset(ut.ut_host, 0, UT_HOSTSIZE); + (void)time(&ut.ut_time); + (void)lseek(fd, -(off_t)sizeof(ut), SEEK_CUR); + (void)write(fd, &ut, sizeof(ut)); + } + (void)close(fd); +} + +#endif + Index: utmp.c --- utmp.c.orig 2003-09-08 16:27:17 +0200 +++ utmp.c 2006-07-13 17:11:46 +0200 @@@@ -42,6 +42,11 @@@@ extern char *LoginName; extern int real_uid, eff_uid; +#ifdef NetBSD_UTMP +extern void utmp_login __P((char *)); +extern void utmp_logout __P((char *)); +#endif + /* * UTNOKEEP: A (ugly) hack for apollo that does two things: @@@@ -310,6 +315,9 @@@@ ASSERT(display); debug("RemoveLoginSlot: removing your logintty\n"); +#ifdef NetBSD_UTMP + utmp_logout(stripdev(D_usertty)); +#endif D_loginslot = TtyNameSlot(D_usertty); if (D_loginslot == (slot_t)0 || D_loginslot == (slot_t)-1) return; @@@@ -374,6 +382,9 @@@@ debug("RestoreLoginSlot()\n"); ASSERT(display); +#ifdef NetBSD_UTMP + utmp_login(stripdev(D_usertty)); +#endif if (utmpok && D_loginslot != (slot_t)0 && D_loginslot != (slot_t)-1) { debug1(" logging you in again (slot %#x)\n", (int)D_loginslot); @@@@ -604,6 +615,7 @@@@ char *line, *user; int pid; { + time_t temp; u->ut_type = USER_PROCESS; strncpy(u->ut_user, user, sizeof(u->ut_user)); /* Now the tricky part... guess ut_id */ @@@@ -618,7 +630,8 @@@@ #endif /* sgi */ strncpy(u->ut_line, line, sizeof(u->ut_line)); u->ut_pid = pid; - (void)time((time_t *)&u->ut_time); + (void)time(&temp); + u->ut_time = temp; } static slot_t @@@@ -726,9 +739,12 @@@@ char *line, *user; int pid; { + time_t temp; + strncpy(u->ut_line, line, sizeof(u->ut_line)); strncpy(u->ut_name, user, sizeof(u->ut_name)); - (void)time((time_t *)&u->ut_time); + (void)time(&temp); + u->ut_time = temp; } static slot_t @ 1.6 log @fix NetBSD build by adding patches from pkgsrc @ text @d50 1 a50 1 +# if defined(linux) || defined(__convex__) || (BSD >= 199103) || defined(__sun) @ 1.5 log @apply a patch from the FreeBSD ports for fixing the building on latest FreeBSD 7 @ text @d1 4 a4 3 Security Bugfix http://www.securityfocus.com/archive/1/345844/2003-11-24/2003-11-30/0 d6 2 a7 2 --- ansi.c.orig 2003-09-08 16:24:44.000000000 +0200 +++ ansi.c 2003-11-27 20:08:53.000000000 +0100 d18 2 a19 2 --- resize.c.orig 2003-09-08 16:26:31.000000000 +0200 +++ resize.c 2003-11-27 20:09:49.000000000 +0100 d38 61 a98 9 Index: configure.in --- configure.in.orig 2003-06-03 13:58:24.000000000 +0200 +++ configure.in 2004-05-27 12:43:38.909016000 +0200 @@@@ -206,7 +206,7 @@@@ AC_CHECKING(for Solaris 2.x) AC_EGREP_CPP(yes, -[#if defined(SVR4) && defined(sun) +[#if defined(__SVR4) && defined(__sun) d101 5 a105 5 ], LIBS="$LIBS -lsocket -lnsl -lkstat") @@@@ -270,7 +270,7 @@@@ dnl multiuser screen sessions AC_CHECKING(seteuid) AC_TRY_LINK(,[ d111 2 a112 2 @@@@ -815,7 +815,7 @@@@ AC_TRY_LINK([ d116 3 a118 1 +#if defined(__SVR4) && !defined(DGUX) d121 4 d126 4 a129 2 @@@@ -832,7 +832,7 @@@@ AC_TRY_LINK([ d137 2 a138 2 @@@@ -848,7 +848,7 @@@@ AC_TRY_COMPILE([ d146 4 a149 4 @@@@ -979,7 +979,7 @@@@ #include #include ],[ d155 1 a155 1 @@@@ -992,7 +992,7 @@@@ d164 157 a320 9 Index: configure --- configure.orig 2003-12-05 14:46:53.000000000 +0100 +++ configure 2004-05-27 12:45:06.186001000 +0200 @@@@ -3911,7 +3911,7 @@@@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(SVR4) && defined(sun) +#if defined(__SVR4) && defined(__sun) d323 5 a327 5 @@@@ -4042,7 +4042,7 @@@@ main () { d333 2 a334 2 @@@@ -5572,7 +5572,7 @@@@ d338 3 a340 1 +#if defined(__SVR4) && !defined(DGUX) d343 4 d348 4 a351 2 @@@@ -5624,7 +5624,7 @@@@ d359 2 a360 2 @@@@ -5680,7 +5680,7 @@@@ d368 4 a371 4 @@@@ -6316,7 +6316,7 @@@@ _CUT_HERE_ d377 1 a377 1 @@@@ -6329,7 +6329,7 @@@@ d386 8 a393 12 Index: misc.c --- misc.c.orig 2004-05-27 13:32:29.762001000 +0200 +++ misc.c 2004-05-27 13:39:40.883005000 +0200 @@@@ -613,7 +613,7 @@@@ */ # endif /* NEEDSETENV */ #else /* USESETENV */ -# if defined(linux) || defined(__convex__) || (BSD >= 199103) +# if defined(linux) || defined(__sun) || defined(__convex__) || (BSD >= 199103) setenv(var, value, 1); # else setenv(var, value); d396 1 a396 1 +++ os.h 2005-11-08 11:01:37 +0100 d414 178 d594 52 a645 2 +++ utmp.c 2006-01-11 16:53:48 +0100 @@@@ -726,9 +726,12 @@@@ a658 16 Index: pty.c --- pty.c.orig Mon Feb 6 18:54:37 2006 +++ pty.c Mon Feb 6 18:56:50 2006 @@@@ -33,10 +33,12 @@@@ # include #endif +#ifndef __FreeBSD__ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ #ifdef HAVE_SVR4_PTYS # include #endif +#endif #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL) # include @ 1.5.2.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d1 3 a3 4 +--------------------------------------------------------------------------- | Security Bugfix | http://www.securityfocus.com/archive/1/345844/2003-11-24/2003-11-30/0 +--------------------------------------------------------------------------- d5 2 a6 2 --- ansi.c.orig 2003-12-05 14:57:05 +0100 +++ ansi.c 2006-07-13 17:08:06 +0200 d17 2 a18 2 --- resize.c.orig 2003-09-08 16:26:31 +0200 +++ resize.c 2006-07-13 17:08:06 +0200 d37 9 a45 61 +--------------------------------------------------------------------------- | In Solaris 10, the setenv() function has been added. +--------------------------------------------------------------------------- Index: misc.c --- misc.c.orig 2003-12-05 14:45:41 +0100 +++ misc.c 2006-07-13 18:00:46 +0200 @@@@ -613,7 +613,7 @@@@ */ # endif /* NEEDSETENV */ #else /* USESETENV */ -# if defined(linux) || defined(__convex__) || (BSD >= 199103) +# if defined(linux) || defined(__convex__) || (BSD >= 199103) || defined(__sun) setenv(var, value, 1); # else setenv(var, value); +--------------------------------------------------------------------------- | Mainly NetBSD specific patches taken from pkgsrc, partly relevant to | FreeBSD and Solaris as well +--------------------------------------------------------------------------- Index: config.h.in --- config.h.in.orig 2003-12-05 14:59:39 +0100 +++ config.h.in 2006-07-13 17:42:35 +0200 @@@@ -431,6 +431,11 @@@@ #undef HAVE_DIRENT_H /* + * Define HAVE_SYS_STROPTS_H if your system has + */ +#undef HAVE_SYS_STROPTS_H + +/* * If your system has getutent(), pututline(), etc. to write to the * utmp file, define GETUTENT. */ @@@@ -514,6 +519,15 @@@@ */ #undef USEVARARGS +#ifdef __NetBSD__ +/* + * XXX gcc 3.3 on some NetBSD platforms fails the configure test for this + * so force it on anyway. + */ +#undef USEVARARGS +#define USEVARARGS 1 +#endif + /* * If your system has strerror() define this. */ Index: configure --- configure.orig 2003-12-05 14:46:53 +0100 +++ configure 2006-07-13 17:54:05 +0200 @@@@ -3911,7 +3911,7 @@@@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(SVR4) && defined(sun) +#if defined(__SVR4) && defined(__sun) d48 5 a52 5 @@@@ -4042,7 +4042,7 @@@@ main () { d58 2 a59 2 @@@@ -5572,9 +5572,15 @@@@ d63 1 a63 3 +#include +#if defined(__SVR4) && !defined(DGUX) \ + || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) a65 4 +# ifdef __NetBSD__ +# define pututline pututxline +# define getutent getutxent +# endif d67 2 a68 4 #include #endif @@@@ -5624,7 +5630,7 @@@@ d76 2 a77 2 @@@@ -5680,7 +5686,7 @@@@ d85 4 a88 4 @@@@ -6316,7 +6322,7 @@@@ _CUT_HERE_ d94 1 a94 1 @@@@ -6329,7 +6335,7 @@@@ d103 11 a113 1 @@@@ -7501,6 +7507,147 @@@@ d115 3 a117 1 fi a118 160 +for ac_header in sys/stropts.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + echo "$as_me:$LINENO: checking for setenv" >&5 echo $ECHO_N "checking for setenv... $ECHO_C" >&6 Index: configure.in --- configure.in.orig 2003-06-03 13:58:24 +0200 +++ configure.in 2006-07-13 17:50:35 +0200 @@@@ -206,7 +206,7 @@@@ AC_CHECKING(for Solaris 2.x) AC_EGREP_CPP(yes, -[#if defined(SVR4) && defined(sun) +[#if defined(__SVR4) && defined(__sun) yes #endif ], LIBS="$LIBS -lsocket -lnsl -lkstat") @@@@ -270,7 +270,7 @@@@ dnl multiuser screen sessions AC_CHECKING(seteuid) AC_TRY_LINK(,[ d124 2 a125 2 @@@@ -815,9 +815,15 @@@@ AC_TRY_LINK([ d129 1 a129 3 +#include +#if defined(__SVR4) && !defined(DGUX) \ + || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) a131 4 +# ifdef __NetBSD__ +# define pututline pututxline +# define getutent getutxent +# endif d133 2 a134 4 #include #endif @@@@ -832,7 +838,7 @@@@ AC_TRY_LINK([ d142 2 a143 2 @@@@ -848,7 +854,7 @@@@ AC_TRY_COMPILE([ d151 4 a154 4 @@@@ -979,7 +985,7 @@@@ #include #include ],[ d160 1 a160 1 @@@@ -992,7 +998,7 @@@@ d169 12 a180 8 @@@@ -1209,6 +1215,7 @@@@ AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no)) AC_HEADER_DIRENT +AC_CHECK_HEADERS(sys/stropts.h) AC_MSG_CHECKING(for setenv) AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV), d183 1 a183 1 +++ os.h 2006-07-13 17:37:58 +0200 a200 178 @@@@ -260,9 +261,15 @@@@ #endif #if defined(UTMPOK) || defined(BUGGYGETLOGIN) -# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) +# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) \ + || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) # include -# define UTMPFILE UTMPX_FILE +# ifdef __NetBSD__ +# define UTMPFILE _PATH_UTMPX +# define NetBSD_UTMP +# else +# define UTMPFILE UTMPX_FILE +# endif # define utmp utmpx # define getutent getutxent # define getutid getutxid Index: process.c --- process.c.orig 2003-09-18 14:53:54 +0200 +++ process.c 2006-07-13 17:43:26 +0200 @@@@ -5466,7 +5466,7 @@@@ *buf = 0; return; } - act.nr = (int)data; + act.nr = (int)(long)data; act.args = noargs; act.argl = 0; DoAction(&act, -1); Index: pty.c --- pty.c.orig 2003-09-08 16:26:18 +0200 +++ pty.c 2006-07-13 17:41:29 +0200 @@@@ -33,10 +33,12 @@@@ # include #endif +#ifndef __FreeBSD__ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ -#ifdef HAVE_SVR4_PTYS +#ifdef HAVE_SYS_STROPTS_H # include #endif +#endif #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL) # include @@@@ -332,6 +334,46 @@@@ /***************************************************************/ +#if defined(__NetBSD__) && !defined(PTY_DONE) +#define PTY_DONE + +#include +#include + +int +OpenPTY(ttyn) +char **ttyn; +{ + int m, s, f; + char *t; + + do + { + if (openpty(&m, &s, TtyName, NULL, NULL) < 0) + return -1; + close(m); + close(s); + + strcpy(PtyName, TtyName); + t = strrchr(PtyName, '/'); + if ((t == NULL ) || (*++t != 't')) + return -1; + *t = 'p'; + + f = open(PtyName, O_RDWR | O_NOCTTY); + } + while (f < 0); + + initmaster(f); + *ttyn = TtyName; + + return f; +} +#endif + +/***************************************************************/ + + #ifndef PTY_DONE int OpenPTY(ttyn) Index: utmp-netbsd.c --- utmp-netbsd.c.orig 1970-01-01 01:00:00 +0100 +++ utmp-netbsd.c 2006-07-13 17:57:44 +0200 @@@@ -0,0 +1,80 @@@@ +#include +#if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000) + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct utmp saved_utmp; +static int saved_utmp_ok = 0; + +int +lineslot(line) +char *line; +{ + int slot; + struct ttyent *ttyp; + + setttyent(); + for (slot = 1; (ttyp = getttyent()) != NULL; ++slot) + if (!strcmp(ttyp->ty_name, line)) { + endttyent(); + return(slot); + } + endttyent(); + return(0); +} + +void +utmp_login(line) +char *line; +{ + int fd; + int tty; + + if (!saved_utmp_ok) + return; + + tty = lineslot(line); + if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { + (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); + (void)write(fd, &saved_utmp, sizeof(struct utmp)); + (void)close(fd); + } +} + +void +utmp_logout(const char *line) +{ + int fd; + struct utmp ut; + + if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) + return; + while (read(fd, &ut, sizeof(ut)) == sizeof(ut)) { + if (!ut.ut_name[0] || strncmp(ut.ut_line, line, UT_LINESIZE)) + continue; + memcpy(&saved_utmp, &ut, sizeof(ut)); + saved_utmp_ok = 1; + memset(ut.ut_name, 0, UT_NAMESIZE); + memset(ut.ut_host, 0, UT_HOSTSIZE); + (void)time(&ut.ut_time); + (void)lseek(fd, -(off_t)sizeof(ut), SEEK_CUR); + (void)write(fd, &ut, sizeof(ut)); + } + (void)close(fd); +} + +#endif + d203 2 a204 52 +++ utmp.c 2006-07-13 17:11:46 +0200 @@@@ -42,6 +42,11 @@@@ extern char *LoginName; extern int real_uid, eff_uid; +#ifdef NetBSD_UTMP +extern void utmp_login __P((char *)); +extern void utmp_logout __P((char *)); +#endif + /* * UTNOKEEP: A (ugly) hack for apollo that does two things: @@@@ -310,6 +315,9 @@@@ ASSERT(display); debug("RemoveLoginSlot: removing your logintty\n"); +#ifdef NetBSD_UTMP + utmp_logout(stripdev(D_usertty)); +#endif D_loginslot = TtyNameSlot(D_usertty); if (D_loginslot == (slot_t)0 || D_loginslot == (slot_t)-1) return; @@@@ -374,6 +382,9 @@@@ debug("RestoreLoginSlot()\n"); ASSERT(display); +#ifdef NetBSD_UTMP + utmp_login(stripdev(D_usertty)); +#endif if (utmpok && D_loginslot != (slot_t)0 && D_loginslot != (slot_t)-1) { debug1(" logging you in again (slot %#x)\n", (int)D_loginslot); @@@@ -604,6 +615,7 @@@@ char *line, *user; int pid; { + time_t temp; u->ut_type = USER_PROCESS; strncpy(u->ut_user, user, sizeof(u->ut_user)); /* Now the tricky part... guess ut_id */ @@@@ -618,7 +630,8 @@@@ #endif /* sgi */ strncpy(u->ut_line, line, sizeof(u->ut_line)); u->ut_pid = pid; - (void)time((time_t *)&u->ut_time); + (void)time(&temp); + u->ut_time = temp; } static slot_t @@@@ -726,9 +739,12 @@@@ d218 16 @ 1.4 log @some utmp portability fixes from the FreeBSD ports @ text @d218 16 @ 1.3 log @fix compile warnings and fix multi-user mode under FreeBSD @ text @d201 17 @ 1.2 log @repair buildconf to correctly detect SVR4 OSs, and use the correct setenv(3) argument format on Solaris OSs @ text @d181 20 @ 1.2.10.1 log @MFC: fix compile warnings and fix multi-user mode under FreeBSD @ text @a180 20 Index: os.h --- os.h.orig 2002-01-08 16:42:33 +0100 +++ os.h 2005-11-08 11:01:37 +0100 @@@@ -25,6 +25,7 @@@@ #include #include +#include #include /* In strict ANSI mode, HP-UX machines define __hpux but not hpux */ @@@@ -161,7 +162,7 @@@@ # define setregid(rgid, egid) setresgid(rgid, egid, -1) #endif -#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) +#if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && __FreeBSD_version < 500000 # define USE_SETEUID #endif @ 1.2.10.2 log @MFC: utmp fixes and FreeBSD 7 support @ text @a200 33 Index: utmp.c --- utmp.c.orig 2003-09-08 16:27:17 +0200 +++ utmp.c 2006-01-11 16:53:48 +0100 @@@@ -726,9 +726,12 @@@@ char *line, *user; int pid; { + time_t temp; + strncpy(u->ut_line, line, sizeof(u->ut_line)); strncpy(u->ut_name, user, sizeof(u->ut_name)); - (void)time((time_t *)&u->ut_time); + (void)time(&temp); + u->ut_time = temp; } static slot_t Index: pty.c --- pty.c.orig Mon Feb 6 18:54:37 2006 +++ pty.c Mon Feb 6 18:56:50 2006 @@@@ -33,10 +33,12 @@@@ # include #endif +#ifndef __FreeBSD__ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ #ifdef HAVE_SVR4_PTYS # include #endif +#endif #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL) # include @ 1.1 log @modifying package: screen-4.0.1 20031009 -> 20031127 @ text @d37 144 @ 1.1.4.1 log @SA-2003.050-screen @ text @@ 1.1.2.1 log @SA-2003.050-screen @ text @@