FreeBSD Bugzilla – Attachment 121638 Details for
Bug 164660
sysutils/su2: utmpx fix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
file.txt
file.txt (text/plain), 2.90 KB, created by
Denis Generalov
on 2012-01-31 09:40:11 UTC
(
hide
)
Description:
file.txt
Filename:
MIME Type:
Creator:
Denis Generalov
Created:
2012-01-31 09:40:11 UTC
Size:
2.90 KB
patch
obsolete
>===> Generating patch >===> Viewing diff with more >diff -ruN --exclude=CVS /usr/ports/sysutils/su2/Makefile /tmp/gd/su2/Makefile >--- /usr/ports/sysutils/su2/Makefile 2010-03-20 17:31:50.000000000 +0300 >+++ /tmp/gd/su2/Makefile 2012-01-31 00:59:18.000000000 +0400 >@@ -7,23 +7,20 @@ > > PORTNAME= su2 > PORTVERSION= 1.3 >+PORTREVISION= 1 > CATEGORIES= sysutils security > MASTER_SITES= ftp://ftp.ccs.neu.edu/pub/sysadmin/ > > MAINTAINER= ports@FreeBSD.org > COMMENT= An enhanced su, allows users to su with own password + more > >-NO_CDROM= "Don't sell for profit" >+NO_CDROM= Don't sell for profit > > MAN1= su2.1 > PLIST_FILES= bin/su2 > > .include <bsd.port.pre.mk> > >-.if ${OSVERSION} > 900007 >-BROKEN= fails to build with new utmpx >-.endif >- > post-patch: > ${REINPLACE_CMD} -e 's,/etc/super,${PREFIX}/etc/super,g' ${WRKSRC}/su2.man > >diff -ruN --exclude=CVS /usr/ports/sysutils/su2/files/patch-ad /tmp/gd/su2/files/patch-ad >--- /usr/ports/sysutils/su2/files/patch-ad 1970-01-01 03:00:00.000000000 +0300 >+++ /tmp/gd/su2/files/patch-ad 2012-01-31 01:59:00.000000000 +0400 >@@ -0,0 +1,69 @@ >+--- su2.c.orig 2012-01-31 01:37:47.000000000 +0400 >++++ su2.c 2012-01-31 01:39:14.000000000 +0400 >+@@ -151,7 +151,12 @@ >+ #include <fcntl.h> >+ #include <stdio.h> >+ #include <time.h> >++#include <osreldate.h> >++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007 >++#include <utmpx.h> >++#else >+ #include <utmp.h> >++#endif >+ #include <signal.h> >+ #ifdef IOCTL >+ #include <sys/ioctl.h> >+@@ -383,7 +388,7 @@ >+ if (FullTTY == (char *) 0) >+ FullTTY = "/dev/TTY??"; >+ >+- TTY = strrchr (FullTTY, '/') + 1; >++ TTY = strchr (FullTTY + 1, '/') + 1; >+ >+ Debug (1, "-> FullTTY=\"%s\"\n", FullTTY); >+ Debug (1, "-> TTY=\"%s\"\n", TTY); >+@@ -1315,7 +1320,11 @@ >+ * Copies name into an internal static buffer. >+ */ >+ >++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007 >++#define MAXNAME sizeof(((struct utmpx *)nptr)->ut_user) >++#else >+ #define MAXNAME sizeof(((struct utmp *)nptr)->ut_name) >++#endif >+ >+ #ifdef BROKENCUSERID >+ char *mycuserid () >+@@ -1432,6 +1441,24 @@ >+ ModifyUtmp (NewUserName) >+ register char *NewUserName; >+ { >++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007 >++ struct utmpx ut, *utr; >++ >++ strncpy(ut.ut_line, TTY, sizeof(ut.ut_line)); >++ setutxent(); >++ if ((utr = getutxline(&ut)) == NULL) { >++ endutxent(); >++ (void) fprintf (stderr, "Terminal %s not found\n", ut.ut_line); >++ return (1); >++ } >++ strncpy(utr->ut_user, NewUserName, sizeof(utr->ut_user)); >++ if (pututxline(utr) == NULL) { >++ endutxent(); >++ (void) fprintf (stderr, "pututxline failed\n"); >++ return (1); >++ } >++ endutxent(); >++#else >+ register int fd; /* /etc/utmp file */ >+ register int i; /* index */ >+ #ifdef hpux >+@@ -1482,6 +1509,7 @@ >+ >+ (void) write (fd, (char *) & Utmp, sizeof (Utmp)); >+ (void) close (fd); >++#endif >+ return (0); >+ } >+ >===> Done
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 164660
: 121638 |
121639
|
121640