summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-08-06 20:41:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-08-06 20:41:09 +0000
commitabdab9264887b198168dac150a9bbff44a774868 (patch)
tree26c311697fe239df4698e550f705fd8ef5a9a932 /usr.bin
parentcde63a0b937f284da8b2903ae196fc5bfb998ea8 (diff)
uid_t and gid_t, and use %u
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/chpass/edit.c10
-rw-r--r--usr.bin/chpass/pw_yp.c10
-rw-r--r--usr.bin/error/filter.c16
-rw-r--r--usr.bin/quota/quota.c20
4 files changed, 28 insertions, 28 deletions
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c
index d070e2a6151..d4ab02416f7 100644
--- a/usr.bin/chpass/edit.c
+++ b/usr.bin/chpass/edit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: edit.c,v 1.15 1998/05/28 19:13:26 deraadt Exp $ */
+/* $OpenBSD: edit.c,v 1.16 1999/08/06 20:41:06 deraadt Exp $ */
/* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: edit.c,v 1.15 1998/05/28 19:13:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: edit.c,v 1.16 1999/08/06 20:41:06 deraadt Exp $";
#endif
#endif /* not lint */
@@ -107,8 +107,8 @@ display(tempname, fd, pw)
if (!uid) {
(void)fprintf(fp, "Login: %s\n", pw->pw_name);
(void)fprintf(fp, "Encrypted password: %s\n", pw->pw_passwd);
- (void)fprintf(fp, "Uid [#]: %d\n", pw->pw_uid);
- (void)fprintf(fp, "Gid [# or name]: %d\n", pw->pw_gid);
+ (void)fprintf(fp, "Uid [#]: %u\n", pw->pw_uid);
+ (void)fprintf(fp, "Gid [# or name]: %u\n", pw->pw_gid);
(void)fprintf(fp, "Change [month day year]: %s\n",
ttoa(chngstr, sizeof(chngstr), pw->pw_change));
(void)fprintf(fp, "Expire [month day year]: %s\n",
@@ -226,7 +226,7 @@ bad: (void)fclose(fp);
list[E_LOCATE].save, list[E_BPHONE].save, list[E_HPHONE].save);
if (snprintf(buf, sizeof(buf),
- "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s",
+ "%s:%s:%u:%u:%s:%ld:%ld:%s:%s:%s",
pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid, pw->pw_class,
pw->pw_change, pw->pw_expire, pw->pw_gecos, pw->pw_dir,
pw->pw_shell) >= 1023 ||
diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c
index e1dd1742b41..136d363944c 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.9 1998/08/03 17:09:47 millert Exp $ */
+/* $OpenBSD: pw_yp.c,v 1.10 1999/08/06 20:41:06 deraadt 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.9 1998/08/03 17:09:47 millert Exp $";
+static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.10 1999/08/06 20:41:06 deraadt Exp $";
#endif
#endif /* not lint */
@@ -131,8 +131,8 @@ pw_yp(pw, uid)
if (*p == '&')
alen = alen + strlen(pw->pw_name) - 1;
if (strlen(pw->pw_name) + 1 + strlen(pw->pw_passwd) + 1 +
- strlen((sprintf(buf, "%d", pw->pw_uid), buf)) + 1 +
- strlen((sprintf(buf, "%d", pw->pw_gid), buf)) + 1 +
+ strlen((sprintf(buf, "%u", pw->pw_uid), buf)) + 1 +
+ strlen((sprintf(buf, "%u", pw->pw_gid), buf)) + 1 +
strlen(pw->pw_gecos) + alen + 1 + strlen(pw->pw_dir) + 1 +
strlen(pw->pw_shell) >= 1023) {
warnx("entries too long");
@@ -279,7 +279,7 @@ ypgetpwuid(uid)
exit(1);
}
- sprintf(namebuf, "%d", uid);
+ sprintf(namebuf, "%u", uid);
reason = yp_match(domain, "passwd.byuid", namebuf, strlen(namebuf),
&val, &vallen);
switch(reason) {
diff --git a/usr.bin/error/filter.c b/usr.bin/error/filter.c
index 0e569640878..20463178e2b 100644
--- a/usr.bin/error/filter.c
+++ b/usr.bin/error/filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: filter.c,v 1.3 1998/07/10 14:09:54 mickey Exp $ */
+/* $OpenBSD: filter.c,v 1.4 1999/08/06 20:41:07 deraadt Exp $ */
/* $NetBSD: filter.c,v 1.3 1995/09/02 06:15:28 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)filter.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: filter.c,v 1.3 1998/07/10 14:09:54 mickey Exp $";
+static char rcsid[] = "$OpenBSD: filter.c,v 1.4 1999/08/06 20:41:07 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -67,12 +67,12 @@ getignored(auxname)
char *auxname;
{
reg int i;
- FILE *fyle;
- char inbuffer[256];
- int uid;
- char filename[128];
- char *username;
- struct passwd *passwdentry;
+ FILE *fyle;
+ char inbuffer[256];
+ uid_t uid;
+ char filename[128];
+ char *username;
+ struct passwd *passwdentry;
nignored = 0;
if (auxname == 0){ /* use the default */
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 8f402c4a711..b1fab92fc2d 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quota.c,v 1.12 1998/07/13 02:11:41 millert Exp $ */
+/* $OpenBSD: quota.c,v 1.13 1999/08/06 20:41:07 deraadt Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -44,7 +44,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quota.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: quota.c,v 1.12 1998/07/13 02:11:41 millert Exp $";
+static char rcsid[] = "$OpenBSD: quota.c,v 1.13 1999/08/06 20:41:07 deraadt Exp $";
#endif /* not lint */
/*
@@ -173,10 +173,10 @@ usage()
* Print out quotas for a specified user identifier.
*/
showuid(uid)
- u_long uid;
+ uid_t uid;
{
struct passwd *pwd = getpwuid(uid);
- u_long myuid;
+ uid_t myuid;
char *name;
if (pwd == NULL)
@@ -185,7 +185,7 @@ showuid(uid)
name = pwd->pw_name;
myuid = getuid();
if (uid != myuid && myuid != 0) {
- printf("quota: %s (uid %d): permission denied\n", name, uid);
+ printf("quota: %s (uid %u): permission denied\n", name, uid);
return;
}
showquotas(USRQUOTA, uid, name);
@@ -198,7 +198,7 @@ showusrname(name)
char *name;
{
struct passwd *pwd = getpwnam(name);
- u_long myuid;
+ uid_t myuid;
if (pwd == NULL) {
fprintf(stderr, "quota: %s: unknown user\n", name);
@@ -206,7 +206,7 @@ showusrname(name)
}
myuid = getuid();
if (pwd->pw_uid != myuid && myuid != 0) {
- fprintf(stderr, "quota: %s (uid %d): permission denied\n",
+ fprintf(stderr, "quota: %s (uid %u): permission denied\n",
pwd->pw_name, pwd->pw_uid);
return;
}
@@ -217,7 +217,7 @@ showusrname(name)
* Print out quotas for a specified group identifier.
*/
showgid(gid)
- u_long gid;
+ gid_t gid;
{
struct group *grp = getgrgid(gid);
int ngroups;
@@ -241,7 +241,7 @@ showgid(gid)
break;
if (i >= ngroups && getuid() != 0) {
fprintf(stderr,
- "quota: %s (gid %d): permission denied\n",
+ "quota: %s (gid %u): permission denied\n",
name, gid);
return;
}
@@ -292,7 +292,7 @@ showquotas(type, id, name)
register struct quotause *qup;
struct quotause *quplist;
char *msgi, *msgb, *nam;
- int myuid, fd, lines = 0;
+ uid_t myuid, fd, lines = 0;
static int first;
static time_t now;