]> arthur.barton.de Git - netatalk.git/commitdiff
Merge remote branch 'sf/product-2-2' into develop
authorFrank Lahm <franklahm@googlemail.com>
Fri, 17 Aug 2012 12:21:52 +0000 (14:21 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 17 Aug 2012 12:21:52 +0000 (14:21 +0200)
Conflicts:
etc/afpd/afp_dsi.c
libatalk/dsi/dsi_stream.c

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

diff --git a/NEWS b/NEWS
index cfb8f1730bd85626690d8ddb9fadbff7e810a588..0e12964b643b480e0ae9725424333be19acd98da 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -105,6 +105,11 @@ 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.
+* FIX: afpd: Fix a possible problem with sendfile on Solaris derived
+       platforms
 
 Changes in 2.2.3
 ================
index 8b1b1a8d7ce98624b41b0e0ae8edf22eaa195a06..70caf468694d6318060fb69591acf8e940126b49 100644 (file)
@@ -378,10 +378,7 @@ 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->dsi;
     int rc_idx;
@@ -389,12 +386,6 @@ void afp_over_dsi(AFPObj *obj)
     uint8_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;
@@ -457,6 +448,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 6c81b5e482301c9e4197642e6aec179bbde3e443..7569cfefa7be0dabb190dc5ef7774749e9f8746b 100644 (file)
@@ -343,6 +343,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 32958f851335ec299050b960b5ada7148051088d..d033d96b12c76e322a8fd143b90e283ff8847738 100644 (file)
@@ -653,6 +653,7 @@ static int logincont2(void *obj_in, struct passwd **uam_pwd,
     /* solaris craps out if PAM_TTY and PAM_RHOST aren't set. */
     pam_set_item(pamh, PAM_TTY, "afpd");
     pam_set_item(pamh, PAM_RHOST, hostname);
+    pam_set_item(pamh, PAM_RUSER, PAM_username);
 
     PAM_error = pam_authenticate(pamh, 0);
     if (PAM_error != PAM_SUCCESS) {
index 5d66c33c887bad2708d43cba902d2485a1bdd549..b8412d15d7c7b300f8b90b3c94a58ddeb96e374b 100644 (file)
@@ -163,5 +163,5 @@ extern const char *AfpErr2name(int err);
 extern struct dir rootParent;
 
 extern void afp_over_dsi (AFPObj *);
-
+extern void afp_over_dsi_sighandlers(AFPObj *obj);
 #endif /* globals.h */