From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jan 31 10:40:09 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69FF01065673 for ; Tue, 31 Jan 2012 10:40:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4F22A8FC0A for ; Tue, 31 Jan 2012 10:40:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0VAe8sL047151 for ; Tue, 31 Jan 2012 10:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0VAe8ho047150; Tue, 31 Jan 2012 10:40:08 GMT (envelope-from gnats) Date: Tue, 31 Jan 2012 10:40:08 GMT Message-Id: <201201311040.q0VAe8ho047150@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: GD Cc: Subject: Re: ports/164660: utmpx fix X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: GD List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 10:40:09 -0000 The following reply was made to PR ports/164660; it has been noted by GNATS. From: GD To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/164660: utmpx fix Date: Tue, 31 Jan 2012 14:07:08 +0400 This is a multi-part message in MIME format. --Multipart=_Tue__31_Jan_2012_14_07_08_+0400_SYTPXBou675id2do Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sorry, this patch break su2 for FreeBSD versions before 8.0 I attach new patch. On Tue, 31 Jan 2012 09:33:55 GMT Denis Generalov wrote: > > >Number: 164660 > >Category: ports > >Synopsis: utmpx fix > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-ports-bugs > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: update > >Submitter-Id: current-users > >Arrival-Date: Tue Jan 31 09:40:11 UTC 2012 > >Closed-Date: > >Last-Modified: > >Originator: Denis Generalov > >Release: 9.0-STABLE > >Organization: > Rambler > >Environment: > FreeBSD tyl2.park.rambler.ru 9.0-STABLE FreeBSD 9.0-STABLE #0: Sat Jan 14 02:35:27 MSK 2012 root@tyl2.park.rambler.ru:/usr/obj/usr/src/sys/GENERIC amd64 > >Description: > port marked as broken due to changes in accounting system > >How-To-Repeat: > su2 -r or su2 -s > >Fix: > > > Patch attached with submission follows: > > ===> 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 > > -.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 > + #include > + #include > ++#include > ++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007 > ++#include > ++#else > + #include > ++#endif > + #include > + #ifdef IOCTL > + #include > +@@ -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 > > > >Release-Note: > >Audit-Trail: > >Unformatted: > _______________________________________________ > freebsd-ports-bugs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs > To unsubscribe, send any mail to "freebsd-ports-bugs-unsubscribe@freebsd.org" -- GD --Multipart=_Tue__31_Jan_2012_14_07_08_+0400_SYTPXBou675id2do Content-Type: text/plain; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: 7bit ===> Generating patch ===> Viewing diff with more diff -ruN --exclude=CVS /usr/ports/sysutils/su2/Makefile /tmp/gd/su2/Makefile --- /usr/ports/sysutils/su2/Makefile 2012-01-31 13:59:33.000000000 +0400 +++ /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 -.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 14:02:53.000000000 +0400 @@ -0,0 +1,72 @@ +--- su2.c.orig 2012-01-31 13:59:38.000000000 +0400 ++++ su2.c 2012-01-31 14:02:28.000000000 +0400 +@@ -151,7 +151,12 @@ + #include + #include + #include ++#include ++#if defined(__FreeBSD_version) && __FreeBSD_version > 900007 ++#include ++#else + #include ++#endif + #include + #ifdef IOCTL + #include +@@ -383,7 +388,11 @@ + if (FullTTY == (char *) 0) + FullTTY = "/dev/TTY??"; + ++#if defined(__FreeBSD_version) && __FreeBSD_version > 800007 ++ TTY = strchr (FullTTY + 1, '/') + 1; ++#else + TTY = strrchr (FullTTY, '/') + 1; ++#endif + + Debug (1, "-> FullTTY=\"%s\"\n", FullTTY); + Debug (1, "-> TTY=\"%s\"\n", TTY); +@@ -1315,7 +1324,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 +1445,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 +1513,7 @@ + + (void) write (fd, (char *) & Utmp, sizeof (Utmp)); + (void) close (fd); ++#endif + return (0); + } + ===> Done --Multipart=_Tue__31_Jan_2012_14_07_08_+0400_SYTPXBou675id2do--