]> arthur.barton.de Git - netatalk.git/commitdiff
Add another check to prevent running as root in disconnected state
authorFrank Lahm <franklahm@googlemail.com>
Tue, 24 May 2011 10:41:47 +0000 (12:41 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 24 May 2011 10:41:47 +0000 (12:41 +0200)
etc/afpd/afp_dsi.c

index 301e89002505bab14836e5256c0e47009fe44382..29212b89eea2ea101b20ba844090668dd74187b2 100644 (file)
@@ -292,6 +292,10 @@ static void alarm_handler(int sig _U_)
     } 
 
     if (dsi->flags & DSI_DISCONNECTED) {
+        if (geteuid() == 0) {
+            LOG(log_note, logtype_afpd, "afp_alarm: unauthenticated user, connection problem");
+            afp_dsi_die(EXITERR_CLNT);
+        }
         if (dsi->tickle > AFPobj->options.disconnected) {
             LOG(log_error, logtype_afpd, "afp_alarm: reconnect timer expired, goodbye");
             afp_dsi_die(EXITERR_CLNT);