diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-11 12:54:26 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-11 12:54:26 +0000 |
commit | 1c5940ab5503bf389f03195f3d01a93353919abb (patch) | |
tree | a1e9691c11b7f36906f0943dc7d8464a56b98adc /usr.bin/mail/v7.local.c | |
parent | 5f733ec731243d90e1e65f27ce29e683e7a253a6 (diff) |
from christos;
- Fix PR/105: Implement dot locking protocol and check return value of flock.
- Fix PR/2247: Don't call unknown users "ubluit". Issue an error message.
- Fix/add prototypes.
- Fix warnings.
- Use POSIX signal mask calls.
Diffstat (limited to 'usr.bin/mail/v7.local.c')
-rw-r--r-- | usr.bin/mail/v7.local.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.bin/mail/v7.local.c b/usr.bin/mail/v7.local.c index 9d56548d106..dba1f57b9fa 100644 --- a/usr.bin/mail/v7.local.c +++ b/usr.bin/mail/v7.local.c @@ -1,3 +1,6 @@ +/* $OpenBSD: v7.local.c,v 1.2 1996/06/11 12:53:53 deraadt Exp $ */ +/* $NetBSD: v7.local.c,v 1.7 1996/06/08 19:48:44 christos Exp $ */ + /* * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. @@ -32,8 +35,11 @@ */ #ifndef lint -static char sccsid[] = "from: @(#)v7.local.c 8.1 (Berkeley) 6/6/93"; -static char rcsid[] = "$Id: v7.local.c,v 1.1 1995/10/18 08:45:39 deraadt Exp $"; +#if 0 +static char sccsid[] = "@(#)v7.local.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$OpenBSD: v7.local.c,v 1.2 1996/06/11 12:53:53 deraadt Exp $"; +#endif #endif /* not lint */ /* @@ -83,8 +89,12 @@ char * username() { char *np; + uid_t uid; if ((np = getenv("USER")) != NOSTR) return np; - return getname(getuid()); + if ((np = getname(uid = getuid())) != NOSTR) + return np; + printf("Cannot associate a name with uid %d\n", uid); + return NOSTR; } |