]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/auth.c
Fix fce merge conflict
[netatalk.git] / etc / afpd / auth.c
index 94f7601db62334f34d29738709e7ed0071fe0854..566a8d0e05b1b838ddc5e2dceef29463e9c33d03 100644 (file)
@@ -473,21 +473,19 @@ int afp_zzz(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen
         }
     }
 
-    if (dsi->flags & DSI_SLEEPING) {
-        /*
-         * According to AFP 3.3 spec we should not return anything,
-         * but eg 10.5.8 server still returns the numbers of hours
-         * the server is keeping the sessino (ie max sleeptime).
-         */
-        data = obj->options.sleep / 120; /* hours */
-        if (!data) {
-            data = 1;
-        }
-        *rbuflen = sizeof(data);
-        data = htonl(data);
-        memcpy(rbuf, &data, sizeof(data));
-        rbuf += sizeof(data);
+    /*
+     * According to AFP 3.3 spec we should not return anything,
+     * but eg 10.5.8 server still returns the numbers of hours
+     * the server is keeping the sessino (ie max sleeptime).
+     */
+    data = obj->options.sleep / 120; /* hours */
+    if (!data) {
+        data = 1;
     }
+    *rbuflen = sizeof(data);
+    data = htonl(data);
+    memcpy(rbuf, &data, sizeof(data));
+    rbuf += sizeof(data);
 
     return AFP_OK;
 }
@@ -939,8 +937,12 @@ int afp_logincont(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *r
 
 int afp_logout(AFPObj *obj, char *ibuf _U_, size_t ibuflen  _U_, char *rbuf  _U_, size_t *rbuflen)
 {
+    DSI *dsi = (DSI *)(obj->handle);
+
     LOG(log_note, logtype_afpd, "AFP logout by %s", obj->username);
+    of_close_all_forks();
     close_all_vol();
+    dsi->flags = DSI_AFP_LOGGED_OUT;
     *rbuflen = 0;
     return AFP_OK;
 }