]> arthur.barton.de Git - netatalk.git/commitdiff
Reset signal handlers and alarm timer after successfull PAM authentication
authorFrank Lahm <franklahm@googlemail.com>
Fri, 27 Jul 2012 10:01:35 +0000 (12:01 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 27 Jul 2012 10:01:35 +0000 (12:01 +0200)
Fixes a problem with AFP disconnects caused by pam_smbpass.so messing with
our handlers and timer.

NEWS
etc/afpd/afp_dsi.c
etc/afpd/auth.c
include/atalk/globals.h

diff --git a/NEWS b/NEWS
index 0f88863b1f853ac675babfc5f83e62a7c53d03df..fac3168803a0929596ce242d32f28b572c124f39 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ Changes in 2.2.4
 
 * FIX: Missing UAM links
 * FIX: Lockup in AFP logout on Fedora 17
+* FIX: Reset signal handlers and alarm timer after successfull PAM
+       authentication. Fixes a problem with AFP disconnects caused
+       by pam_smbpass.so messing with our handlers and timer.
 
 Changes in 2.2.3
 ================
index 7779b2307f9ca16f8dbda74b8587e8391d5950ad..8529177d6cf85588270148e1cca524cbcb64d54a 100644 (file)
@@ -383,23 +383,11 @@ static void pending_request(DSI *dsi)
     }
 }
 
-/* -------------------------------------------
- afp over dsi. this never returns. 
-*/
-void afp_over_dsi(AFPObj *obj)
+void afp_over_dsi_sighandlers(AFPObj *obj)
 {
     DSI *dsi = (DSI *) obj->handle;
-    int rc_idx;
-    u_int32_t err, cmd;
-    u_int8_t function;
     struct sigaction action;
 
-    AFPobj = obj;
-    obj->exit = afp_dsi_die;
-    obj->reply = (int (*)()) dsi_cmdreply;
-    obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention;
-    dsi->tickle = 0;
-
     memset(&action, 0, sizeof(action));
     sigfillset(&action.sa_mask);
     action.sa_flags = SA_RESTART;
@@ -462,6 +450,25 @@ void afp_over_dsi(AFPObj *obj)
         afp_dsi_die(EXITERR_SYS);
     }
 #endif /* DEBUGGING */
+}
+
+/* -------------------------------------------
+ afp over dsi. this never returns. 
+*/
+void afp_over_dsi(AFPObj *obj)
+{
+    DSI *dsi = (DSI *) obj->handle;
+    int rc_idx;
+    u_int32_t err, cmd;
+    u_int8_t function;
+
+    AFPobj = obj;
+    obj->exit = afp_dsi_die;
+    obj->reply = (int (*)()) dsi_cmdreply;
+    obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention;
+    dsi->tickle = 0;
+
+    afp_over_dsi_sighandlers(obj);
 
     if (dircache_init(obj->options.dircachesize) != 0)
         afp_dsi_die(EXITERR_SYS);
index 40d3a5ac906b7e56a1de886dedd3f52a70f68546..b3d0d9a2c0a35d301e91042b6cec62cbb17b6eac 100644 (file)
@@ -415,6 +415,9 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi
     /* 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 );
 }
 
index 68e68a32f3f403f6dea131dde173883a1dae9d90..3c458d5d55d8f64b46981e05a445ac8be7d07d6b 100644 (file)
@@ -167,5 +167,5 @@ extern struct dir rootParent;
 extern void afp_over_asp (AFPObj *);
 #endif /* NO_DDP */
 extern void afp_over_dsi (AFPObj *);
-
+extern void afp_over_dsi_sighandlers(AFPObj *obj);
 #endif /* globals.h */