diff options
Diffstat (limited to 'usr.sbin/rpc.pcnfsd/pcnfsd_v1.c')
-rw-r--r-- | usr.sbin/rpc.pcnfsd/pcnfsd_v1.c | 150 |
1 files changed, 46 insertions, 104 deletions
diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_v1.c b/usr.sbin/rpc.pcnfsd/pcnfsd_v1.c index 0b3219b5c02..6bad324e04c 100644 --- a/usr.sbin/rpc.pcnfsd/pcnfsd_v1.c +++ b/usr.sbin/rpc.pcnfsd/pcnfsd_v1.c @@ -1,3 +1,4 @@ +/* $OpenBSD: pcnfsd_v1.c,v 1.2 2001/08/19 19:16:12 ericj Exp $ */ /* $NetBSD: pcnfsd_v1.c,v 1.2 1995/07/25 22:21:19 gwr Exp $ */ /* RE_SID: @(%)/usr/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.pcnfsd_v1.c 1.1 91/09/03 12:41:50 SMI */ @@ -7,89 +8,40 @@ ** @(#)pcnfsd_v1.c 1.1 9/3/91 **===================================================================== */ -#include "common.h" -/* -**===================================================================== -** I N C L U D E F I L E S E C T I O N * -** * -** If your port requires different include files, add a suitable * -** #define in the customization section, and make the inclusion or * -** exclusion of the files conditional on this. * -**===================================================================== -*/ -#include "pcnfsd.h" +#include <sys/types.h> +#include <sys/stat.h> -#include <stdio.h> +#include <netdb.h> #include <pwd.h> -#include <sys/file.h> #include <signal.h> -#include <sys/stat.h> -#include <sys/ioctl.h> -#include <netdb.h> +#include <stdio.h> #include <string.h> +#include <unistd.h> -#ifndef SYSV -#include <sys/wait.h> -#endif - -#ifdef ISC_2_0 -#include <sys/fcntl.h> -#endif - -#ifdef SHADOW_SUPPORT -#include <shadow.h> -#endif - -/* -**--------------------------------------------------------------------- -** Other #define's -**--------------------------------------------------------------------- -*/ - -extern void scramble(); -extern char *crypt(); - -#ifdef WTMP -extern void wlogin(); -#endif - -extern struct passwd *get_password(); - -/* -**--------------------------------------------------------------------- -** Misc. variable definitions -**--------------------------------------------------------------------- -*/ - -int buggit = 0; - -/* -**===================================================================== -** C O D E S E C T I O N * -**===================================================================== -*/ - +#include "pcnfsd.h" +#include "paths.h" /*ARGSUSED*/ -void *pcnfsd_null_1_svc(arg, req) -void *arg; -struct svc_req *req; +void * +pcnfsd_null_1_svc(arg, req) + void *arg; + struct svc_req *req; { -static char dummy; -return((void *)&dummy); + static char dummy; + + return ((void *)&dummy); } -auth_results *pcnfsd_auth_1_svc(arg, req) -auth_args *arg; -struct svc_req *req; +auth_results * +pcnfsd_auth_1_svc(arg, req) + auth_args *arg; + struct svc_req *req; { -static auth_results r; - -char uname[32]; -char pw[64]; -int c1, c2; -struct passwd *p; + static auth_results r; + char uname[32], pw[64]; + int c1, c2; + struct passwd *p; r.stat = AUTH_RES_FAIL; /* assume failure */ @@ -99,19 +51,14 @@ struct passwd *p; scramble(arg->id, uname); scramble(arg->pw, pw); -#ifdef USER_CACHE - if(check_cache(uname, pw, &r.uid, &r.gid)) { - r.stat = AUTH_RES_OK; -#ifdef WTMP + if (check_cache(uname, pw, &r.uid, &r.gid)) { + r.stat = AUTH_RES_OK; wlogin(uname, req); -#endif - return (&r); - } -#endif + return (&r); + } - p = get_password(uname); - if (p == (struct passwd *)NULL) - return (&r); + if ((p = get_password(uname)) == NULL) + return (&r); c1 = strlen(pw); c2 = strlen(p->pw_passwd); @@ -123,40 +70,35 @@ struct passwd *p; r.stat = AUTH_RES_OK; r.uid = p->pw_uid; r.gid = p->pw_gid; -#ifdef WTMP wlogin(uname, req); -#endif -#ifdef USER_CACHE add_cache_entry(p); -#endif -return(&r); + return (&r); } -pr_init_results *pcnfsd_pr_init_1_svc(pi_arg, req) -pr_init_args *pi_arg; -struct svc_req *req; +pr_init_results * +pcnfsd_pr_init_1_svc(pi_arg, req) + pr_init_args *pi_arg; + struct svc_req *req; { -static pr_init_results pi_res; + static pr_init_results pi_res; - pi_res.stat = - (pirstat) pr_init(pi_arg->system, pi_arg->pn, &pi_res.dir); + pi_res.stat = (pirstat)pr_init(pi_arg->system, pi_arg->pn, &pi_res.dir); -return(&pi_res); + return (&pi_res); } -pr_start_results *pcnfsd_pr_start_1_svc(ps_arg, req) -pr_start_args *ps_arg; -struct svc_req *req; +pr_start_results * +pcnfsd_pr_start_1_svc(ps_arg, req) + pr_start_args *ps_arg; + struct svc_req *req; { -static pr_start_results ps_res; -char *dummyptr; + static pr_start_results ps_res; + char *dummyptr; - ps_res.stat = - (psrstat) pr_start2(ps_arg->system, ps_arg->pn, ps_arg->user, - ps_arg ->file, ps_arg->opts, &dummyptr); + ps_res.stat = (psrstat)pr_start2(ps_arg->system, ps_arg->pn, + ps_arg->user, ps_arg->file, ps_arg->opts, &dummyptr); -return(&ps_res); + return (&ps_res); } - |