X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fuam.c;h=f171d2a1ef2c3c877a196fcb44bfcdc7ab7fc322;hb=6c1f3cff882955229cb9e0b94eca5e725817633b;hp=af39f358f86e29ef3b4a9ab6c2045d01fb595d47;hpb=31843674b7bd32eabcce3a1ad6159b4f94921f79;p=netatalk.git diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index af39f358..f171d2a1 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -1,16 +1,34 @@ -/* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) +/* + * $Id: uam.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $ + * + * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ #include #include #include #include +#ifdef HAVE_DLFCN_H +#include +#endif /* HAVE_DLFCN_H */ + +#ifdef SHADOWPW +#include +#endif /* SHADOWPW */ #include #include @@ -19,7 +37,7 @@ #include #include "globals.h" -#include "config.h" +#include "afp_config.h" #include "auth.h" #include "uam_auth.h" @@ -46,6 +64,9 @@ struct uam_mod *uam_load(const char *path, const char *name) if ((p = strchr(buf, '.'))) *p = '\0'; if ((mod->uam_fcn = mod_symbol(module, buf)) == NULL) { + syslog(LOG_ERR, "uam_load(%s): mod_symbol error for symbol %s", + name, + buf); goto uam_load_err; } @@ -174,7 +195,7 @@ struct passwd *uam_getname(char *name, const int len) setpwent(); while ((pwent = getpwent())) { - if (user = strchr(pwent->pw_gecos, ',')) + if ((user = strchr(pwent->pw_gecos, ','))) *user = '\0'; user = pwent->pw_gecos; @@ -187,7 +208,7 @@ struct passwd *uam_getname(char *name, const int len) } } endpwent(); -#endif +#endif /* ! NO_REAL_USER_NAME */ /* os x server doesn't keep anything useful if we do getpwent */ return pwent ? getpwnam(name) : NULL; @@ -206,10 +227,12 @@ int uam_checkuser(const struct passwd *pwd) } endusershell(); +#ifdef DISABLE_SHELLCHECK if (!p) { syslog( LOG_INFO, "illegal shell %s for %s", pwd->pw_shell, pwd->pw_name); return -1; } +#endif /* DISABLE_SHELLCHECK */ return 0; } @@ -304,6 +327,10 @@ int uam_afpserver_option(void *private, const int what, void *option, *len = strlen(obj->options.hostname); break; + case UAM_OPTION_PROTOCOL: + *buf = (void *) obj->proto; + break; + case UAM_OPTION_COOKIE: /* it's up to the uam to actually store something useful here. * this just passes back a handle to the cookie. the uam side @@ -346,7 +373,7 @@ int uam_afp_read(void *handle, char *buf, int *buflen, goto uam_afp_read_err; } - while (len = (dsi_write(obj->handle, buf, *buflen))) { + while ((len = (dsi_write(obj->handle, buf, *buflen)))) { if ((len = action(handle, buf, len)) < 0) { dsi_writeflush(obj->handle); goto uam_afp_read_err; @@ -360,3 +387,9 @@ uam_afp_read_err: *buflen = 0; return len; } + +/* --- papd-specific functions (just placeholders) --- */ +void append(void *pf, char *data, int len) +{ + return; +}