Index: head/misc/orville-write/Makefile =================================================================== --- head/misc/orville-write/Makefile (revision 550842) +++ head/misc/orville-write/Makefile (revision 550843) @@ -1,43 +1,44 @@ # Created by: James Howard # $FreeBSD$ PORTNAME= orville-write PORTVERSION= 2.55 +PORTREVISION= 1 CATEGORIES= misc MASTER_SITES= http://unixpapa.com/software/ MAINTAINER= ports@FreeBSD.org COMMENT= Advanced replacement for write/mesg GNU_CONFIGURE= yes CFLAGS+= -Wno-return-type PLIST_FILES= "@(,,4711) bin/amin" "@(,,4711) bin/helpers" "@(,,4711) bin/huh" \ bin/jot "@(,,4711) bin/mesg" bin/tel bin/telegram \ "@(,,6711) bin/write" etc/orville.conf etc/wrthist etc/wrttmp \ man/man1/amin.1.gz man/man1/helpers.1.gz man/man1/huh.1.gz \ man/man1/mesg.1.gz man/man1/write.1.gz MAKE_JOBS_UNSAFE=yes do-install: .for i in amin helpers huh mesg ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/bin .endfor .for i in write ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/bin .endfor .for i in jot tel telegram ${LN} -sf write ${STAGEDIR}${PREFIX}/bin/${i} .endfor .for i in orville.conf ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/etc .endfor .for i in wrthist wrttmp ${INSTALL_DATA} -m 600 /dev/null ${STAGEDIR}${PREFIX}/etc/${i} .endfor .for i in amin.1 helpers.1 huh.1 mesg.1 write.1 ${INSTALL_MAN} ${WRKSRC}/${i} ${STAGEDIR}${MANPREFIX}/man/man1 .endfor .include Index: head/misc/orville-write/files/patch-lib_common.c =================================================================== --- head/misc/orville-write/files/patch-lib_common.c (revision 550842) +++ head/misc/orville-write/files/patch-lib_common.c (nonexistent) @@ -1,19 +0,0 @@ ---- lib_common.c.orig 2010-02-02 22:34:36.829638978 -0800 -+++ lib_common.c 2010-02-02 22:36:28.170798539 -0800 -@@ -141,13 +141,13 @@ - * fail. The tty name need not be null terminated. - */ - --struct utmp *find_utmp(char *tty) -+struct utmpx *find_utmp(char *tty) - { --struct utmp tmputmp; -+struct utmpx tmputmp; - - strncpy(tmputmp.ut_line, tty, UT_LINESIZE); - setutent(); /* open and/or rewind */ -- return getutline(&tmputmp); -+ return getutxline(&tmputmp); - } - - Property changes on: head/misc/orville-write/files/patch-lib_common.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-wrt_him.c =================================================================== --- head/misc/orville-write/files/patch-wrt_him.c (revision 550842) +++ head/misc/orville-write/files/patch-wrt_him.c (nonexistent) @@ -1,150 +0,0 @@ ---- wrt_him.c.orig 2004-09-28 20:32:13.000000000 -0700 -+++ wrt_him.c 2010-02-02 22:31:08.634155195 -0800 -@@ -116,7 +116,7 @@ - extern struct wrttmp mywrt; - - /* Open utmp file */ -- setutent(); -+ setutxent(); - - /* Look me up */ - find_me(); -@@ -204,7 +204,7 @@ - int perm, hisperm= 0; - time_t hisatime= 0; - time_t atime; --struct utmp *ut; -+struct utmpx *ut; - struct wrttmp tmpwrt; - long tmppos; - -@@ -213,16 +213,14 @@ - { - /* Check if this is the target user, ignoring X-window lines */ - if (ut->ut_line[0] != ':' && --#ifdef USER_PROCESS - ut->ut_type == USER_PROCESS && --#endif -- !strncmp(hisname, ut->ut_name, UT_NAMESIZE)) -+ !strncmp(hisname, ut->ut_user, UT_NAMESIZE)) - { - /* Count matches */ - cnt++; - - /* Find wrttmp entry */ -- find_wrttmp(ut->ut_line, ut->ut_time, &tmpwrt, &tmppos); -+ find_wrttmp(ut->ut_line, ut->ut_tv.tv_sec, &tmpwrt, &tmppos); - - /* Is this guy writing me? */ - write_me= !strncmp(tmpwrt.wrt_what,myname,UT_NAMESIZE); -@@ -283,7 +281,7 @@ - - int find_tty() - { --struct utmp *ut; -+struct utmpx *ut; - - if ((ut= find_utmp(histty)) == NULL) - return(1); -@@ -291,23 +289,23 @@ - if (*hisname != '\0') - { - /* Does the name not match? */ -- if (strncmp(hisname, ut->ut_name, UT_NAMESIZE)) -+ if (strncmp(hisname, ut->ut_user, UT_NAMESIZE)) - return(2); - } - else - { - /* Is anyone on that line? */ -- if (*ut->ut_name == '\0') -+ if (*ut->ut_user == '\0') - { - printf("No one logged onto %s\n",histty); - wrtlog("FAIL: empty tty"); - done(1); - } -- strncpy(hisname, ut->ut_name, UT_NAMESIZE); -+ strncpy(hisname, ut->ut_user, UT_NAMESIZE); - } - printf("%s to %s on %s...",what[telegram],hisname,histty); - if (!telegram) putchar('\n'); -- find_wrttmp(histty,ut->ut_time,&hiswrt,&hispos); -+ find_wrttmp(histty,ut->ut_tv.tv_sec,&hiswrt,&hispos); - return(0); - } - -@@ -321,7 +319,7 @@ - - void find_answer() - { --struct utmp *ut; -+struct utmpx *ut; - int slot; - - lseek(wstream,hispos= wrttmp_offset(slot= 0),0); -@@ -332,9 +330,9 @@ - { - /* Found someone writing me - get his name from utmp */ - strncpy(histty,hiswrt.wrt_line,UT_LINESIZE); -- if ((ut= find_utmp(histty)) != NULL && ut->ut_name[0] != '\0') -+ if ((ut= find_utmp(histty)) != NULL && ut->ut_user[0] != '\0') - { -- strncpy(hisname,ut->ut_name,UT_NAMESIZE); -+ strncpy(hisname,ut->ut_user,UT_NAMESIZE); - printf("Replying to %s on %s...",hisname,histty); - if (!telegram) putchar('\n'); - return; -@@ -363,7 +361,7 @@ - int ahelpers= 0; /* Number of helpers available */ - int previous; - int slot= 0; --struct utmp *ut; -+struct utmpx *ut; - struct wrttmp tmpwrt; - long tmppos; - -@@ -387,7 +385,7 @@ - - /* Find the helper candidate in utmp - if he's not there skip out */ - if ((ut= find_utmp(tmpwrt.wrt_line)) == NULL || -- ut->ut_name[0] == '\0' || ut->ut_time != tmpwrt.wrt_time) -+ ut->ut_user[0] == '\0' || ut->ut_tv.tv_sec != tmpwrt.wrt_time) - continue; - - /* Reject helpers with their message permissions off */ -@@ -397,14 +395,14 @@ - { - /* Perms off - but am I in .yeswrite file? */ - if (!f_exceptions || tmpwrt.wrt_except != 'y' || -- !isuexception(ut->ut_name, 1, myname)) -+ !isuexception(ut->ut_user, 1, myname)) - continue; - } - else - { - /* Perms on - but am I in .nowrite file? */ - if (f_exceptions && tmpwrt.wrt_except == 'y' && -- isuexception(ut->ut_name, 0, myname)) -+ isuexception(ut->ut_user, 0, myname)) - continue; - } - } -@@ -422,7 +420,7 @@ - ahelpers++; - - /* Has he helped us before? */ -- previous= !strncmp(ut->ut_name, mywrt.wrt_last, UT_NAMESIZE); -+ previous= !strncmp(ut->ut_user, mywrt.wrt_last, UT_NAMESIZE); - - /* So roll the dice to see if we will choose him */ - if (!previous && (unsigned)RAND() > (unsigned)RAND_MAX / ahelpers) -@@ -430,7 +428,7 @@ - - /* We chose him, so make him our helper candidate so far */ - strncpy(histty, tmpwrt.wrt_line, UT_LINESIZE); -- strncpy(hisname, ut->ut_name, UT_NAMESIZE); -+ strncpy(hisname, ut->ut_user, UT_NAMESIZE); - hiswrt= tmpwrt; - hispos= tmppos; - Property changes on: head/misc/orville-write/files/patch-wrt_him.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-lib_common.h =================================================================== --- head/misc/orville-write/files/patch-lib_common.h (revision 550842) +++ head/misc/orville-write/files/patch-lib_common.h (nonexistent) @@ -1,11 +0,0 @@ ---- lib_common.h.orig 2010-02-02 22:40:13.646402561 -0800 -+++ lib_common.h 2010-02-02 22:40:30.475105092 -0800 -@@ -6,7 +6,7 @@ - #include "getutent.h" - - int init_wstream(int mode); --struct utmp *find_utmp(char *tty); -+struct utmpx *find_utmp(char *tty); - void find_wrttmp(char *tty, time_t time,struct wrttmp *wbuf, long *pos); - void dflt_wrttmp(struct wrttmp *wbuf, char *tty, time_t time); - char *leafname(char *fullpath); Property changes on: head/misc/orville-write/files/patch-lib_common.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-wrt_me.c =================================================================== --- head/misc/orville-write/files/patch-wrt_me.c (revision 550842) +++ head/misc/orville-write/files/patch-wrt_me.c (nonexistent) @@ -1,34 +0,0 @@ ---- wrt_me.c.orig 2010-02-02 22:31:42.972816673 -0800 -+++ wrt_me.c 2010-02-02 22:33:09.915329757 -0800 -@@ -14,19 +14,19 @@ - - void find_me() - { --struct utmp *ut; -+struct utmpx *ut; - struct passwd *pw; - int myuid; - - /* Search utmp for myself */ - -- if ((ut= find_utmp(mytty)) == NULL || ut->ut_name[0] == '\0') -+ if ((ut= find_utmp(mytty)) == NULL || ut->ut_user[0] == '\0') - { - printf("%s: Panic - Unable to find your tty (%s) in "_PATH_UTMP"\n", - progname, mytty); - done(1); - } -- strncpy(myname, ut->ut_name, UT_NAMESIZE); -+ strncpy(myname, ut->ut_user, UT_NAMESIZE); - - /* Check if this is our real identity */ - #ifndef SLOWPASSWD -@@ -48,7 +48,7 @@ - - /* Find my wrt_tmp entry */ - -- find_wrttmp(mytty, ut->ut_time, &mywrt, &mypos); -+ find_wrttmp(mytty, ut->ut_tv.tv_sec, &mywrt, &mypos); - } - - Property changes on: head/misc/orville-write/files/patch-wrt_me.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-amin.c =================================================================== --- head/misc/orville-write/files/patch-amin.c (revision 550842) +++ head/misc/orville-write/files/patch-amin.c (revision 550843) @@ -1,40 +1,40 @@ ---- amin.c.orig 2010-02-02 23:04:35.773467035 -0800 -+++ amin.c 2010-02-02 23:06:45.674814831 -0800 -@@ -194,16 +194,16 @@ +--- amin.c.orig 2004-09-29 04:43:10 UTC ++++ amin.c +@@ -194,16 +194,16 @@ char *r; void locate_wrttmp(char *tty, struct wrttmp *wbuf, long *pos) { -struct utmp *ut; +struct utmpx *ut; /* Find utmp entry */ - if ((ut= find_utmp(tty)) == NULL || ut->ut_name[0] == '\0') + if ((ut= find_utmp(tty)) == NULL || ut->ut_user[0] == '\0') { printf("%s: Can't find your tty (%s) in utmp\n",progname,tty); exit(1); } - find_wrttmp(tty, ut->ut_time, wbuf, pos); + find_wrttmp(tty, ut->ut_tv.tv_sec, wbuf, pos); } -@@ -230,7 +230,7 @@ +@@ -230,7 +230,7 @@ char *shortcmd; /* command without full pathname */ } /* Close utmp file */ - endutent(); + endutxent(); /* Figure out name of program being exec'ed */ if ((shortcmd= strrchr(fullcmd,'/')) == NULL) -@@ -241,7 +241,7 @@ +@@ -241,7 +241,7 @@ char *shortcmd; /* command without full pathname */ /* Fix my entry in wrttmp */ newwrt= mywrt; newwrt.wrt_what[0]= '!'; - strncpy(newwrt.wrt_what+1, shortcmd, UT_NAMESIZE-1); + strncpy(newwrt.wrt_what+1, shortcmd, sizeof(((struct utmpx *)0)->ut_user)-2); #ifndef TTYPERMS if (tmp_mesg != 's') newwrt.wrt_mesg= tmp_mesg; #endif Index: head/misc/orville-write/files/patch-getutent.c =================================================================== --- head/misc/orville-write/files/patch-getutent.c (revision 550842) +++ head/misc/orville-write/files/patch-getutent.c (revision 550843) @@ -1,106 +1,106 @@ ---- getutent.c.orig 2000-01-31 22:02:45.000000000 -0800 -+++ getutent.c 2010-02-02 22:53:30.347068707 -0800 -@@ -20,18 +20,8 @@ +--- getutent.c.orig 2000-02-01 06:02:45 UTC ++++ getutent.c +@@ -20,18 +20,8 @@ static int openut() { if (utmp.state == 0) { - if ((utmp.fd= open(utmp.fname ? utmp.fname : _PATH_UTMP, - O_RDONLY)) < 0) - { - utmp.state= -1; - return -1; - } - else - { utmp.state= 1; - fcntl(utmp.fd, F_SETFD, 1); /* Close over execs */ return 0; - } } } -@@ -42,8 +32,7 @@ +@@ -42,8 +32,7 @@ static int openut() void endutent() { if (utmp.state == 1) - close(utmp.fd); - utmp.state= 0; + utmp.state= 0; } -@@ -52,8 +41,7 @@ +@@ -52,8 +41,7 @@ void endutent() void setutent() { - if (utmp.state == 1) - lseek(utmp.fd, 0L, 0); + ; } -@@ -75,9 +63,9 @@ +@@ -75,9 +63,9 @@ int utmpname(const char *file) /* GETUTENT - Read the next entry from the utmp file into static storage. */ -struct utmp *getutent() +struct utmpx *getutent() { -static struct utmp ut; +static struct utmpx *ut; switch (utmp.state) { -@@ -85,11 +73,11 @@ +@@ -85,11 +73,11 @@ static struct utmp ut; openut(); /* Drop through */ case 1: - if (read(utmp.fd, &ut, sizeof(struct utmp)) == sizeof(struct utmp)) - return &ut; + if ((ut = getutxent()) != NULL) + return ut; /* Drop through */ default: - return (struct utmp *)NULL; + return (struct utmpx *)NULL; } } -@@ -100,9 +88,9 @@ +@@ -100,9 +88,9 @@ static struct utmp ut; * we conform with Linux and Solaris. */ -struct utmp *getutline(const struct utmp *in) +struct utmpx *getutline(const struct utmpx *in) { -static struct utmp ut; +static struct utmpx *ut; switch (utmp.state) { -@@ -110,20 +98,20 @@ +@@ -110,20 +98,20 @@ static struct utmp ut; openut(); /* Drop through */ case 1: - while (read(utmp.fd, &ut, sizeof(struct utmp)) == sizeof(struct utmp)) + while ((ut = getutxent()) != NULL) { if ( #if defined(USER_PROCESS) && defined(LOGIN_PROCESS) - (ut.ut_type == USER_PROCESS || ut.ut_type == LOGIN_PROCESS) && + (ut->ut_type == USER_PROCESS || ut->ut_type == LOGIN_PROCESS) && #endif - !strncmp(ut.ut_line, in->ut_line, UT_LINESIZE)) + !strncmp(ut->ut_line, in->ut_line, sizeof(ut->ut_line))) { - return &ut; + return ut; } } /* Drop through */ default: - return (struct utmp *)NULL; + return (struct utmpx *)NULL; } } Index: head/misc/orville-write/files/patch-getutent.h =================================================================== --- head/misc/orville-write/files/patch-getutent.h (revision 550842) +++ head/misc/orville-write/files/patch-getutent.h (revision 550843) @@ -1,13 +1,13 @@ ---- getutent.h.orig 2000-01-31 22:01:13.000000000 -0800 -+++ getutent.h 2010-02-02 22:49:58.043092643 -0800 +--- getutent.h.orig 2000-02-01 06:01:13 UTC ++++ getutent.h @@ -14,8 +14,8 @@ int utmpname(const char *file); void endutent(void); void setutent(void); -struct utmp *getutent(void); -struct utmp *getutline(const struct utmp *ut); +struct utmpx *getutent(void); +struct utmpx *getutline(const struct utmpx *ut); #endif /*HAVE_GETUTENT*/ #endif /* GETUTENT_H */ Index: head/misc/orville-write/files/patch-helpers.c =================================================================== --- head/misc/orville-write/files/patch-helpers.c (revision 550842) +++ head/misc/orville-write/files/patch-helpers.c (revision 550843) @@ -1,84 +1,84 @@ ---- helpers.c.orig 2000-02-20 09:28:08.000000000 -0800 -+++ helpers.c 2010-02-02 23:20:25.434811144 -0800 +--- helpers.c.orig 2000-02-20 17:28:08 UTC ++++ helpers.c @@ -11,7 +11,7 @@ struct hlp { time_t time; /* login time from wrttmp file */ - char line[UT_LINESIZE]; /* ttyline occupied by a helper */ + char line[sizeof(((struct utmpx *)0)->ut_line) -1]; /* ttyline occupied by a helper */ int busy; /* is he busy? */ struct hlp *next; /* next helper */ } *list= NULL; -@@ -27,7 +27,7 @@ +@@ -27,7 +27,7 @@ struct hlp *curr, *prev; for (curr= list, prev= NULL; curr != NULL; prev= curr,curr= prev->next) { - if (!strncmp(tty, curr->line, UT_LINESIZE)) + if (!strncmp(tty, curr->line, ((struct utmpx *)0)->ut_line -1)) { if (prev == NULL) list= curr->next; -@@ -47,7 +47,7 @@ +@@ -47,7 +47,7 @@ struct hlp *curr, *prev; int perms_on(struct wrttmp *w) { struct stat st; -char devname[UT_LINESIZE+7]; +char devname[sizeof(((struct utmpx *)0)->ut_line) +6]; #ifdef TTYPERMS #define MASK 022 -@@ -59,7 +59,7 @@ +@@ -59,7 +59,7 @@ char devname[UT_LINESIZE+7]; /* Is his tty physically writable? */ - sprintf(devname,"/dev/%.*s",UT_LINESIZE,w->wrt_line); + sprintf(devname,"/dev/%.*s",((struct utmpx *)0)->ut_line -1,w->wrt_line); if (stat(devname,&st)) return(0); -@@ -72,7 +72,7 @@ +@@ -72,7 +72,7 @@ main(int argc, char **argv) FILE *fp; struct wrttmp w; struct wrthdr wt_head; -struct utmp *u; +struct utmpx *u; struct hlp *tmp; int i, j; int slot= 0; -@@ -146,7 +146,7 @@ +@@ -146,7 +146,7 @@ int listthem= 1; if (list != NULL) { /* Do the scan */ - while ((u= getutent()) != NULL) + while ((u= getutxent()) != NULL) { #ifdef USER_PROCESS if (u->ut_type != USER_PROCESS) -@@ -155,15 +155,15 @@ +@@ -155,15 +155,15 @@ int listthem= 1; if ((tmp= findlist(u->ut_line)) != NULL) { /* If the time stamps don't match, this isn't a real helper */ - if (u->ut_time == tmp->time) + if (u->ut_tv.tv_sec == tmp->time) { /* Found a real helper -- count and print */ count++; if (listthem) printf("%-*.*s %-*.*s%s\n", - UT_NAMESIZE, UT_NAMESIZE, u->ut_name, - UT_LINESIZE, UT_LINESIZE, u->ut_line, + sizeof(u->ut_user)-1, sizeof(u->ut_user)-1, u->ut_user, + sizeof(u->ut_line)-1, sizeof(u->ut_user)-1, u->ut_line, tmp->busy ? " [busy]" : ""); } -@@ -172,7 +172,7 @@ +@@ -172,7 +172,7 @@ int listthem= 1; } } - endutent(); + endutxent(); } if (!listthem) Index: head/misc/orville-write/files/patch-huh.c =================================================================== --- head/misc/orville-write/files/patch-huh.c (revision 550842) +++ head/misc/orville-write/files/patch-huh.c (revision 550843) @@ -1,35 +1,35 @@ ---- huh.c.orig 2010-02-02 23:11:01.823876514 -0800 -+++ huh.c 2010-02-02 23:11:54.475034412 -0800 -@@ -34,13 +34,13 @@ +--- huh.c.orig 2003-05-30 15:37:40 UTC ++++ huh.c +@@ -34,13 +34,13 @@ struct passwd *pwd; int record_on() { -struct utmp *ut; +struct utmpx *ut; struct wrttmp wt; char *tty; long pos; /* Open the utmp file */ - setutent(); + setutxent(); /* Open the wrttmp file */ if (init_wstream(O_RDONLY)) return 1; -@@ -50,13 +50,13 @@ +@@ -50,13 +50,13 @@ long pos; tty= mydevname+5; /* Find our entry in the utmp file */ - if ((ut= find_utmp(tty)) == NULL || ut->ut_name[0] == '\0') return 1; + if ((ut= find_utmp(tty)) == NULL || ut->ut_user[0] == '\0') return 1; /* Find the entry in the wrttmp file */ - find_wrttmp(tty, ut->ut_time, &wt, &pos); + find_wrttmp(tty, ut->ut_tv.tv_sec, &wt, &pos); /* Close utmp file */ - endutent(); + endutxent(); return (wt.wrt_record != 'n'); } Index: head/misc/orville-write/files/patch-lib__common.c =================================================================== --- head/misc/orville-write/files/patch-lib__common.c (nonexistent) +++ head/misc/orville-write/files/patch-lib__common.c (revision 550843) @@ -0,0 +1,28 @@ +--- lib_common.c.orig 2004-09-29 04:43:53 UTC ++++ lib_common.c +@@ -89,7 +89,7 @@ char *tty; + } + if ((tty= ttyname(2)) == NULL || strlen(tty) < 5) + { +- printf("%s: Not on a valid tty\n"); ++ printf("%s: Not on a valid tty\n", progname); + return 2; + } + strncpy(mydevname,tty,UT_LINESIZE+10); +@@ -141,13 +141,13 @@ int init_wstream(int mode) + * fail. The tty name need not be null terminated. + */ + +-struct utmp *find_utmp(char *tty) ++struct utmpx *find_utmp(char *tty) + { +-struct utmp tmputmp; ++struct utmpx tmputmp; + + strncpy(tmputmp.ut_line, tty, UT_LINESIZE); + setutent(); /* open and/or rewind */ +- return getutline(&tmputmp); ++ return getutxline(&tmputmp); + } + + Property changes on: head/misc/orville-write/files/patch-lib__common.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-lib__common.h =================================================================== --- head/misc/orville-write/files/patch-lib__common.h (nonexistent) +++ head/misc/orville-write/files/patch-lib__common.h (revision 550843) @@ -0,0 +1,20 @@ +--- lib_common.h.orig 2000-02-01 05:49:10 UTC ++++ lib_common.h +@@ -6,7 +6,7 @@ + #include "getutent.h" + + int init_wstream(int mode); +-struct utmp *find_utmp(char *tty); ++struct utmpx *find_utmp(char *tty); + void find_wrttmp(char *tty, time_t time,struct wrttmp *wbuf, long *pos); + void dflt_wrttmp(struct wrttmp *wbuf, char *tty, time_t time); + char *leafname(char *fullpath); +@@ -19,7 +19,7 @@ extern int f_disconnect, f_exceptions, f_helpers, f_lo + extern char *progname; + extern char mydevname[]; + extern int wstream; +-struct wrthdr wt_head; ++extern struct wrthdr wt_head; + + #ifdef TTYPERMS + int saveperms(void); Property changes on: head/misc/orville-write/files/patch-lib__common.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-mesg.c =================================================================== --- head/misc/orville-write/files/patch-mesg.c (revision 550842) +++ head/misc/orville-write/files/patch-mesg.c (revision 550843) @@ -1,159 +1,159 @@ ---- mesg.c.orig 2010-02-02 22:54:21.613120678 -0800 -+++ mesg.c 2010-02-02 23:01:31.739763589 -0800 +--- mesg.c.orig 2004-09-29 04:43:14 UTC ++++ mesg.c @@ -19,7 +19,7 @@ char *mytty; /* my tty name in tty?? format */ long mypos; /* offset of my entry in wrttmp file */ struct wrttmp mywrt; /* my wrttmp entry */ -struct utmp myutmp; /* A tmp buffer for reading utmp entries */ +struct utmpx myutmp; /* A tmp buffer for reading utmp entries */ char silent= FALSE; /* generates no output if true */ int verbose= FALSE; /* generate whole table of output if true */ -@@ -335,7 +335,7 @@ +@@ -335,7 +335,7 @@ char flag; } /* Close the utmp file */ - endutent(); + endutxent(); if (f_wrthist != NULL && !wassilent && (new[SMESG] == 'n' || new[SEXCP] == 'y')) -@@ -549,12 +549,12 @@ +@@ -549,12 +549,12 @@ int code; void do_disconnect() { -struct utmp *ut; /* A tmp buffer for reading utmp entries */ +struct utmpx *ut; /* A tmp buffer for reading utmp entries */ struct wrttmp hiswrt; /* Someone's wrttmp entry */ int slot= 0; /* Rewind utmp file */ - setutent(); + setutxent(); /* For each user who is writing me */ for (;;) -@@ -564,16 +564,16 @@ +@@ -564,16 +564,16 @@ int slot= 0; sizeof(struct wrttmp)) break; - if (!strncmp(hiswrt.wrt_what, myutmp.ut_name, UT_NAMESIZE)) + if (!strncmp(hiswrt.wrt_what, myutmp.ut_user, sizeof(myutmp.ut_user))) { setutent(); /* Check apparant writer against utmp file */ - while ((ut= getutent()) != NULL) + while ((ut= getutxent()) != NULL) if ( #ifdef USER_PROCESS ut->ut_type == USER_PROCESS && #endif - !strncmp(hiswrt.wrt_line, ut->ut_line, UT_LINESIZE)) + !strncmp(hiswrt.wrt_line, ut->ut_line, sizeof(ut->ut_line))) { /* Writer is for real: bonk him one */ kill(hiswrt.wrt_pid, SIGTERM); -@@ -590,10 +590,10 @@ +@@ -590,10 +590,10 @@ int slot= 0; int find_me() { -struct utmp *ut; +struct utmpx *ut; /* Find our entry in the Utmp file */ - if ((ut= find_utmp(mytty)) == NULL || ut->ut_name[0] == '\0') + if ((ut= find_utmp(mytty)) == NULL || ut->ut_user[0] == '\0') { printf("%s: Unable to find your tty (%s) in utmp file\n", progname,mytty); -@@ -602,7 +602,7 @@ +@@ -602,7 +602,7 @@ struct utmp *ut; myutmp= *ut; /* Find the entry in the wrttmp file */ - find_wrttmp(mytty,myutmp.ut_time,&mywrt,&mypos); + find_wrttmp(mytty,myutmp.ut_tv.tv_sec,&mywrt,&mypos); } -@@ -616,13 +616,13 @@ +@@ -616,13 +616,13 @@ int may_help() #define BUFSZ 80 FILE *hfp; char buf[BUFSZ+1]; -char myname[UT_NAMESIZE+2]; +char myname[sizeof(myutmp.ut_user)+1]; if (f_helperlist == NULL || (hfp= fopen(f_helperlist,"r")) == NULL) return TRUE; - strncpy(myname,myutmp.ut_name,UT_NAMESIZE); - myname[UT_NAMESIZE]= '\0'; + strncpy(myname,myutmp.ut_user,sizeof(myutmp.ut_user) -1); + myname[sizeof(myutmp.ut_user)]= '\0'; strcat(myname,"\n"); while (fgets(buf,BUFSZ,hfp) != NULL) -@@ -645,7 +645,7 @@ +@@ -645,7 +645,7 @@ int window_warning(int newmode) { struct wrthist *hist; struct wrttmp w; -struct utmp *u; +struct utmpx *u; long writer, writee; time_t now; int n, foundsome= 0; -@@ -669,7 +669,7 @@ +@@ -669,7 +669,7 @@ FILE *fp; for (writee= 0; writee < n; writee++) { - if (hist[writee].tm > myutmp.ut_time && + if (hist[writee].tm > myutmp.ut_tv.tv_sec && now - hist[writee].tm <= f_answertel) { /* Fetch "his" wrttmp entry - it may actually belong to a previous -@@ -688,12 +688,12 @@ +@@ -688,12 +688,12 @@ FILE *fp; /* Fetch his utmp entry, and confirm that the current user was * already logged in there when we sent our last telegram there. */ - if ((u= find_utmp(w.wrt_line)) == NULL || u->ut_name[0] == '\0' || - hist[writee].tm < u->ut_time) + if ((u= find_utmp(w.wrt_line)) == NULL || u->ut_user[0] == '\0' || + hist[writee].tm < u->ut_tv.tv_sec) continue; /* Check if due to exceptions he may write us anyway */ - if (f_exceptions && newmode > 1 && maywriteme(u->ut_name, newmode)) + if (f_exceptions && newmode > 1 && maywriteme(u->ut_user, newmode)) continue; if (!foundsome) -@@ -703,8 +703,8 @@ +@@ -703,8 +703,8 @@ FILE *fp; foundsome= 1; } printf(" %-*.*s %-*.*s %4.1f more minutes\n", - UT_NAMESIZE, UT_NAMESIZE, u->ut_name, - UT_LINESIZE, UT_LINESIZE, u->ut_line, + sizeof(u->ut_user) -1, sizeof(u->ut_user) -1, u->ut_user, + sizeof(u->ut_line) -1, sizeof(u->ut_line) -1, u->ut_line, (float)(f_answertel - now + hist[writee].tm)/60.0); } } -@@ -717,7 +717,7 @@ +@@ -717,7 +717,7 @@ FILE *fp; char *myhomedir() { -char myname[UT_NAMESIZE+2]; +char myname[sizeof(myutmp.ut_user)+1]; struct passwd *pw; char *dir, *getenv(); -@@ -726,8 +726,8 @@ +@@ -726,8 +726,8 @@ char *dir, *getenv(); return dir; /* If that don't work, try passwd file */ - strncpy(myname,myutmp.ut_name,UT_NAMESIZE); - myname[UT_NAMESIZE]= '\0'; + strncpy(myname,myutmp.ut_user,sizeof(myutmp.ut_user) -1); + myname[sizeof(myutmp.ut_user)]= '\0'; if ((pw= getpwnam(myname)) != NULL) return pw->pw_dir; Index: head/misc/orville-write/files/patch-wrt__him.c =================================================================== --- head/misc/orville-write/files/patch-wrt__him.c (nonexistent) +++ head/misc/orville-write/files/patch-wrt__him.c (revision 550843) @@ -0,0 +1,150 @@ +--- wrt_him.c.orig 2004-09-29 03:32:13 UTC ++++ wrt_him.c +@@ -116,7 +116,7 @@ int rc; + extern struct wrttmp mywrt; + + /* Open utmp file */ +- setutent(); ++ setutxent(); + + /* Look me up */ + find_me(); +@@ -204,7 +204,7 @@ int write_me; + int perm, hisperm= 0; + time_t hisatime= 0; + time_t atime; +-struct utmp *ut; ++struct utmpx *ut; + struct wrttmp tmpwrt; + long tmppos; + +@@ -213,16 +213,14 @@ long tmppos; + { + /* Check if this is the target user, ignoring X-window lines */ + if (ut->ut_line[0] != ':' && +-#ifdef USER_PROCESS + ut->ut_type == USER_PROCESS && +-#endif +- !strncmp(hisname, ut->ut_name, UT_NAMESIZE)) ++ !strncmp(hisname, ut->ut_user, UT_NAMESIZE)) + { + /* Count matches */ + cnt++; + + /* Find wrttmp entry */ +- find_wrttmp(ut->ut_line, ut->ut_time, &tmpwrt, &tmppos); ++ find_wrttmp(ut->ut_line, ut->ut_tv.tv_sec, &tmpwrt, &tmppos); + + /* Is this guy writing me? */ + write_me= !strncmp(tmpwrt.wrt_what,myname,UT_NAMESIZE); +@@ -283,7 +281,7 @@ long tmppos; + + int find_tty() + { +-struct utmp *ut; ++struct utmpx *ut; + + if ((ut= find_utmp(histty)) == NULL) + return(1); +@@ -291,23 +289,23 @@ struct utmp *ut; + if (*hisname != '\0') + { + /* Does the name not match? */ +- if (strncmp(hisname, ut->ut_name, UT_NAMESIZE)) ++ if (strncmp(hisname, ut->ut_user, UT_NAMESIZE)) + return(2); + } + else + { + /* Is anyone on that line? */ +- if (*ut->ut_name == '\0') ++ if (*ut->ut_user == '\0') + { + printf("No one logged onto %s\n",histty); + wrtlog("FAIL: empty tty"); + done(1); + } +- strncpy(hisname, ut->ut_name, UT_NAMESIZE); ++ strncpy(hisname, ut->ut_user, UT_NAMESIZE); + } + printf("%s to %s on %s...",what[telegram],hisname,histty); + if (!telegram) putchar('\n'); +- find_wrttmp(histty,ut->ut_time,&hiswrt,&hispos); ++ find_wrttmp(histty,ut->ut_tv.tv_sec,&hiswrt,&hispos); + return(0); + } + +@@ -321,7 +319,7 @@ struct utmp *ut; + + void find_answer() + { +-struct utmp *ut; ++struct utmpx *ut; + int slot; + + lseek(wstream,hispos= wrttmp_offset(slot= 0),0); +@@ -332,9 +330,9 @@ int slot; + { + /* Found someone writing me - get his name from utmp */ + strncpy(histty,hiswrt.wrt_line,UT_LINESIZE); +- if ((ut= find_utmp(histty)) != NULL && ut->ut_name[0] != '\0') ++ if ((ut= find_utmp(histty)) != NULL && ut->ut_user[0] != '\0') + { +- strncpy(hisname,ut->ut_name,UT_NAMESIZE); ++ strncpy(hisname,ut->ut_user,UT_NAMESIZE); + printf("Replying to %s on %s...",hisname,histty); + if (!telegram) putchar('\n'); + return; +@@ -363,7 +361,7 @@ int nhelpers= 0; /* Number of helpers on */ + int ahelpers= 0; /* Number of helpers available */ + int previous; + int slot= 0; +-struct utmp *ut; ++struct utmpx *ut; + struct wrttmp tmpwrt; + long tmppos; + +@@ -387,7 +385,7 @@ long tmppos; + + /* Find the helper candidate in utmp - if he's not there skip out */ + if ((ut= find_utmp(tmpwrt.wrt_line)) == NULL || +- ut->ut_name[0] == '\0' || ut->ut_time != tmpwrt.wrt_time) ++ ut->ut_user[0] == '\0' || ut->ut_tv.tv_sec != tmpwrt.wrt_time) + continue; + + /* Reject helpers with their message permissions off */ +@@ -397,14 +395,14 @@ long tmppos; + { + /* Perms off - but am I in .yeswrite file? */ + if (!f_exceptions || tmpwrt.wrt_except != 'y' || +- !isuexception(ut->ut_name, 1, myname)) ++ !isuexception(ut->ut_user, 1, myname)) + continue; + } + else + { + /* Perms on - but am I in .nowrite file? */ + if (f_exceptions && tmpwrt.wrt_except == 'y' && +- isuexception(ut->ut_name, 0, myname)) ++ isuexception(ut->ut_user, 0, myname)) + continue; + } + } +@@ -422,7 +420,7 @@ long tmppos; + ahelpers++; + + /* Has he helped us before? */ +- previous= !strncmp(ut->ut_name, mywrt.wrt_last, UT_NAMESIZE); ++ previous= !strncmp(ut->ut_user, mywrt.wrt_last, UT_NAMESIZE); + + /* So roll the dice to see if we will choose him */ + if (!previous && (unsigned)RAND() > (unsigned)RAND_MAX / ahelpers) +@@ -430,7 +428,7 @@ long tmppos; + + /* We chose him, so make him our helper candidate so far */ + strncpy(histty, tmpwrt.wrt_line, UT_LINESIZE); +- strncpy(hisname, ut->ut_name, UT_NAMESIZE); ++ strncpy(hisname, ut->ut_user, UT_NAMESIZE); + hiswrt= tmpwrt; + hispos= tmppos; + Property changes on: head/misc/orville-write/files/patch-wrt__him.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-wrt__main.c =================================================================== --- head/misc/orville-write/files/patch-wrt__main.c (nonexistent) +++ head/misc/orville-write/files/patch-wrt__main.c (revision 550843) @@ -0,0 +1,11 @@ +--- wrt_main.c.orig 2004-09-29 04:43:17 UTC ++++ wrt_main.c +@@ -38,7 +38,7 @@ char myname[UT_NAMESIZE+1]= ""; /* my name (based on u + char myuidname[UT_NAMESIZE+1]; /* my name (based on uid number) */ + char *mytty; /* my tty name in "tty##" format */ + #ifdef TTYPERMS +-int myperms; /* my original tty perms */ ++extern int myperms; /* my original tty perms */ + #endif /*TTYPERMS*/ + + FILE *histerm; /* Opened version of device to write to */ Property changes on: head/misc/orville-write/files/patch-wrt__main.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-wrt__me.c =================================================================== --- head/misc/orville-write/files/patch-wrt__me.c (nonexistent) +++ head/misc/orville-write/files/patch-wrt__me.c (revision 550843) @@ -0,0 +1,34 @@ +--- wrt_me.c.orig 2003-05-30 15:22:35 UTC ++++ wrt_me.c +@@ -14,19 +14,19 @@ long mypos= -1; /* offset of my entry in the wrttmp f + + void find_me() + { +-struct utmp *ut; ++struct utmpx *ut; + struct passwd *pw; + int myuid; + + /* Search utmp for myself */ + +- if ((ut= find_utmp(mytty)) == NULL || ut->ut_name[0] == '\0') ++ if ((ut= find_utmp(mytty)) == NULL || ut->ut_user[0] == '\0') + { + printf("%s: Panic - Unable to find your tty (%s) in "_PATH_UTMP"\n", + progname, mytty); + done(1); + } +- strncpy(myname, ut->ut_name, UT_NAMESIZE); ++ strncpy(myname, ut->ut_user, UT_NAMESIZE); + + /* Check if this is our real identity */ + #ifndef SLOWPASSWD +@@ -48,7 +48,7 @@ int myuid; + + /* Find my wrt_tmp entry */ + +- find_wrttmp(mytty, ut->ut_time, &mywrt, &mypos); ++ find_wrttmp(mytty, ut->ut_tv.tv_sec, &mywrt, &mypos); + } + + Property changes on: head/misc/orville-write/files/patch-wrt__me.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/misc/orville-write/files/patch-wrttmp.h =================================================================== --- head/misc/orville-write/files/patch-wrttmp.h (revision 550842) +++ head/misc/orville-write/files/patch-wrttmp.h (revision 550843) @@ -1,37 +1,37 @@ ---- wrttmp.h.orig 2010-02-02 22:10:42.237520427 -0800 -+++ wrttmp.h 2010-02-02 22:18:11.802300308 -0800 +--- wrttmp.h.orig 2000-01-26 04:26:03 UTC ++++ wrttmp.h @@ -30,7 +30,7 @@ #define WRTTMP_H #include -#include +#include /* BSDI is only Unix I know of that threatens to change namesize from 8 to * anything else. Most don't even have a define for it. Here we default @@ -38,10 +38,10 @@ * for us. */ #ifndef UT_NAMESIZE -#define UT_NAMESIZE 8 +#define UT_NAMESIZE (sizeof(((struct utmpx *)0)->ut_user) -1) #endif #ifndef UT_LINESIZE -#define UT_LINESIZE 8 +#define UT_LINESIZE (sizeof(((struct utmpx *)0)->ut_line) -1) #endif #if defined(TTY_GROUP) || defined(TTY_OTHERS) -@@ -65,9 +65,9 @@ +@@ -65,9 +65,9 @@ struct wrthdr { }; struct wrttmp { - char wrt_line[UT_LINESIZE]; /* a tty line */ - char wrt_what[UT_NAMESIZE]; /* what this user is doing? */ - char wrt_last[UT_NAMESIZE]; /* Who did he last write to? */ + char wrt_line[sizeof(((struct utmpx *)0)->ut_line) -1]; /* a tty line */ + char wrt_what[sizeof(((struct utmpx *)0)->ut_user) -1]; /* what this user is doing? */ + char wrt_last[sizeof(((struct utmpx *)0)->ut_user) -1]; /* Who did he last write to? */ #ifndef TTYPERMS char wrt_mesg; /* user's write perms (y or n) */ #endif /*TTYPERMS*/