]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/auth.c
Whitespace and exclamation mark fixes
[netatalk.git] / etc / afpd / auth.c
index 9f5034dc0551051a8a5d7fd861496d67eb2cbbea..ce1556b6930ee26b9569ad746dc726c3a722a821 100644 (file)
@@ -340,6 +340,12 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi
     obj->uid = geteuid();
     obj->logout = logout;
 
+    /* pam_umask or similar might have changed our umask */
+    (void)umask(obj->options.umask);
+
+    /* Some PAM module might have reset our signal handlers and timer, so we need to reestablish them */
+    afp_over_dsi_sighandlers(obj);
+
     return( AFP_OK );
 }
 
@@ -851,8 +857,8 @@ int afp_logout(AFPObj *obj, char *ibuf _U_, size_t ibuflen  _U_, char *rbuf  _U_
     DSI *dsi = (DSI *)(obj->dsi);
 
     LOG(log_note, logtype_afpd, "AFP logout by %s", obj->username);
-    of_close_all_forks();
-    close_all_vol();
+    of_close_all_forks(obj);
+    close_all_vol(obj);
     dsi->flags = DSI_AFP_LOGGED_OUT;
     *rbuflen = 0;
     return AFP_OK;
@@ -991,7 +997,7 @@ int afp_getuserinfo(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf,
             atalk_uuid_t uuid;
             ret = getuuidfromname( obj->username, UUID_USER, uuid);
             if (ret != 0) {
-                LOG(log_info, logtype_afpd, "afp_getuserinfo: error getting UUID !");
+                LOG(log_info, logtype_afpd, "afp_getuserinfo: error getting UUID!");
                 return AFPERR_NOITEM;
             }
             LOG(log_debug, logtype_afpd, "afp_getuserinfo: got UUID: %s", uuid_bin2string(uuid));
@@ -1054,7 +1060,7 @@ int auth_load(const char *path, const char *list)
         return -1;
 
     strlcpy(buf, list, sizeof(buf));
-    if ((p = strtok(buf, ",")) == NULL)
+    if ((p = strtok(buf, ", ")) == NULL)
         return -1;
 
     strcpy(name, path);
@@ -1079,7 +1085,7 @@ int auth_load(const char *path, const char *list)
         } else {
             LOG(log_info, logtype_afpd, "uam: uam not found (status=%d)", stat(name, &st));
         }
-        p = strtok(NULL, ",");
+        p = strtok(NULL, ", ");
     }
 
     return 0;