]> arthur.barton.de Git - netatalk.git/commitdiff
Fix SIGHUP
authorFrank Lahm <franklahm@googlemail.com>
Sun, 1 May 2011 09:01:37 +0000 (11:01 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Sun, 1 May 2011 09:01:37 +0000 (11:01 +0200)
NEWS
etc/afpd/afp_dsi.c
etc/afpd/afp_options.c
etc/afpd/main.c
libatalk/util/socket.c

diff --git a/NEWS b/NEWS
index 757b22a7d716020af4fa142e7d07d8bfe3c17317..950497802722f3c5dbd7d2fdd0fa62924d6a22a9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+Changes in 2.2
+==============
+
+* UPD: Support for Berkeley DB 5.1
+* UPD: case-conversion is based on Unicode 6.0.0
+* UPD: cnid_metad: allow up to 4096 volumes
+* FIX: afpd: configuration reload with SIGHUP
+* FIX: afpd: crashes in the dircache
+* FIX: afpd: Correct afp logout vs dsi eof behaviour
+* FIX: afpd: new catsearch was broken
+* FIX: dbd: Multiple fixes, reliable locking
+* FIX: ad file suite: fix an error that resulted in CNID database inconsistencies
+
 Changes in 2.2beta4
 ===================
 
index 0a735ea4d2ae1a0946b63d0ece3cdea8756547f8..7b10ad0c0ed2a625f96af9060613ef7060153afb 100644 (file)
@@ -516,8 +516,6 @@ void afp_over_dsi(AFPObj *obj)
         if (reload_request) {
             reload_request = 0;
             load_volumes(AFPobj);
-            dircache_dump();
-            log_dircache_stat();
         }
 
         /* The first SIGINT enables debugging, the next restores the config */
@@ -525,6 +523,8 @@ void afp_over_dsi(AFPObj *obj)
             static int debugging = 0;
             debug_request = 0;
 
+            dircache_dump();
+
             if (debugging) {
                 if (obj->options.logconfig)
                     setuplog(obj->options.logconfig);
index f3724c13cdbd6d05f8403b6a753839e9c1f207c0..ab33ebee786f673032beb7ec5c32e2455ffab167 100644 (file)
@@ -350,8 +350,11 @@ int afp_options_parseline(char *buf, struct afp_options *options)
     while (NULL != (c = strstr(c, "-setuplog"))) {
         char *optstr;
         if ((optstr = getoption(c, "-setuplog"))) {
+            /* hokey2: options->logconfig must be converted to store an array of logstrings */
+            if (options->logconfig)
+                free(options->logconfig);
+            options->logconfig = strdup(optstr);
             setuplog(optstr);
-            options->logconfig = optstr; /* at least store the last (possibly only) one */
             c += sizeof("-setuplog");
         }
     }
index 0d552d6f73c77faa3478f4a37702fb630aa6e7a3..7bee91f20facb6941cddf3cb105d94e52509cc04 100644 (file)
@@ -104,7 +104,6 @@ static void fd_reset_listening_sockets(void)
             continue;
         fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, config->fd);
     }
-    fd_set_listening_sockets();
 }
 
 /* ------------------ */
@@ -337,6 +336,7 @@ int main(int ac, char **av)
         if (reloadconfig) {
             nologin++;
             auth_unload();
+            fd_reset_listening_sockets();
 
             LOG(log_info, logtype_afpd, "re-reading configuration file");
             for (config = configs; config; config = config->next)
@@ -350,10 +350,13 @@ int main(int ac, char **av)
                 LOG(log_error, logtype_afpd, "config re-read: no servers configured");
                 exit(EXITERR_CONF);
             }
-            fd_reset_listening_sockets();
+
+            fd_set_listening_sockets();
+
             nologin = 0;
             reloadconfig = 0;
             errno = saveerrno;
+            continue;
         }
 
         if (ret == 0)
index 528b2646bcfe2885bd2c0450b61b4429825f1082..5bdc03c3a3d671a0a6f116b77444aba2276320ae 100644 (file)
@@ -486,7 +486,8 @@ void fdset_add_fd(struct pollfd **fdsetp,
  * Remove a fd from our pollfd array
  *
  * 1. Search fd
- * 2. If we remove the last array elemnt, just decrease count
+ * 2a 
+ * 2b If we remove the last array elemnt, just decrease count
  * 3. If found move all following elements down by one
  * 4. Decrease count of used elements in array
  *
@@ -507,9 +508,15 @@ void fdset_del_fd(struct pollfd **fdsetp,
     struct pollfd *fdset = *fdsetp;
     struct polldata *polldata = *polldatap;
 
+    if (*fdset_usedp < 1)
+        return;
+
     for (int i = 0; i < *fdset_usedp; i++) {
         if (fdset[i].fd == fd) { /* 1 */
-            if (i < (*fdset_usedp - 1)) { /* 2 */
+            if (i == 0 && *fdset_usedp == 1) { /* 2a */
+                fdset[i].fd = -1;
+                memset(&polldata[i], 0, sizeof(struct polldata));
+            } else if (i < (*fdset_usedp - 1)) { /* 2b */
                 memmove(&fdset[i], &fdset[i+1], (*fdset_usedp - 1) * sizeof(struct pollfd)); /* 3 */
                 memmove(&polldata[i], &polldata[i+1], (*fdset_usedp - 1) * sizeof(struct polldata)); /* 3 */
             }