-/* 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <ctype.h>
#include <syslog.h>
#include <sys/param.h>
#include <sys/time.h>
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif /* HAVE_DLFCN_H */
+
+#ifdef SHADOWPW
+#include <shadow.h>
+#endif /* SHADOWPW */
#include <netatalk/endian.h>
#include <atalk/asp.h>
#include <atalk/util.h>
#include "globals.h"
-#include "config.h"
+#include "afp_config.h"
#include "auth.h"
#include "uam_auth.h"
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;
}
setpwent();
while ((pwent = getpwent())) {
- if (user = strchr(pwent->pw_gecos, ','))
+ if ((user = strchr(pwent->pw_gecos, ',')))
*user = '\0';
user = pwent->pw_gecos;
}
}
endpwent();
-#endif
+#endif /* ! NO_REAL_USER_NAME */
/* os x server doesn't keep anything useful if we do getpwent */
return pwent ? getpwnam(name) : NULL;
}
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;
}
*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
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;
*buflen = 0;
return len;
}
+
+/* --- papd-specific functions (just placeholders) --- */
+void append(void *pf, char *data, int len)
+{
+ return;
+}