10 static int noauth_login(void *obj, struct passwd **uam_pwd,
11 char *ibuf, int ibuflen,
12 char *rbuf, int *rbuflen)
15 char *guest, *username;
18 syslog( LOG_INFO, "login noauth" );
20 if (uam_afpserver_option(obj, UAM_OPTION_GUEST, (void *) &guest,
24 if (uam_afpserver_option(obj, UAM_OPTION_USERNAME,
25 (void *) &username, NULL) < 0)
28 strcpy(username, guest);
29 if ((pwent = getpwnam(guest)) == NULL) {
30 syslog( LOG_ERR, "noauth_login: getpwnam( %s ): %m", guest);
31 return( AFPERR_BADUAM );
36 syslog( LOG_ERR, "noauth_login: setpag: %m" );
37 return( AFPERR_BADUAM );
45 static int uam_setup(const char *path)
47 if (uam_register(UAM_SERVER_LOGIN, path, "No User Authent",
48 noauth_login, NULL, NULL) < 0)
50 /* uam_register(UAM_SERVER_PRINTAUTH, path,
51 "No User Authent", noauth_printer); */
56 static void uam_cleanup()
58 uam_unregister(UAM_SERVER_LOGIN, "No User Authent");
59 /* uam_unregister(UAM_SERVER_PRINTAUTH, "No User Authent"); */
62 UAM_MODULE_EXPORT struct uam_export uams_guest = {
65 uam_setup, uam_cleanup