diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-20 03:43:42 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-20 03:43:42 +0000 |
commit | 628dc4b3a4b3e467cc7a16eb2df8ccd6315e88b3 (patch) | |
tree | e86bbd6b052021215448fff1da3ff00116186ec1 | |
parent | a936d9a50f3f1a19d6e206e04aa9686b84f31667 (diff) |
ansi
-rw-r--r-- | libexec/rpc.rquotad/rquotad.c | 44 | ||||
-rw-r--r-- | libexec/rpc.yppasswdd/rpc.yppasswdd.c | 27 | ||||
-rw-r--r-- | libexec/rpc.yppasswdd/yppasswdd_mkpw.c | 24 | ||||
-rw-r--r-- | libexec/rpc.yppasswdd/yppasswdd_proc.c | 9 |
4 files changed, 32 insertions, 72 deletions
diff --git a/libexec/rpc.rquotad/rquotad.c b/libexec/rpc.rquotad/rquotad.c index 4ff2caebabf..2f97f00d5dc 100644 --- a/libexec/rpc.rquotad/rquotad.c +++ b/libexec/rpc.rquotad/rquotad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rquotad.c,v 1.13 2002/06/09 17:42:16 itojun Exp $ */ +/* $OpenBSD: rquotad.c,v 1.14 2002/06/20 03:43:33 deraadt Exp $ */ /* * by Manuel Bouyer (bouyer@ensta.fr). Public domain. @@ -57,9 +57,7 @@ cleanup() } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; int sock = 0; @@ -105,9 +103,7 @@ main(argc, argv) } void -rquota_service(request, transp) - struct svc_req *request; - SVCXPRT *transp; +rquota_service(struct svc_req *request, SVCXPRT *transp) { switch (request->rq_proc) { case NULLPROC: @@ -129,9 +125,7 @@ rquota_service(request, transp) /* read quota for the specified id, and send it */ void -sendquota(request, transp) - struct svc_req *request; - SVCXPRT *transp; +sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; struct getquota_rslt getq_rslt; @@ -180,28 +174,9 @@ sendquota(request, transp) } } -void -printerr_reply(transp) /* when a reply to a request failed */ - SVCXPRT *transp; -{ - char *name; - struct sockaddr_in *caller; - int save_errno; - - save_errno = errno; - - caller = svc_getcaller(transp); - name = (char *)inet_ntoa(caller->sin_addr); - errno = save_errno; - if (errno == 0) - syslog(LOG_ERR, "couldn't send reply to %s", name); - else - syslog(LOG_ERR, "couldn't send reply to %s: %m", name); -} - /* initialise the fs_tab list from entries in /etc/fstab */ void -initfs() +initfs(void) { struct fs_stat *fs_current = NULL; struct fs_stat *fs_next = NULL; @@ -249,10 +224,7 @@ initfs() * Return 0 if fail, 1 otherwise */ int -getfsquota(id, path, dqblk) - long id; - char *path; - struct dqblk *dqblk; +getfsquota(long id, char *path, struct dqblk *dqblk) { struct stat st_path; struct fs_stat *fs; @@ -308,9 +280,7 @@ getfsquota(id, path, dqblk) * Comes from quota.c, NetBSD 0.9 */ int -hasquota(fs, qfnamep) - struct fstab *fs; - char **qfnamep; +hasquota(struct fstab *fs, char **qfnamep) { static char initname, usrname[100]; static char buf[BUFSIZ]; diff --git a/libexec/rpc.yppasswdd/rpc.yppasswdd.c b/libexec/rpc.yppasswdd/rpc.yppasswdd.c index 33a80bec1c7..dbb0c0eb171 100644 --- a/libexec/rpc.yppasswdd/rpc.yppasswdd.c +++ b/libexec/rpc.yppasswdd/rpc.yppasswdd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc.yppasswdd.c,v 1.11 2001/12/09 14:58:30 miod Exp $ */ +/* $OpenBSD: rpc.yppasswdd.c,v 1.12 2002/06/20 03:43:41 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: rpc.yppasswdd.c,v 1.11 2001/12/09 14:58:30 miod Exp $"; +static char rcsid[] = "$OpenBSD: rpc.yppasswdd.c,v 1.12 2002/06/20 03:43:41 deraadt Exp $"; #endif #include <sys/types.h> @@ -63,19 +63,16 @@ char *tempname; char *dir; void -usage() +usage(void) { - fprintf(stderr, "%s%s%s", - "usage: rpc.yppasswdd ", - "[-d dir] [-noshell] [-nogecos] [-nopw]\n", - " [-m arg1 arg2 ... ]\n"); + fprintf(stderr, + "usage: rpc.yppasswdd [-d dir] [-noshell] [-nogecos] [-nopw]\n" + " [-m arg1 arg2 ... ]\n"); exit(1); } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; int i = 1; @@ -103,8 +100,8 @@ main(argc, argv) } i++; } - } else if (strcmp("-d", argv[i]) == 0 - && i < argc + 1) { + } else if (strcmp("-d", argv[i]) == 0 && + i < argc + 1) { i++; dir = argv[i]; } else @@ -147,9 +144,7 @@ main(argc, argv) } static void -yppasswddprog_1(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +yppasswddprog_1(struct svc_req *rqstp, SVCXPRT *transp) { union { yppasswd yppasswdproc_update_1_arg; @@ -180,7 +175,7 @@ yppasswddprog_1(rqstp, transp) } void -sig_child() +sig_child(void) { int save_errno = errno; diff --git a/libexec/rpc.yppasswdd/yppasswdd_mkpw.c b/libexec/rpc.yppasswdd/yppasswdd_mkpw.c index 47f2b1529cb..8bf9cd49e33 100644 --- a/libexec/rpc.yppasswdd/yppasswdd_mkpw.c +++ b/libexec/rpc.yppasswdd/yppasswdd_mkpw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yppasswdd_mkpw.c,v 1.22 2002/05/22 06:35:44 deraadt Exp $ */ +/* $OpenBSD: yppasswdd_mkpw.c,v 1.23 2002/06/20 03:43:41 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: yppasswdd_mkpw.c,v 1.22 2002/05/22 06:35:44 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: yppasswdd_mkpw.c,v 1.23 2002/06/20 03:43:41 deraadt Exp $"; #endif #include <sys/param.h> @@ -59,8 +59,7 @@ extern char make_arg[]; extern char *dir; char * -ok_shell(name) - char *name; +ok_shell(char *name) { char *p, *sh; @@ -76,8 +75,7 @@ ok_shell(name) } int -badchars(base) - char *base; +badchars(char *base) { int ampr = 0; char *s; @@ -96,9 +94,7 @@ badchars(base) } int -subst(s, from, to) - char *s; - char from, to; +subst(char *s, char from, char to) { int n = 0; @@ -113,11 +109,10 @@ subst(s, from, to) } int -make_passwd(argp) - yppasswd *argp; +make_passwd(yppasswd *argp) { struct passwd pw; - int pfd, tfd; + int pfd = -1, tfd; char buf[10], *bp = NULL, *p, *t; int n; ssize_t cnt; @@ -137,6 +132,8 @@ make_passwd(argp) if (fstat(pfd, &st)) goto fail; p = bp = malloc((resid = st.st_size) + 1); + if (bp == NULL) + goto fail; do { cnt = read(pfd, p, resid); if (cnt < 0) @@ -203,9 +200,10 @@ make_passwd(argp) if (!noshell) pw.pw_shell = argp->newpw.pw_shell; - for (n = 0, p = pw.pw_gecos; *p; p++) + for (n = 0, p = pw.pw_gecos; *p; p++) { if (*p == '&') n = n + strlen(pw.pw_name) - 1; + } if (strlen(pw.pw_name) + 1 + strlen(pw.pw_passwd) + 1 + strlen((snprintf(buf, sizeof buf, "%u", pw.pw_uid), buf)) + 1 + strlen((snprintf(buf, sizeof buf, "%u", pw.pw_gid), buf)) + 1 + diff --git a/libexec/rpc.yppasswdd/yppasswdd_proc.c b/libexec/rpc.yppasswdd/yppasswdd_proc.c index 702d9b13c0c..929b12bc3eb 100644 --- a/libexec/rpc.yppasswdd/yppasswdd_proc.c +++ b/libexec/rpc.yppasswdd/yppasswdd_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yppasswdd_proc.c,v 1.7 2002/02/16 21:27:31 millert Exp $ */ +/* $OpenBSD: yppasswdd_proc.c,v 1.8 2002/06/20 03:43:41 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: yppasswdd_proc.c,v 1.7 2002/02/16 21:27:31 millert Exp $"; +static char rcsid[] = "$OpenBSD: yppasswdd_proc.c,v 1.8 2002/06/20 03:43:41 deraadt Exp $"; #endif #include <sys/types.h> @@ -46,10 +46,7 @@ static char rcsid[] = "$OpenBSD: yppasswdd_proc.c,v 1.7 2002/02/16 21:27:31 mill int make_passwd(yppasswd *); int * -yppasswdproc_update_1_svc(argp, rqstp, transp) - yppasswd *argp; - struct svc_req *rqstp; - SVCXPRT *transp; +yppasswdproc_update_1_svc(yppasswd *argp, struct svc_req *rqstp, SVCXPRT *transp) { static int res; |