summaryrefslogtreecommitdiffstats
path: root/libexec/comsat
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1996-06-04 15:42:09 +0000
committerpst <pst@FreeBSD.org>1996-06-04 15:42:09 +0000
commit74a5089a8d17b901f3a2fbcd6f7a5521797dfea4 (patch)
treeb7e384fbef5a451f088968c5d0dc19d3209cb79e /libexec/comsat
parentf41bdecc32ca54c9a849e93b23bf00d89c8e048c (diff)
downloadFreeBSD-src-74a5089a8d17b901f3a2fbcd6f7a5521797dfea4.zip
FreeBSD-src-74a5089a8d17b901f3a2fbcd6f7a5521797dfea4.tar.gz
Pass in both username and file to jkfprintf
Diffstat (limited to 'libexec/comsat')
-rw-r--r--libexec/comsat/comsat.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c
index f48c57c..7fe1b60 100644
--- a/libexec/comsat/comsat.c
+++ b/libexec/comsat/comsat.c
@@ -73,7 +73,7 @@ struct utmp *utmp = NULL;
time_t lastmsgtime;
int nutmp, uf;
-void jkfprintf __P((FILE *, char[], off_t));
+void jkfprintf __P((FILE *, char[], char[], off_t));
void mailfor __P((char *));
void notify __P((struct utmp *, char[], off_t, int));
void onalrm __P((int));
@@ -238,15 +238,16 @@ notify(utp, file, offset, folder)
cr, name, (int)sizeof(hostname), hostname,
folder ? cr : "", folder ? "to " : "", folder ? file : "",
cr, cr);
- jkfprintf(tp, file, offset);
+ jkfprintf(tp, name, file, offset);
(void)fclose(tp);
_exit(0);
}
void
-jkfprintf(tp, name, offset)
+jkfprintf(tp, user, file, offset)
register FILE *tp;
- char name[];
+ char user[];
+ char file[];
off_t offset;
{
register char *cp, ch;
@@ -256,10 +257,10 @@ jkfprintf(tp, name, offset)
char line[BUFSIZ];
/* Set effective uid to user in case mail drop is on nfs */
- if ((p = getpwnam(name)) != NULL)
+ if ((p = getpwnam(user)) != NULL)
(void) setuid(p->pw_uid);
- if ((fi = fopen(name, "r")) == NULL)
+ if ((fi = fopen(file, "r")) == NULL)
return;
(void)fseek(fi, offset, L_SET);
OpenPOWER on IntegriCloud