=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/calendar/calendar.c,v retrieving revision 1.6 retrieving revision 1.9 diff -u -r1.6 -r1.9 --- src/usr.bin/calendar/calendar.c 1997/01/15 23:42:16 1.6 +++ src/usr.bin/calendar/calendar.c 1997/09/08 23:49:57 1.9 @@ -1,4 +1,4 @@ -/* $OpenBSD: calendar.c,v 1.6 1997/01/15 23:42:16 millert Exp $ */ +/* $OpenBSD: calendar.c,v 1.9 1997/09/08 23:49:57 millert Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -43,7 +43,7 @@ #if 0 static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; #else -static char rcsid[] = "$OpenBSD: calendar.c,v 1.6 1997/01/15 23:42:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: calendar.c,v 1.9 1997/09/08 23:49:57 millert Exp $"; #endif #endif /* not lint */ @@ -77,7 +77,7 @@ (void) setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "?-af:t:A:B:")) != -1) + while ((ch = getopt(argc, argv, "-af:t:A:B:")) != -1) switch (ch) { case '-': /* backward contemptible */ case 'a': @@ -86,7 +86,6 @@ doall = 1; break; - case 'f': /* other calendar file */ calendarFile = optarg; break; @@ -103,7 +102,6 @@ f_dayBefore = atoi(optarg); break; - case '?': default: usage(); } @@ -123,6 +121,7 @@ while ((pw = getpwent()) != NULL) { (void)setegid(pw->pw_gid); (void)initgroups(pw->pw_name, pw->pw_gid); + (void)setlogin(pw->pw_name); (void)seteuid(pw->pw_uid); if (!chdir(pw->pw_dir)) cal(); @@ -142,6 +141,6 @@ usage() { (void)fprintf(stderr, - "usage: calendar [-a] [-A days] [-B days] [-f calendarfile]\n"); + "usage: calendar [-a] [-A days] [-B days] [-f calendarfile] [-t [[[yy]yy][mm]]dd]\n"); exit(1); }