Index: src/usr.sbin/chown/chown.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/chown/chown.c,v retrieving revision 1.15.2.1 diff -u -r1.15.2.1 chown.c --- src/usr.sbin/chown/chown.c 2000/08/07 02:03:09 1.15.2.1 +++ src/usr.sbin/chown/chown.c 2001/04/25 20:45:23 @@ -61,16 +61,16 @@ #include #include -void a_gid __P((char *)); -void a_uid __P((char *)); -void chownerr __P((char *)); -u_long id __P((char *, char *)); +void a_gid __P((const char *)); +void a_uid __P((const char *)); +void chownerr __P((const char *)); +u_long id __P((const char *, const char *)); void usage __P((void)); uid_t uid; gid_t gid; -int Rflag, ischown, fflag, hflag, vflag; -char *gname, *myname; +int Rflag, ischown, fflag, vflag; +const char *gname, *myname; int main(argc, argv) @@ -134,7 +134,8 @@ } } - uid = gid = -1; + uid = (uid_t) -1; + gid = (gid_t) -1; if (ischown) { if ((cp = strchr(*argv, ':')) != NULL) { *cp++ = '\0'; @@ -182,8 +183,8 @@ default: break; } - if ((uid == -1 || uid == p->fts_statp->st_uid) && - (gid == -1 || gid == p->fts_statp->st_gid)) + if ((uid == (gid_t) -1 || uid == p->fts_statp->st_uid) && + (gid == (gid_t) -1 || gid == p->fts_statp->st_gid)) continue; if (hflag) { if (lchown(p->fts_accpath, uid, gid) && !fflag) { @@ -210,30 +211,30 @@ void a_gid(s) - char *s; + const char *s; { struct group *gr; if (*s == '\0') /* Argument was "uid[:.]". */ return; gname = s; - gid = ((gr = getgrnam(s)) == NULL) ? id(s, "group") : gr->gr_gid; + gid = ((gr = getgrnam(s)) == NULL) ? (gid_t) id(s, "group") : gr->gr_gid; } void a_uid(s) - char *s; + const char *s; { struct passwd *pw; if (*s == '\0') /* Argument was "[:.]gid". */ return; - uid = ((pw = getpwnam(s)) == NULL) ? id(s, "user") : pw->pw_uid; + uid = ((pw = getpwnam(s)) == NULL) ? (uid_t) id(s, "user") : pw->pw_uid; } u_long id(name, type) - char *name, *type; + const char *name, *type; { u_long val; char *ep; @@ -253,19 +254,21 @@ void chownerr(file) - char *file; + const char *file; { - static int euid = -1, ngroups = -1; + static uid_t euid = (uid_t) -1; + static int ngroups = -1; gid_t groups[NGROUPS]; /* Check for chown without being root. */ if (errno != EPERM || - (uid != -1 && euid == -1 && (euid = geteuid()) != 0)) + (uid != (uid_t) -1 && euid == (uid_t) -1 && + (euid = geteuid()) != 0)) err(1, "%s", file); /* Check group membership; kernel just returns EPERM. */ - if (gid != -1 && ngroups == -1 && - euid == -1 && (euid = geteuid()) != 0) { + if (gid != (gid_t) -1 && ngroups == -1 && + euid == (uid_t) -1 && (euid = geteuid()) != 0) { ngroups = getgroups(NGROUPS, groups); while (--ngroups >= 0 && gid != groups[ngroups]); if (ngroups < 0) Index: src/usr.sbin/cron/cron/cron.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/cron/cron/cron.c,v retrieving revision 1.9.2.1 diff -u -r1.9.2.1 cron.c --- src/usr.sbin/cron/cron/cron.c 2001/03/15 04:10:40 1.9.2.1 +++ src/usr.sbin/cron/cron/cron.c 2001/04/25 20:55:05 @@ -257,7 +257,9 @@ #ifdef USE_SIGCHLD static void -sigchld_handler(x) { +sigchld_handler(x) + int x __unused; +{ WAIT_T waiter; PID_T pid; @@ -287,7 +289,9 @@ static void -sighup_handler(x) { +sighup_handler(x) + int x __unused; +{ log_close(); } Index: src/usr.sbin/cron/cron/do_command.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/cron/cron/do_command.c,v retrieving revision 1.15.2.4 diff -u -r1.15.2.4 do_command.c --- src/usr.sbin/cron/cron/do_command.c 2000/07/13 18:52:23 1.15.2.4 +++ src/usr.sbin/cron/cron/do_command.c 2001/04/25 20:55:05 @@ -517,7 +517,7 @@ static void do_univ(u) - user *u; + user *u __unused; { #if defined(sequent) /* Dynix (Sequent) hack to put the user associated with Index: src/usr.sbin/cron/lib/entry.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/cron/lib/entry.c,v retrieving revision 1.9.2.4 diff -u -r1.9.2.4 entry.c --- src/usr.sbin/cron/lib/entry.c 2001/07/23 18:41:40 1.9.2.4 +++ src/usr.sbin/cron/lib/entry.c 2001/07/24 08:40:15 @@ -262,7 +262,7 @@ if (!pw) { char *username = cmd; /* temp buffer */ - char *s, *group; + char *s; struct group *grp; #ifdef LOGIN_CAP login_cap_t *lc; @@ -409,7 +409,7 @@ */ e->cmd = strdup(cmd); if (e->cmd == NULL) { - warn("strdup(\"%d\")", cmd); + warn("strdup(\"%s\")", cmd); ecode = e_mem; goto eof; } Index: src/usr.sbin/edquota/edquota.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/edquota/edquota.c,v retrieving revision 1.9.2.6 diff -u -r1.9.2.6 edquota.c --- src/usr.sbin/edquota/edquota.c 31 Oct 2002 22:38:43 -0000 1.9.2.6 +++ src/usr.sbin/edquota/edquota.c 1 Nov 2002 08:41:33 -0000 @@ -88,10 +88,10 @@ char *cvtstoa(time_t); int editit(char *); void freeprivs(struct quotause *); -int getentry(const char *, int); -struct quotause *getprivs(long, int, char *); +unsigned long getentry(const char *, int); +struct quotause *getprivs(unsigned long, int, char *); int hasquota(struct fstab *, int, char **); -void putprivs(long, int, struct quotause *); +void putprivs(unsigned long, int, struct quotause *); int readprivs(struct quotause *, char *); int readtimes(struct quotause *, char *); static void usage(void); @@ -102,7 +102,7 @@ main(int argc, char **argv) { struct quotause *qup, *protoprivs, *curprivs; - long id, protoid; + unsigned long id, protoid; long long lim; int i, quotatype, range, tmpfd; uid_t startuid, enduid; @@ -199,7 +199,7 @@ argv += optind; if (pflag) { if (protoprivs == NULL) { - if ((protoid = getentry(protoname, quotatype)) == -1) + if ((protoid = getentry(protoname, quotatype)) == (unsigned long)-1) exit(1); protoprivs = getprivs(protoid, quotatype, fspath); for (qup = protoprivs; qup; qup = qup->next) { @@ -211,11 +211,11 @@ if (strspn(*argv, "0123456789-") == strlen(*argv) && (cp = strchr(*argv, '-')) != NULL) { *cp++ = '\0'; - startuid = atoi(*argv); - enduid = atoi(cp); + startuid = strtoul(*argv, NULL, 10); + enduid = strtoul(cp, NULL, 10); if (enduid < startuid) errx(1, - "ending uid (%d) must be >= starting uid (%d) when using uid ranges", + "ending uid (%u) must be >= starting uid (%u) when using uid ranges", enduid, startuid); range = 1; } else { @@ -224,12 +224,13 @@ } for ( ; startuid <= enduid; startuid++) { if (range) - snprintf(buf, sizeof(buf), "%d", + snprintf(buf, sizeof(buf), "%u", startuid); else snprintf(buf, sizeof(buf), "%s", *argv); - if ((id = getentry(buf, quotatype)) < 0) + if ((id = getentry(buf, quotatype)) == + (unsigned long)-1) continue; if (eflag) { for (qup = protoprivs; qup; @@ -263,7 +264,7 @@ exit(0); } for ( ; argc > 0; argc--, argv++) { - if ((id = getentry(*argv, quotatype)) == -1) + if ((id = getentry(*argv, quotatype)) == (unsigned long) -1) continue; curprivs = getprivs(id, quotatype, fspath); if (writeprivs(curprivs, tmpfd, *argv, quotatype) == 0) @@ -297,7 +298,7 @@ * an identifier. This routine must agree with the kernel routine * getinoquota as to the interpretation of quota types. */ -int +unsigned long getentry(name, quotatype) const char *name; int quotatype; @@ -323,7 +324,7 @@ break; } sleep(1); - return (-1); + return ((unsigned long)-1); } /* @@ -331,14 +332,15 @@ */ struct quotause * getprivs(id, quotatype, fspath) - register long id; + register unsigned long id; int quotatype; char *fspath; { register struct fstab *fs; register struct quotause *qup, *quptail; struct quotause *quphead; - int qcmd, qupsize, fd; + int qcmd, fd; + size_t qupsize; char *qfpathname; static int warned = 0; @@ -356,7 +358,7 @@ qupsize = sizeof(*qup) + strlen(qfpathname); if ((qup = (struct quotause *)malloc(qupsize)) == NULL) errx(2, "out of memory"); - if (quotactl(fs->fs_file, qcmd, id, &qup->dqblk) != 0) { + if (quotactl(fs->fs_file, qcmd, (int) id, &qup->dqblk) != 0) { if (errno == EOPNOTSUPP && !warned) { warned++; warnx("warning: quotas are not compiled into this kernel"); @@ -415,7 +417,7 @@ */ void putprivs(id, quotatype, quplist) - long id; + unsigned long id; int quotatype; struct quotause *quplist; { Index: src/sbin/fsdb/fsdb.c =================================================================== RCS file: /home/ncvs/src/sbin/fsdb/fsdb.c,v retrieving revision 1.13.2.1 diff -u -r1.13.2.1 fsdb.c --- src/sbin/fsdb/fsdb.c 2000/07/01 06:23:35 1.13.2.1 +++ src/sbin/fsdb/fsdb.c 2001/04/25 19:31:51 @@ -784,7 +784,7 @@ CMDFUNCSTART(chgroup) { int rval = 1; - unsigned long gid; + gid_t gid; char *cp; struct group *grp; Index: src/share/man/man5/group.5 =================================================================== RCS file: /home/ncvs/src/share/man/man5/group.5,v retrieving revision 1.15.2.2 diff -u -r1.15.2.2 group.5 --- src/share/man/man5/group.5 2000/12/29 10:18:04 1.15.2.2 +++ src/share/man/man5/group.5 2001/04/25 20:16:06 @@ -103,7 +103,7 @@ .\" struct group { .\" char *gr_name; /* group name */ .\" char *gr_passwd; /* group password */ -.\" int gr_gid; /* group id */ +.\" gid_t gr_gid; /* group id */ .\" char **gr_mem; /* group members */ .\" }; .\" .Ed Index: src/include/grp.h =================================================================== RCS file: /home/ncvs/src/include/grp.h,v retrieving revision 1.3 diff -u -r1.3 grp.h --- src/include/grp.h 1997/05/07 19:59:59 1.3 +++ src/include/grp.h 2001/04/25 18:50:41 @@ -48,7 +48,7 @@ struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ - int gr_gid; /* group id */ + gid_t gr_gid; /* group id */ char **gr_mem; /* group members */ }; Index: src/lib/libutil/pty.c =================================================================== RCS file: /home/ncvs/src/lib/libutil/pty.c,v retrieving revision 1.10 diff -u -r1.10 pty.c --- src/lib/libutil/pty.c 1999/08/28 00:05:51 1.10 +++ src/lib/libutil/pty.c 2001/04/25 19:04:38 @@ -62,13 +62,14 @@ { char line[] = "/dev/ptyXX"; register const char *cp1, *cp2; - register int master, slave, ttygid; + register int master, slave; + gid_t ttygid; struct group *gr; if ((gr = getgrnam("tty")) != NULL) ttygid = gr->gr_gid; else - ttygid = -1; + ttygid = (gid_t) -1; for (cp1 = "pqrsPQRS"; *cp1; cp1++) { line[8] = *cp1; Index: src/libexec/mknetid/hash.c =================================================================== RCS file: /home/ncvs/src/libexec/mknetid/hash.c,v retrieving revision 1.5 diff -u -r1.5 hash.c --- src/libexec/mknetid/hash.c 1999/08/28 00:09:40 1.5 +++ src/libexec/mknetid/hash.c 2001/04/25 19:12:08 @@ -137,7 +137,7 @@ void mstore (table, key, gid, dup) struct member_entry *table[]; char *key; - int gid; + gid_t gid; int dup; { struct member_entry *cur, *new; Index: src/libexec/mknetid/hash.h =================================================================== RCS file: /home/ncvs/src/libexec/mknetid/hash.h,v retrieving revision 1.5 diff -u -r1.5 hash.h --- src/libexec/mknetid/hash.h 1999/08/28 00:09:41 1.5 +++ src/libexec/mknetid/hash.h 2001/04/25 19:12:08 @@ -49,6 +49,6 @@ #define TABLESIZE 1024 #define HASH_MASK 0x000003FF -extern void mstore __P(( struct member_entry ** , char *, int, int )); +extern void mstore __P(( struct member_entry ** , char *, gid_t, int )); extern struct grouplist *lookup __P(( struct member_entry **, char * )); Index: src/libexec/mknetid/mknetid.c =================================================================== RCS file: /home/ncvs/src/libexec/mknetid/mknetid.c,v retrieving revision 1.11 diff -u -r1.11 mknetid.c --- src/libexec/mknetid/mknetid.c 1999/08/28 00:09:41 1.11 +++ src/libexec/mknetid/mknetid.c 2001/04/25 19:12:09 @@ -199,7 +199,7 @@ if ((ptr = strchr(ptr, ':')) == NULL) warnx("bad passwd file entry: %s", readbuf); *ptr = '\0'; - i = atol(gidptr); + i = strtoul(gidptr, NULL, 10); snprintf(writebuf, sizeof(writebuf), "%s.%s@%s", OPSYS, pidptr, domain); Index: src/libexec/mknetid/parse_group.c =================================================================== RCS file: /home/ncvs/src/libexec/mknetid/parse_group.c,v retrieving revision 1.6 diff -u -r1.6 parse_group.c --- src/libexec/mknetid/parse_group.c 1999/08/28 00:09:42 1.6 +++ src/libexec/mknetid/parse_group.c 2001/04/25 19:12:11 @@ -106,7 +106,8 @@ static int grscan(search, gid, name) - register int search, gid; + register int search; + gid_t gid; register char *name; { register char *cp, **m; @@ -137,7 +138,7 @@ break;; if (!(cp = strsep(&bp, ":\n"))) continue; - _gr_group.gr_gid = atoi(cp); + _gr_group.gr_gid = strtoul(cp, NULL, 10); if (search && name == NULL && _gr_group.gr_gid != gid) continue; cp = NULL; Index: src/sbin/mount_hpfs/mount_hpfs.c =================================================================== RCS file: /home/ncvs/src/sbin/mount_hpfs/mount_hpfs.c,v retrieving revision 1.1 diff -u -r1.1 mount_hpfs.c --- src/sbin/mount_hpfs/mount_hpfs.c 1999/12/09 19:09:15 1.1 +++ src/sbin/mount_hpfs/mount_hpfs.c 2001/04/25 19:49:00 @@ -195,7 +195,7 @@ else { for (gname = s; *s && isdigit(*s); ++s); if (!*s) - gid = atoi(gname); + gid = strtoul(gname, NULL, 10); else errx(EX_NOUSER, "unknown group id: %s", gname); } @@ -215,7 +215,7 @@ else { for (uname = s; *s && isdigit(*s); ++s); if (!*s) - uid = atoi(uname); + uid = strtoul(uname, NULL, 10); else errx(EX_NOUSER, "unknown user id: %s", uname); } @@ -226,15 +226,16 @@ a_mask(s) char *s; { - int done, rv=0; + int done; + mode_t rv=0; char *ep; done = 0; if (*s >= '0' && *s <= '7') { done = 1; - rv = strtol(optarg, &ep, 8); + rv = strtoul(optarg, &ep, 8); } - if (!done || rv < 0 || *ep) + if (!done || *ep) errx(EX_USAGE, "invalid file mode: %s", s); return (rv); } Index: src/sbin/mount_msdos/mount_msdos.c =================================================================== RCS file: /home/ncvs/src/sbin/mount_msdos/mount_msdos.c,v retrieving revision 1.19.2.1 diff -u -r1.19.2.1 mount_msdos.c --- src/sbin/mount_msdos/mount_msdos.c 2000/07/20 10:35:13 1.19.2.1 +++ src/sbin/mount_msdos/mount_msdos.c 2001/04/25 19:49:00 @@ -202,7 +202,7 @@ else { for (gname = s; *s && isdigit(*s); ++s); if (!*s) - gid = atoi(gname); + gid = strtoul(gname, NULL, 10); else errx(EX_NOUSER, "unknown group id: %s", gname); } @@ -222,7 +222,7 @@ else { for (uname = s; *s && isdigit(*s); ++s); if (!*s) - uid = atoi(uname); + uid = strtoul(uname, NULL, 10); else errx(EX_NOUSER, "unknown user id: %s", uname); } @@ -233,16 +233,17 @@ a_mask(s) char *s; { - int done, rv; + int done; + mode_t rv; char *ep; done = 0; rv = -1; if (*s >= '0' && *s <= '7') { done = 1; - rv = strtol(optarg, &ep, 8); + rv = strtoul(optarg, &ep, 8); } - if (!done || rv < 0 || *ep) + if (!done || *ep) errx(EX_USAGE, "invalid file mode: %s", s); return (rv); } Index: src/sbin/mount_ntfs/mount_ntfs.c =================================================================== RCS file: /home/ncvs/src/sbin/mount_ntfs/mount_ntfs.c,v retrieving revision 1.3 diff -u -r1.3 mount_ntfs.c --- src/sbin/mount_ntfs/mount_ntfs.c 1999/10/09 11:54:10 1.3 +++ src/sbin/mount_ntfs/mount_ntfs.c 2001/04/25 19:49:01 @@ -186,7 +186,7 @@ else { for (gname = s; *s && isdigit(*s); ++s); if (!*s) - gid = atoi(gname); + gid = strtoul(gname, NULL, 0); else errx(EX_NOUSER, "unknown group id: %s", gname); } @@ -206,7 +206,7 @@ else { for (uname = s; *s && isdigit(*s); ++s); if (!*s) - uid = atoi(uname); + uid = strtoul(uname, NULL, 0); else errx(EX_NOUSER, "unknown user id: %s", uname); } @@ -217,15 +217,16 @@ a_mask(s) char *s; { - int done, rv=0; + int done; + mode_t rv=0; char *ep; done = 0; if (*s >= '0' && *s <= '7') { done = 1; - rv = strtol(optarg, &ep, 8); + rv = strtoul(optarg, &ep, 8); } - if (!done || rv < 0 || *ep) + if (!done || *ep) errx(EX_USAGE, "invalid file mode: %s", s); return (rv); } Index: src/sbin/mount_nwfs/mount_nwfs.c =================================================================== RCS file: /home/ncvs/src/sbin/mount_nwfs/mount_nwfs.c,v retrieving revision 1.4.2.1 diff -u -r1.4.2.1 mount_nwfs.c --- src/sbin/mount_nwfs/mount_nwfs.c 2000/04/17 08:34:18 1.4.2.1 +++ src/sbin/mount_nwfs/mount_nwfs.c 2001/04/25 19:49:01 @@ -111,7 +111,8 @@ mntflags = error = 0; bzero(&mdata,sizeof(mdata)); - mdata.uid = mdata.gid = -1; + mdata.uid = (uid_t) -1; + mdata.gid = (gid_t) -1; nlsopt = 0; if (ncp_li_init(&li, argc, argv)) return 1; @@ -189,7 +190,7 @@ struct passwd *pwd; pwd = isdigit(optarg[0]) ? - getpwuid(atoi(optarg)) : getpwnam(optarg); + getpwuid(strtoul(optarg, NULL, 0)) : getpwnam(optarg); if (pwd == NULL) errx(EX_NOUSER, "unknown user '%s'", optarg); mdata.uid = pwd->pw_uid; @@ -199,7 +200,7 @@ struct group *grp; grp = isdigit(optarg[0]) ? - getgrgid(atoi(optarg)) : getgrnam(optarg); + getgrgid(strtoul(optarg, NULL, 0)) : getgrnam(optarg); if (grp == NULL) errx(EX_NOUSER, "unknown group '%s'", optarg); mdata.gid = grp->gr_gid; @@ -207,13 +208,13 @@ } case 'd': errno = 0; - mdata.dir_mode = strtol(optarg, &p, 8); + mdata.dir_mode = strtoul(optarg, &p, 8); if (errno || *p != 0) errx(EX_DATAERR, "invalid value for directory mode"); break; case 'f': errno = 0; - mdata.file_mode = strtol(optarg, &p, 8); + mdata.file_mode = strtoul(optarg, &p, 8); if (errno || *p != 0) errx(EX_DATAERR, "invalid value for file mode"); break; @@ -293,10 +294,10 @@ if (ncp_geteinfo(mount_point, &einfo) == 0) errx(EX_OSERR, "can't mount on %s twice", mount_point); - if (mdata.uid == -1) { + if (mdata.uid == (uid_t) -1) { mdata.uid = st.st_uid; } - if (mdata.gid == -1) { + if (mdata.gid == (gid_t) -1) { mdata.gid = st.st_gid; } if (mdata.file_mode == 0 ) { Index: src/sbin/mountd/mountd.c =================================================================== RCS file: /home/ncvs/src/sbin/mountd/mountd.c,v retrieving revision 1.39 diff -u -r1.39 mountd.c --- src/sbin/mountd/mountd.c 1999/12/03 20:23:53 1.39 +++ src/sbin/mountd/mountd.c 2001/04/25 19:55:01 @@ -206,7 +206,8 @@ 1, (uid_t) -2, 1, - { (gid_t) -2 } + { (gid_t) -2 }, + NULL }; int force_v2 = 0; int resvport_only = 1; @@ -591,7 +592,7 @@ int xdr_mlist(xdrsp, cp) XDR *xdrsp; - caddr_t cp; + caddr_t cp __unused; { struct mountlist *mlp; int true = 1; @@ -621,7 +622,7 @@ int xdr_explist(xdrsp, cp) XDR *xdrsp; - caddr_t cp; + caddr_t cp __unused; { struct exportlist *ep; int false = 0; @@ -1453,7 +1454,7 @@ if ((hp = gethostbyname(cp)) == NULL) { if (isdigit(*cp)) { saddr = inet_addr(cp); - if (saddr == -1) { + if (saddr == INADDR_NONE) { syslog(LOG_ERR, "inet_addr failed for %s", cp); return (1); } @@ -1864,7 +1865,7 @@ names = strsep(&namelist, " \t\n"); name = strsep(&names, ":"); if (isdigit(*name) || *name == '-') - pw = getpwuid(atoi(name)); + pw = getpwuid(strtoul(name, NULL, 0)); else pw = getpwnam(name); /* @@ -1895,7 +1896,7 @@ if (pw != NULL) cr->cr_uid = pw->pw_uid; else if (isdigit(*name) || *name == '-') - cr->cr_uid = atoi(name); + cr->cr_uid = strtoul(name, NULL, 0); else { syslog(LOG_ERR, "unknown user: %s", name); return; @@ -1904,7 +1905,7 @@ while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS) { name = strsep(&names, ":"); if (isdigit(*name) || *name == '-') { - cr->cr_groups[cr->cr_ngroups++] = atoi(name); + cr->cr_groups[cr->cr_ngroups++] = strtoul(name, NULL, 0); } else { if ((gr = getgrnam(name)) == NULL) { syslog(LOG_ERR, "unknown group: %s", name); Index: src/usr.sbin/newsyslog/newsyslog.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/newsyslog/newsyslog.c,v retrieving revision 1.25.2.17 diff -u -r1.25.2.17 newsyslog.c --- src/usr.sbin/newsyslog/newsyslog.c 5 May 2003 04:09:12 -0000 1.25.2.17 +++ src/usr.sbin/newsyslog/newsyslog.c 7 May 2003 07:40:15 -0000 @@ -882,7 +882,7 @@ errline); working->gid = grp->gr_gid; } else - working->gid = atoi(q); + working->gid = strtoul(q, NULL, 10); } else working->gid = (gid_t)-1; Index: src/usr.sbin/pw/edgroup.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/edgroup.c,v retrieving revision 1.8 diff -u -r1.8 edgroup.c --- src/usr.sbin/pw/edgroup.c 28 Aug 1999 01:19:16 -0000 1.8 +++ src/usr.sbin/pw/edgroup.c 20 Oct 2001 12:54:45 -0000 @@ -132,7 +132,7 @@ grp.gr_passwd = p; break; case 2: /* Group id */ - grp.gr_gid = atoi(p); + grp.gr_gid = strtoul(p, NULL, 10); break; case 3: /* Member list */ cp = p; Index: src/usr.sbin/pw/grupd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/grupd.c,v retrieving revision 1.8 diff -u -r1.8 grupd.c --- src/usr.sbin/pw/grupd.c 26 Oct 1999 04:27:14 -0000 1.8 +++ src/usr.sbin/pw/grupd.c 20 Oct 2001 12:54:45 -0000 @@ -100,9 +100,9 @@ * Now we can safely format */ if (type == PWF_STANDARD) - l = sprintf(*buf, "%s:*:%ld:", grp->gr_name, (long) grp->gr_gid); + l = sprintf(*buf, "%s:*:%lu:", grp->gr_name, (unsigned long) grp->gr_gid); else - l = sprintf(*buf, "%s:%s:%ld:", grp->gr_name, grp->gr_passwd, (long) grp->gr_gid); + l = sprintf(*buf, "%s:%s:%lu:", grp->gr_name, grp->gr_passwd, (unsigned long) grp->gr_gid); /* * List members Index: src/usr.sbin/pw/pw_conf.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/pw_conf.c,v retrieving revision 1.10.2.2 diff -u -r1.10.2.2 pw_conf.c --- src/usr.sbin/pw/pw_conf.c 14 Jan 2001 08:41:19 -0000 1.10.2.2 +++ src/usr.sbin/pw/pw_conf.c 20 Oct 2001 12:54:45 -0000 @@ -329,19 +329,19 @@ break; case _UC_MINUID: if ((q = unquote(q)) != NULL && isdigit(*q)) - config.min_uid = (uid_t) atol(q); + config.min_uid = strtoul(q, NULL, 10); break; case _UC_MAXUID: if ((q = unquote(q)) != NULL && isdigit(*q)) - config.max_uid = (uid_t) atol(q); + config.max_uid = strtoul(q, NULL, 10); break; case _UC_MINGID: if ((q = unquote(q)) != NULL && isdigit(*q)) - config.min_gid = (gid_t) atol(q); + config.min_gid = strtoul(q, NULL, 10); break; case _UC_MAXGID: if ((q = unquote(q)) != NULL && isdigit(*q)) - config.max_gid = (gid_t) atol(q); + config.max_gid = strtoul(q, NULL, 10); break; case _UC_EXPIRE: if ((q = unquote(q)) != NULL && isdigit(*q)) Index: src/usr.sbin/pw/pw_group.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/pw_group.c,v retrieving revision 1.12.2.1 diff -u -r1.12.2.1 pw_group.c --- src/usr.sbin/pw/pw_group.c 28 Jun 2000 19:19:04 -0000 1.12.2.1 +++ src/usr.sbin/pw/pw_group.c 12 Aug 2002 08:23:46 -0000 @@ -93,18 +93,18 @@ a_name = NULL; } } - grp = (a_name != NULL) ? GETGRNAM(a_name->val) : GETGRGID((gid_t) atoi(a_gid->val)); + grp = (a_name != NULL) ? GETGRNAM(a_name->val) : GETGRGID((gid_t) strtoul(a_gid->val, NULL, 10)); if (mode == M_UPDATE || mode == M_DELETE || mode == M_PRINT) { if (a_name == NULL && grp == NULL) /* Try harder */ - grp = GETGRGID(atoi(a_gid->val)); + grp = GETGRGID(strtoul(a_gid->val, NULL, 10)); if (grp == NULL) { if (mode == M_PRINT && getarg(args, 'F')) { char *fmems[1]; fmems[0] = NULL; fakegroup.gr_name = a_name ? a_name->val : "nogroup"; - fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : -1; + fakegroup.gr_gid = a_gid ? strtoul(a_gid->val, NULL, 10) : -1; fakegroup.gr_mem = fmems; return print_group(&fakegroup, getarg(args, 'P') != NULL); } @@ -126,13 +126,13 @@ warn("group update"); return EX_IOERR; } - pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", a_name->val, (long) gid); + pw_log(cnf, mode, W_GROUP, "%s(%lu) removed", a_name->val, (unsigned long) gid); return EXIT_SUCCESS; } else if (mode == M_PRINT) return print_group(grp, getarg(args, 'P') != NULL); if (a_gid) - grp->gr_gid = (gid_t) atoi(a_gid->val); + grp->gr_gid = strtoul(a_gid->val, NULL, 10); if ((arg = getarg(args, 'l')) != NULL) grp->gr_name = pw_checkname((u_char *)arg->val, 0); @@ -256,7 +256,7 @@ if ((grp = GETGRNAM(a_name->val)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); - pw_log(cnf, mode, W_GROUP, "%s(%ld)", grp->gr_name, (long) grp->gr_gid); + pw_log(cnf, mode, W_GROUP, "%s(%lu)", grp->gr_name, (unsigned long) grp->gr_gid); if (members) free(members); @@ -276,10 +276,10 @@ * Check the given gid, if any */ if (a_gid != NULL) { - gid = (gid_t) atol(a_gid->val); + gid = strtoul(a_gid->val, NULL, 10); if ((grp = GETGRGID(gid)) != NULL && getarg(args, 'o') == NULL) - errx(EX_DATAERR, "gid `%ld' has already been allocated", (long) grp->gr_gid); + errx(EX_DATAERR, "gid `%lu' has already been allocated", (unsigned long) grp->gr_gid); } else { struct bitmap bm; @@ -299,8 +299,8 @@ */ SETGRENT(); while ((grp = GETGRENT()) != NULL) - if ((gid_t)grp->gr_gid >= (gid_t)cnf->min_gid && - (gid_t)grp->gr_gid <= (gid_t)cnf->max_gid) + if (grp->gr_gid >= cnf->min_gid && + grp->gr_gid <= cnf->max_gid) bm_setbit(&bm, grp->gr_gid - cnf->min_gid); ENDGRENT(); @@ -343,7 +343,7 @@ printf("Group Name: %-15s #%lu\n" " Members: ", - grp->gr_name, (long) grp->gr_gid); + grp->gr_name, (unsigned long) grp->gr_gid); for (i = 0; grp->gr_mem[i]; i++) printf("%s%s", i ? "," : "", grp->gr_mem[i]); fputs("\n\n", stdout); Index: src/usr.sbin/pw/pw_user.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/pw_user.c,v retrieving revision 1.34.2.12 diff -u -r1.34.2.12 pw_user.c --- src/usr.sbin/pw/pw_user.c 11 Aug 2002 14:27:31 -0000 1.34.2.12 +++ src/usr.sbin/pw/pw_user.c 12 Aug 2002 08:23:46 -0000 @@ -59,7 +59,7 @@ static int print_user(struct passwd * pwd, int pretty, int v7); static uid_t pw_uidpolicy(struct userconf * cnf, struct cargs * args); -static uid_t pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer); +static gid_t pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer); static time_t pw_pwdpolicy(struct userconf * cnf, struct cargs * args); static time_t pw_exppolicy(struct userconf * cnf, struct cargs * args); static char *pw_homepolicy(struct userconf * cnf, struct cargs * args, char const * user); @@ -224,7 +224,7 @@ cnf->default_group = ""; else { if ((grp = GETGRNAM(p)) == NULL) { - if (!isdigit((unsigned char)*p) || (grp = GETGRGID((gid_t) atoi(p))) == NULL) + if (!isdigit((unsigned char)*p) || (grp = GETGRGID(strtoul(p, NULL, 10))) == NULL) errx(EX_NOUSER, "group `%s' does not exist", p); } cnf->default_group = newstr(grp->gr_name); @@ -238,7 +238,7 @@ for (p = strtok(arg->val, ", \t"); p != NULL; p = strtok(NULL, ", \t")) { if ((grp = GETGRNAM(p)) == NULL) { - if (!isdigit((unsigned char)*p) || (grp = GETGRGID((gid_t) atoi(p))) == NULL) + if (!isdigit((unsigned char)*p) || (grp = GETGRGID(strtoul(p, NULL, 10))) == NULL) errx(EX_NOUSER, "group `%s' does not exist", p); } if (extendarray(&cnf->groups, &cnf->numgroups, i + 2) != -1) @@ -262,15 +262,15 @@ if (getarg(args, 'n') != NULL) errx(EX_DATAERR, "can't combine `-D' with `-n name'"); if ((arg = getarg(args, 'u')) != NULL && (p = strtok(arg->val, ", \t")) != NULL) { - if ((cnf->min_uid = (uid_t) atoi(p)) == 0) + if ((cnf->min_uid = strtoul(p, NULL, 10)) == 0) cnf->min_uid = 1000; - if ((p = strtok(NULL, " ,\t")) == NULL || (cnf->max_uid = (uid_t) atoi(p)) < cnf->min_uid) + if ((p = strtok(NULL, " ,\t")) == NULL || (cnf->max_uid = strtoul(p, NULL, 10)) < cnf->min_uid) cnf->max_uid = 32000; } if ((arg = getarg(args, 'i')) != NULL && (p = strtok(arg->val, ", \t")) != NULL) { - if ((cnf->min_gid = (gid_t) atoi(p)) == 0) + if ((cnf->min_gid = strtoul(p, NULL, 10)) == 0) cnf->min_gid = 1000; - if ((p = strtok(NULL, " ,\t")) == NULL || (cnf->max_gid = (gid_t) atoi(p)) < cnf->min_gid) + if ((p = strtok(NULL, " ,\t")) == NULL || (cnf->max_gid = strtoul(p, NULL, 10)) < cnf->min_gid) cnf->max_gid = 32000; } @@ -320,12 +320,12 @@ mode == M_PRINT || mode == M_LOCK || mode == M_UNLOCK) { if (a_name == NULL && pwd == NULL) /* Try harder */ - pwd = GETPWUID(atoi(a_uid->val)); + pwd = GETPWUID(strtoul(a_uid->val, NULL, 10)); if (pwd == NULL) { if (mode == M_PRINT && getarg(args, 'F')) { fakeuser.pw_name = a_name ? a_name->val : "nouser"; - fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : -1; + fakeuser.pw_uid = a_uid ? strtoul(a_uid->val, NULL, 10) : (uid_t) -1; return print_user(&fakeuser, getarg(args, 'P') != NULL, getarg(args, '7') != NULL); @@ -417,7 +417,7 @@ editgroups(a_name->val, NULL); - pw_log(cnf, mode, W_USER, "%s(%ld) account removed", a_name->val, (long) uid); + pw_log(cnf, mode, W_USER, "%s(%lu) account removed", a_name->val, (unsigned long) uid); if (!PWALTDIR()) { /* @@ -437,8 +437,8 @@ if (getarg(args, 'r') != NULL && *home == '/' && getpwuid(uid) == NULL) { if (stat(home, &st) != -1) { rm_r(home, uid); - pw_log(cnf, mode, W_USER, "%s(%ld) home '%s' %sremoved", - a_name->val, (long) uid, home, + pw_log(cnf, mode, W_USER, "%s(%lu) home '%s' %sremoved", + a_name->val, (unsigned long) uid, home, stat(home, &st) == -1 ? "" : "not completely "); } } @@ -460,7 +460,7 @@ } if ((arg = getarg(args, 'u')) != NULL && isdigit((unsigned char)*arg->val)) { - pwd->pw_uid = (uid_t) atol(arg->val); + pwd->pw_uid = strtoul(arg->val, NULL, 10); edited = 1; if (pwd->pw_uid != 0 && strcmp(pwd->pw_name, "root") == 0) errx(EX_DATAERR, "can't change uid of `root' account"); @@ -469,7 +469,7 @@ } if ((arg = getarg(args, 'g')) != NULL && pwd->pw_uid != 0) { /* Already checked this */ - gid_t newgid = (gid_t) GETGRNAM(cnf->default_group)->gr_gid; + gid_t newgid = GETGRNAM(cnf->default_group)->gr_gid; if (newgid != pwd->pw_gid) { edited = 1; pwd->pw_gid = newgid; @@ -720,9 +720,9 @@ errx(EX_NOUSER, "user '%s' disappeared during update", a_name->val); grp = GETGRGID(pwd->pw_gid); - pw_log(cnf, mode, W_USER, "%s(%ld):%s(%ld):%s:%s:%s", - pwd->pw_name, (long) pwd->pw_uid, - grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : -1), + pw_log(cnf, mode, W_USER, "%s(%lu):%s(%lu):%s:%s:%s", + pwd->pw_name, (unsigned long) pwd->pw_uid, + grp ? grp->gr_name : "unknown", (unsigned long) (grp ? grp->gr_gid : -1), pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); /* @@ -746,8 +746,8 @@ */ if (!PWALTDIR() && getarg(args, 'm') != NULL && pwd->pw_dir && *pwd->pw_dir == '/' && pwd->pw_dir[1]) { copymkdir(pwd->pw_dir, cnf->dotdir, 0755, pwd->pw_uid, pwd->pw_gid); - pw_log(cnf, mode, W_USER, "%s(%ld) home %s made", - pwd->pw_name, (long) pwd->pw_uid, pwd->pw_dir); + pw_log(cnf, mode, W_USER, "%s(%lu) home %s made", + pwd->pw_name, (unsigned long) pwd->pw_uid, pwd->pw_dir); } @@ -766,8 +766,8 @@ fputs(line, pfp); } pclose(pfp); - pw_log(cnf, mode, W_USER, "%s(%ld) new user mail sent", - pwd->pw_name, (long) pwd->pw_uid); + pw_log(cnf, mode, W_USER, "%s(%lu) new user mail sent", + pwd->pw_name, (unsigned long) pwd->pw_uid); } fclose(fp); } @@ -787,10 +787,10 @@ * Check the given uid, if any */ if (a_uid != NULL) { - uid = (uid_t) atol(a_uid->val); + uid = strtoul(a_uid->val, NULL, 10); if ((pwd = GETPWUID(uid)) != NULL && getarg(args, 'o') == NULL) - errx(EX_DATAERR, "uid `%ld' has already been allocated", (long) pwd->pw_uid); + errx(EX_DATAERR, "uid `%lu' has already been allocated", (unsigned long) pwd->pw_uid); } else { struct bitmap bm; @@ -811,7 +811,7 @@ */ SETPWENT(); while ((pwd = GETPWENT()) != NULL) - if (pwd->pw_uid >= (uid_t) cnf->min_uid && pwd->pw_uid <= (uid_t) cnf->max_uid) + if (pwd->pw_uid >= cnf->min_uid && pwd->pw_uid <= cnf->max_uid) bm_setbit(&bm, pwd->pw_uid - cnf->min_uid); ENDPWENT(); @@ -832,11 +832,11 @@ } -static uid_t +static gid_t pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer) { struct group *grp; - gid_t gid = (uid_t) - 1; + gid_t gid = (gid_t) - 1; struct carg *a_gid = getarg(args, 'g'); /* @@ -851,7 +851,7 @@ SETGRENT(); if (a_gid != NULL) { if ((grp = GETGRNAM(a_gid->val)) == NULL) { - gid = (gid_t) atol(a_gid->val); + gid = strtoul(a_gid->val, NULL, 10); if ((gid == 0 && !isdigit((unsigned char)*a_gid->val)) || (grp = GETGRGID(gid)) == NULL) errx(EX_NOUSER, "group `%s' is not defined", a_gid->val); } @@ -1159,14 +1159,14 @@ strftime(acexpire, sizeof acexpire, "%c", tptr); if (pwd->pw_change > (time_t)0 && (tptr = localtime(&pwd->pw_change)) != NULL) strftime(pwexpire, sizeof pwexpire, "%c", tptr); - printf("Login Name: %-15s #%-12ld Group: %-15s #%ld\n" + printf("Login Name: %-15s #%-12lu Group: %-15s #%ld\n" " Full Name: %s\n" " Home: %-26.26s Class: %s\n" " Shell: %-26.26s Office: %s\n" "Work Phone: %-26.26s Home Phone: %s\n" "Acc Expire: %-26.26s Pwd Expire: %s\n", - pwd->pw_name, (long) pwd->pw_uid, - grp ? grp->gr_name : "(invalid)", (long) pwd->pw_gid, + pwd->pw_name, (unsigned long) pwd->pw_uid, + grp ? grp->gr_name : "(invalid)", (unsigned long) pwd->pw_gid, uname, pwd->pw_dir, pwd->pw_class, pwd->pw_shell, office, wphone, hphone, acexpire, pwexpire); Index: src/usr.sbin/pw/pw_vpw.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/pw_vpw.c,v retrieving revision 1.3 diff -u -r1.3 pw_vpw.c --- src/usr.sbin/pw/pw_vpw.c 15 Jan 2000 00:20:21 -0000 1.3 +++ src/usr.sbin/pw/pw_vpw.c 20 Oct 2001 12:54:45 -0000 @@ -103,7 +103,7 @@ pwd.pw_passwd = p; break; case 2: /* uid */ - pwd.pw_uid = atoi(p); + pwd.pw_uid = strtoul(p, NULL, 10); if (uid != (uid_t)-1) { if (uid == pwd.pw_uid) done = 1; @@ -112,7 +112,7 @@ } break; case 3: /* gid */ - pwd.pw_gid = atoi(p); + pwd.pw_gid = strtoul(p, NULL, 10); break; case 4: /* class */ if (nam == NULL && uid == (uid_t)-1) @@ -255,9 +255,9 @@ grp.gr_passwd = p; break; case 2: /* gid */ - grp.gr_gid = atoi(p); + grp.gr_gid = strtoul(p, NULL, 10); if (gid != (gid_t)-1) { - if (gid == (gid_t)grp.gr_gid) + if (gid == grp.gr_gid) done = 1; else quickout = 1; Index: src/usr.sbin/pw/pwupd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/pwupd.c,v retrieving revision 1.12.2.4 diff -u -r1.12.2.4 pwupd.c --- src/usr.sbin/pw/pwupd.c 21 Dec 2001 15:21:32 -0000 1.12.2.4 +++ src/usr.sbin/pw/pwupd.c 25 Dec 2001 12:13:57 -0000 @@ -114,13 +114,13 @@ pw = (pwd->pw_passwd == NULL || !*pwd->pw_passwd) ? "" : (type == PWF_MASTER) ? pwd->pw_passwd : "*"; if (type == PWF_PASSWD) - l = sprintf(buf, "%s:*:%ld:%ld:%s:%s:%s\n", - pwd->pw_name, (long) pwd->pw_uid, (long) pwd->pw_gid, + l = sprintf(buf, "%s:*:%lu:%lu:%s:%s:%s\n", + pwd->pw_name, (unsigned long) pwd->pw_uid, (unsigned long) pwd->pw_gid, pwd->pw_gecos ? pwd->pw_gecos : "User &", pwd->pw_dir, pwd->pw_shell); else - l = sprintf(buf, "%s:%s:%ld:%ld:%s:%lu:%lu:%s:%s:%s\n", - pwd->pw_name, pw, (long) pwd->pw_uid, (long) pwd->pw_gid, + l = sprintf(buf, "%s:%s:%lu:%lu:%s:%lu:%lu:%s:%s:%s\n", + pwd->pw_name, pw, (unsigned long) pwd->pw_uid, (unsigned long) pwd->pw_gid, pwd->pw_class ? pwd->pw_class : "", (unsigned long) pwd->pw_change, (unsigned long) pwd->pw_expire, Index: src/usr.bin/quota/quota.c =================================================================== RCS file: /home/ncvs/src/usr.bin/quota/quota.c,v retrieving revision 1.11.2.6 diff -u -r1.11.2.6 quota.c --- src/usr.bin/quota/quota.c 10 Aug 2003 16:53:21 -0000 1.11.2.6 +++ src/usr.bin/quota/quota.c 25 Aug 2003 08:01:17 -0000 @@ -88,8 +88,8 @@ static const char *timeprt(time_t seconds); static struct quotause *getprivs(long id, int quotatype); static void usage(void); -static void showuid(u_long uid); -static void showgid(u_long gid); +static void showuid(uid_t uid); +static void showgid(gid_t gid); static void showusrname(char *name); static void showgrpname(char *name); static void showquotas(int type, u_long id, const char *name); @@ -160,7 +160,7 @@ if (uflag) { for (; argc > 0; argc--, argv++) { if (alldigits(*argv)) - showuid(atoi(*argv)); + showuid(strtoul(*argv, NULL, 10)); else showusrname(*argv); } @@ -169,7 +169,7 @@ if (gflag) { for (; argc > 0; argc--, argv++) { if (alldigits(*argv)) - showgid(atoi(*argv)); + showgid(strtoul(*argv, NULL, 10)); else showgrpname(*argv); } @@ -192,10 +192,10 @@ * Print out quotas for a specified user identifier. */ static void -showuid(u_long uid) +showuid(uid_t uid) { struct passwd *pwd = getpwuid(uid); - u_long myuid; + uid_t myuid; const char *name; if (pwd == NULL) @@ -217,7 +217,7 @@ showusrname(char *name) { struct passwd *pwd = getpwnam(name); - u_long myuid; + uid_t myuid; if (pwd == NULL) { warnx("%s: unknown user", name); @@ -235,7 +235,7 @@ * Print out quotas for a specified group identifier. */ static void -showgid(u_long gid) +showgid(gid_t gid) { struct group *grp = getgrgid(gid); int ngroups; Index: src/sbin/quotacheck/quotacheck.c =================================================================== RCS file: /home/ncvs/src/sbin/quotacheck/quotacheck.c,v retrieving revision 1.11 diff -u -r1.11 quotacheck.c --- src/sbin/quotacheck/quotacheck.c 1999/08/28 00:14:01 1.11 +++ src/sbin/quotacheck/quotacheck.c 2001/04/25 20:08:55 @@ -117,7 +117,7 @@ void freeinodebuf __P((void)); struct dinode * getnextinode __P((ino_t)); -int getquotagid __P((void)); +gid_t getquotagid __P((void)); int hasquota __P((struct fstab *, int, char **)); struct fileusage * lookup __P((u_long, int)); @@ -183,7 +183,8 @@ endpwent(); } if (aflag) - exit(checkfstab(1, maxrun, needchk, chkquota)); + exit(checkfstab(1, maxrun, (int (*)(struct fstab *)) needchk, + (int (*)(char *, char *, long, int)) chkquota)); if (setfsent() == 0) errx(1, "%s: can't open", FSTAB); while ((fs = getfsent()) != NULL) { @@ -424,7 +425,7 @@ /* * Determine the group identifier for quota files. */ -int +gid_t getquotagid() { struct group *gr; @@ -548,7 +549,7 @@ daddr_t dblk; static struct dinode *dp; - if (inumber != nextino++ || inumber > maxino) + if (inumber != nextino++ || inumber > (ino_t) maxino) errx(1, "bad inode number %d to nextinode", inumber); if (inumber >= lastinum) { readcnt++; Index: src/usr.bin/rdist/defs.h =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/defs.h,v retrieving revision 1.6 diff -u -r1.6 defs.h --- src/usr.bin/rdist/defs.h 1998/04/20 06:20:19 1.6 +++ src/usr.bin/rdist/defs.h 2001/04/25 20:37:05 @@ -170,7 +170,7 @@ int except __P((char *)); struct namelist * expand __P((struct namelist *, int)); -char *exptilde __P((char [], char *, int)); +char *exptilde __P((char [], char *, size_t)); void fatal __P((const char *, ...)); int inlist __P((struct namelist *, char *)); void insert __P((char *, Index: src/usr.bin/rdist/docmd.c =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/docmd.c,v retrieving revision 1.12 diff -u -r1.12 docmd.c --- src/usr.bin/rdist/docmd.c 1999/08/28 01:05:06 1.12 +++ src/usr.bin/rdist/docmd.c 2001/04/25 20:37:05 @@ -263,7 +263,7 @@ int n; extern char user[]; #if defined(DIRECT_RCMD) - extern int userid; + extern uid_t userid; #endif if (debug) @@ -362,7 +362,7 @@ void lostconn(signo) - int signo; + int signo __unused; { if (iamremote) cleanup(0); Index: src/usr.bin/rdist/expand.c =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/expand.c,v retrieving revision 1.8 diff -u -r1.8 expand.c --- src/usr.bin/rdist/expand.c 1999/08/28 01:05:06 1.8 +++ src/usr.bin/rdist/expand.c 2001/04/25 20:37:06 @@ -626,7 +626,7 @@ exptilde(buf, file, maxlen) char buf[]; register char *file; - int maxlen; + size_t maxlen; { register char *s1, *s2, *s3; extern char homedir[]; Index: src/usr.bin/rdist/main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/main.c,v retrieving revision 1.5 diff -u -r1.5 main.c --- src/usr.bin/rdist/main.c 1999/08/28 01:05:07 1.5 +++ src/usr.bin/rdist/main.c 2001/04/25 20:37:06 @@ -67,8 +67,8 @@ int nerrs; /* number of errors while sending/receiving */ char user[10]; /* user's name */ char homedir[128]; /* user's home directory */ -int userid; /* user's user ID */ -int groupid; /* user's group ID */ +uid_t userid; /* user's user ID */ +gid_t groupid; /* user's group ID */ char *path_rsh = _PATH_RSH; /* rsh (or equiv command) path */ struct passwd *pw; /* pointer to static area used by getpwent */ Index: src/usr.bin/rdist/rshrcmd.c =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/rshrcmd.c,v retrieving revision 1.6 diff -u -r1.6 rshrcmd.c --- src/usr.bin/rdist/rshrcmd.c 1999/08/28 01:05:08 1.6 +++ src/usr.bin/rdist/rshrcmd.c 2001/04/25 20:37:06 @@ -39,7 +39,7 @@ int rshrcmd(ahost, port, luser, ruser, cmd, fd2p) char **ahost; - u_short port; + u_short port __unused; char *luser, *ruser, *cmd; int *fd2p; { Index: src/usr.bin/rdist/server.c =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/server.c,v retrieving revision 1.10 diff -u -r1.10 server.c --- src/usr.bin/rdist/server.c 1999/08/28 01:05:09 1.10 +++ src/usr.bin/rdist/server.c 2001/04/25 20:37:07 @@ -389,14 +389,14 @@ log(lfp, "%s: no password entry for uid %d \n", target, stb.st_uid); pw = NULL; - (void)snprintf(user, sizeof(user), ":%lu", stb.st_uid); + (void)snprintf(user, sizeof(user), ":%u", stb.st_uid); } if (gr == NULL || gr->gr_gid != stb.st_gid) if ((gr = getgrgid(stb.st_gid)) == NULL) { - log(lfp, "%s: no name for group %d\n", + log(lfp, "%s: no name for group %u\n", target, stb.st_gid); gr = NULL; - (void)snprintf(group, sizeof(group), ":%lu", stb.st_gid); + (void)snprintf(group, sizeof(group), ":%u", stb.st_gid); } if (u == 1) { if (opts & VERIFY) { @@ -791,7 +791,7 @@ *cp++ = '\0'; if (type == S_IFDIR) { - if (catname >= sizeof(stp)) { + if ((size_t) catname >= sizeof(stp)) { error("%s:%s: too many directory levels\n", host, target); return; @@ -1077,14 +1077,15 @@ int mode; { register int i; - int uid, gid; + uid_t uid; + gid_t gid; extern char user[]; - extern int userid; + extern uid_t userid; uid = userid; if (userid == 0) { if (*owner == ':') { - uid = atoi(owner + 1); + uid = strtoul(owner + 1, NULL, 10); } else if (pw == NULL || strcmp(owner, pw->pw_name) != 0) { if ((pw = getpwnam(owner)) == NULL) { if (mode & 04000) { @@ -1098,14 +1099,14 @@ } else uid = pw->pw_uid; if (*group == ':') { - gid = atoi(group + 1); + gid = strtoul(group + 1, NULL, 10); goto ok; } } else if ((mode & 04000) && strcmp(user, owner) != 0) mode &= ~04000; - gid = -1; + gid = (gid_t) -1; if (gr == NULL || strcmp(group, gr->gr_name) != 0) { - if ((*group == ':' && (getgrgid(gid = atoi(group + 1)) == NULL)) + if ((*group == ':' && (getgrgid(gid = strtoul(group + 1, NULL, 10)) == NULL)) || ((gr = getgrnam(group)) == NULL)) { if (mode & 02000) { note("%s:%s: unknown group", host, group); @@ -1115,12 +1116,12 @@ gid = gr->gr_gid; } else gid = gr->gr_gid; - if (userid && gid >= 0) { + if (userid && gid != (gid_t) -1) { if (gr) for (i = 0; gr->gr_mem[i] != NULL; i++) if (!(strcmp(user, gr->gr_mem[i]))) goto ok; mode &= ~02000; - gid = -1; + gid = (gid_t) -1; } ok: if ((fd != -1 && fchown(fd, uid, gid) < 0) || chown(file, uid, gid) < 0) note("%s: %s chown: %s", host, file, strerror(errno)); @@ -1367,7 +1368,8 @@ int fd[2], status, pid, i; register char *cp, *s; char sbuf[BUFSIZ]; - extern int userid, groupid; + extern uid_t userid; + extern gid_t groupid; if (pipe(fd) < 0) { error("%s\n", strerror(errno)); @@ -1591,7 +1593,7 @@ */ void cleanup(signo) - int signo; + int signo __unused; { (void) unlink(tempfile); exit(1); Index: src/release/sysinstall/anonFTP.c =================================================================== RCS file: /home/ncvs/src/release/sysinstall/Attic/anonFTP.c,v retrieving revision 1.29 diff -u -r1.29 anonFTP.c --- src/release/sysinstall/anonFTP.c 2000/01/25 19:16:31 1.29 +++ src/release/sysinstall/anonFTP.c 2001/04/25 19:24:42 @@ -125,17 +125,17 @@ struct group *tgrp; char pwline[256]; char *tptr; - int gid; + gid_t gid; FILE *fptr; - if ((gid = atoi(tconf.group)) <= 0) { + if ((gid = strtoul(tconf.group, NULL, 10)) == 0) { if (!(tgrp = getgrnam(tconf.group))) { /* group does not exist, create it by name */ tptr = msgGetInput("14", "What group ID to use for group %s ?", tconf.group); if (tptr && *tptr && ((gid = atoi(tptr)) > 0)) { if ((fptr = fopen(_PATH_GROUP,"a"))) { - fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); + fprintf(fptr,"%s:*:%u:%s\n",tconf.group,gid,FTP_NAME); fclose(fptr); } } @@ -148,14 +148,14 @@ else if (!getgrgid(gid)) { /* group does not exist, create it by number */ - tptr = msgGetInput("14", "What group name to use for gid %d ?", gid); + tptr = msgGetInput("14", "What group name to use for gid %u ?", gid); if (tptr && *tptr) { SAFE_STRCPY(tconf.group, tptr); if ((tgrp = getgrnam(tconf.group))) { gid = tgrp->gr_gid; } else if ((fptr = fopen(_PATH_GROUP,"a"))) { - fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); + fprintf(fptr,"%s:*:%u:%s\n",tconf.group,gid,FTP_NAME); fclose(fptr); } } @@ -168,7 +168,7 @@ return DITEM_SUCCESS; /* succeeds if already exists */ } - sprintf(pwline, "%s:*:%s:%d::0:0:%s:%s:/nonexistent\n", FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir); + sprintf(pwline, "%s:*:%s:%u::0:0:%s:%s:/nonexistent\n", FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir); fptr = fopen(_PATH_MASTERPASSWD,"a"); if (! fptr) {