]> arthur.barton.de Git - netatalk.git/commitdiff
Fix for bugid #2: afpd childs still running as root in disconnected state because...
authorFrank Lahm <franklahm@googlemail.com>
Mon, 23 May 2011 10:16:40 +0000 (12:16 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 23 May 2011 10:16:40 +0000 (12:16 +0200)
etc/afpd/afp_dsi.c

index 760c8cf8dde3f9b55eff697919cdee233f60c5aa..a1c7b1d0244446899fbc80c611ba2527711e76f1 100644 (file)
@@ -310,6 +310,10 @@ static void alarm_handler(int sig _U_)
         LOG(log_debug, logtype_afpd, "afp_alarm: sending DSI tickle");
         err = dsi_tickle(AFPobj->handle);
     if (err <= 0) {
+        if (geteuid() == 0) {
+            LOG(log_note, logtype_afpd, "afp_alarm: unauthenticated user, connection problem");
+            afp_dsi_die(EXITERR_CLNT);
+        }
         LOG(log_error, logtype_afpd, "afp_alarm: connection problem, entering disconnected state");
         (void)dsi_disconnect(dsi);
     }