Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 2010 02:16:06 GMT
From:      Rob Farmer <rfarmer@predatorlabs.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/143236: [PATCH] deskutils/plan utmp.h --> utmpx.h
Message-ID:  <201001260216.o0Q2G6ip082581@www.freebsd.org>
Resent-Message-ID: <201001260220.o0Q2K4Sj042893@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         143236
>Category:       ports
>Synopsis:       [PATCH] deskutils/plan utmp.h --> utmpx.h
>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 26 02:20:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Rob Farmer
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD pentium4.predatorlabs.net 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r202659: Tue Jan 19 16:02:39 PST 2010     rfarmer@pentium4.predatorlabs.net:/obj/usr/src/sys/PENTIUM4  i386
>Description:
Convert from utmp.h to utmpx.h
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN plan.old/Makefile plan/Makefile
--- plan.old/Makefile	2010-01-25 17:33:11.000000000 -0800
+++ plan/Makefile	2010-01-25 17:41:29.000000000 -0800
@@ -23,6 +23,11 @@
 
 MAKE_ENV+=	DATADIR=${DATADIR} EXAMPLESDIR=${EXAMPLESDIR}
 
+.include <bsd.port.pre.mk>
+.if ${OSVERSION} > 900006
+EXTRA_PATCHES=	${PATCHDIR}/utmpx-src-daemon.c
+.endif
+
 do-install:
 	@${MKDIR} ${EXAMPLESDIR}
 
@@ -54,4 +59,4 @@
 	@${MKDIR} ${DATADIR}/netplan.dir
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ruN plan.old/files/utmpx-src-daemon.c plan/files/utmpx-src-daemon.c
--- plan.old/files/utmpx-src-daemon.c	1969-12-31 16:00:00.000000000 -0800
+++ plan/files/utmpx-src-daemon.c	2010-01-25 17:43:54.000000000 -0800
@@ -0,0 +1,33 @@
+--- daemon.c.orig	2010-01-25 17:34:06.000000000 -0800
++++ daemon.c	2010-01-25 17:38:29.000000000 -0800
+@@ -42,7 +42,7 @@
+ #ifdef __EMX__
+ #include <io.h>
+ #else
+-#include <utmp.h>
++#include <utmpx.h>
+ #endif
+ #ifdef AIXV3
+ struct utmp *getutent();
+@@ -266,7 +266,7 @@
+ 		refresh_lock(resolve_tilde(PLANDLOCK));
+ 		logged_in = FALSE;
+ 		if (pw) {
+-#if defined(SUN) || defined(BSD) || defined(__FreeBSD__)
++#if defined(SUN)
+ 		    struct utmp	ut;
+ 		    int		fd;
+ 		    int		l;
+@@ -289,9 +289,9 @@
+ 		    logged_in = TRUE;
+ #else
+ 		    short pid = getpid();
+-		    struct utmp *u;
+-		    setutent();
+-		    while ((u = getutent()))
++		    struct utmpx *u;
++		    setutxent();
++		    while ((u = getutxent()))
+ 			if (u->ut_type == USER_PROCESS &&
+ 			    u->ut_pid != pid &&
+ 			    !strncmp(pw->pw_name, u->ut_user, 8)) {


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001260216.o0Q2G6ip082581>