/*
+ * $Id: auth.c,v 1.9 2009-10-13 22:55:37 didg Exp $
+ *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <ctype.h>
#include <pwd.h>
#include <grp.h>
-#include <syslog.h>
+#include <atalk/logger.h>
#include "uam_auth.h"
static struct uam_mod uam_modules = {NULL, NULL, &uam_modules, &uam_modules};
-static struct uam_obj uam_login = {"", "", 0, {{NULL}}, &uam_login,
+static struct uam_obj uam_login = {"", "", 0, {{NULL, NULL, NULL}}, &uam_login,
&uam_login};
-static struct uam_obj uam_changepw = {"", "", 0, {{NULL}}, &uam_changepw,
+static struct uam_obj uam_changepw = {"", "", 0, {{NULL, NULL, NULL}}, &uam_changepw,
&uam_changepw};
-static struct uam_obj uam_printer = {"", "", 0, {{NULL}}, &uam_printer,
+static struct uam_obj uam_printer = {"", "", 0, {{NULL, NULL, NULL}}, &uam_printer,
&uam_printer};
return -1;
if (!(start = UAM_LIST(type)))
- return 0; /* silently fail */
+ return 1;
uam_attach(start, uam);
return 0;
char name[MAXPATHLEN + 1], buf[MAXPATHLEN + 1], *p;
struct uam_mod *mod;
struct stat st;
- int len;
+ size_t len;
if (!path || !list || (len = strlen(path)) > sizeof(name) - 2)
return -1;
- strncpy(buf, list, sizeof(buf));
+ strlcpy(buf, list, sizeof(buf));
if ((p = strtok(buf, ",")) == NULL)
return -1;
}
while (p) {
- strncpy(name + len, p, sizeof(name) - len);
+ strlcpy(name + len, p, sizeof(name) - len);
if ((stat(name, &st) == 0) && (mod = uam_load(name, p))) {
uam_attach(&uam_modules, mod);
- syslog(LOG_INFO, "uam: %s loaded", p);
+ LOG(log_info, logtype_papd, "uam: %s loaded", p);
}
p = strtok(NULL, ",");
}
}
/* get rid of all of the uams */
-void auth_unload()
+void auth_unload(void)
{
struct uam_mod *mod, *prev, *start = &uam_modules;