diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-08-03 17:09:48 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-08-03 17:09:48 +0000 |
commit | 410d461a9813382d030fa683b063d5aea72b7dc4 (patch) | |
tree | 52b7f3e30e2da08f503146e7074702e8c6aaa6b3 /usr.bin | |
parent | 04452cd98cd2faf6a4dfd908687ee7c1b6ae5e63 (diff) |
use __progname
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/chpass/chpass.c | 13 | ||||
-rw-r--r-- | usr.bin/chpass/pw_yp.c | 21 |
2 files changed, 19 insertions, 15 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index c1ac2e1067e..b5ed2d382e1 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chpass.c,v 1.12 1998/08/02 03:35:07 millert Exp $ */ +/* $OpenBSD: chpass.c,v 1.13 1998/08/03 17:09:46 millert Exp $ */ /* $NetBSD: chpass.c,v 1.8 1996/05/15 21:50:43 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)chpass.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: chpass.c,v 1.12 1998/08/02 03:35:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: chpass.c,v 1.13 1998/08/03 17:09:46 millert Exp $"; #endif #endif /* not lint */ @@ -67,10 +67,11 @@ static char rcsid[] = "$OpenBSD: chpass.c,v 1.12 1998/08/02 03:35:07 millert Exp #include "chpass.h" #include "pathnames.h" -char *progname = "chpass"; char *tempname; uid_t uid; +extern char *__progname; + #ifdef YP int use_yp; int force_yp = 0; @@ -236,9 +237,11 @@ usage() { #ifdef YP - (void)fprintf(stderr, "usage: chpass [-a list] [-s shell] [-l]%s [user]\n", use_yp?" [-y]":""); + (void)fprintf(stderr, "usage: %s [-a list] [-s shell] [-l]%s [user]\n", + __progname, use_yp?" [-y]":""); #else - (void)fprintf(stderr, "usage: chpass [-a list] [-s shell] [user]\n"); + (void)fprintf(stderr, "usage: %s [-a list] [-s shell] [user]\n", + __progname); #endif exit(1); } diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c index 24f01b29d1e..e1dd1742b41 100644 --- a/usr.bin/chpass/pw_yp.c +++ b/usr.bin/chpass/pw_yp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pw_yp.c,v 1.8 1998/03/30 06:59:32 deraadt Exp $ */ +/* $OpenBSD: pw_yp.c,v 1.9 1998/08/03 17:09:47 millert Exp $ */ /* $NetBSD: pw_yp.c,v 1.5 1995/03/26 04:55:33 glass Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)pw_yp.c 1.0 2/2/93"; #else -static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.8 1998/03/30 06:59:32 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.9 1998/08/03 17:09:47 millert Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.8 1998/03/30 06:59:32 deraadt Exp $ #include <rpcsvc/yppasswd.h> #undef passwd -extern char *progname; +extern char *__progname; static char *domain; @@ -81,7 +81,7 @@ pw_yp(pw, uid) */ if (!domain && (r = yp_get_default_domain(&domain))) { fprintf(stderr, "%s: can't get local YP domain. Reason: %s\n", - progname, yperr_string(r)); + __progname, yperr_string(r)); return(0); } @@ -92,7 +92,7 @@ pw_yp(pw, uid) if ((r = yp_master(domain, "passwd.byname", &master)) != 0) { fprintf(stderr, "%s: can't find the master YP server. Reason: %s\n", - progname, yperr_string(r)); + __progname, yperr_string(r)); return(0); } @@ -103,7 +103,7 @@ pw_yp(pw, uid) IPPROTO_UDP)) == 0) { fprintf(stderr, "%s: master YP server not running yppasswd daemon.\n", - progname); + __progname); fprintf(stderr, "\tCan't change password.\n"); return(0); } @@ -114,7 +114,7 @@ pw_yp(pw, uid) if (rpcport >= IPPORT_RESERVED) { (void)fprintf(stderr, "%s: yppasswd daemon running on an invalid port.\n", - progname); + __progname); return(0); } @@ -160,7 +160,8 @@ pw_yp(pw, uid) r = clnt_call(client, YPPASSWDPROC_UPDATE, xdr_yppasswd, &yppasswd, xdr_int, &status, tv); if (r) { - fprintf(stderr, "%s: rpc to yppasswdd failed. %d\n", progname, r); + fprintf(stderr, "%s: rpc to yppasswdd failed. %d\n", + __progname, r); clnt_destroy(client); return(1); } else if (status) { @@ -240,7 +241,7 @@ ypgetpwnam(nam) */ if (!domain && (reason = yp_get_default_domain(&domain))) { fprintf(stderr, "%s: can't get local YP domain. Reason: %s\n", - progname, yperr_string(reason)); + __progname, yperr_string(reason)); exit(1); } @@ -274,7 +275,7 @@ ypgetpwuid(uid) if (!domain && (reason = yp_get_default_domain(&domain))) { fprintf(stderr, "%s: can't get local YP domain. Reason: %s\n", - progname, yperr_string(reason)); + __progname, yperr_string(reason)); exit(1); } |