]> arthur.barton.de Git - netatalk.git/commitdiff
Function checking and removing malformed ad:ea header files failed to chdir back...
authorFrank Lahm <franklahm@googlemail.com>
Fri, 2 Sep 2011 11:56:05 +0000 (13:56 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 2 Sep 2011 11:56:05 +0000 (13:56 +0200)
NEWS
etc/cnid_dbd/cmd_dbd_scanvol.c

diff --git a/NEWS b/NEWS
index b6b387c42b6f7390b479dfcd7694e461df8671a0..3d244199799c9d84a698696edb6ca412d2d39572 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,8 @@ Changes in 2.2.1
        if DARWIN_ACE_ADD_SUBDIRECTORY is set
 * FIX: afpd: afpd crashed when it failed to register with Avahi because eg
        user service registration is disabled in the Avahi config
+* FIX: dbd: function checking and removing malformed ad:ea header files failed
+       to chdir back to the original working directory
 * FIX: cnid_dbd: increase BerkeleyDB locks and lockobjs
 * FIX: cnid_dbd: implement -d option, deletes CNID db
 * FIX: dbd: better detection of local (or SMB/NFS) modifications on AFP volumes
index 392805588d93902035a432036755e10151932693..ece70dd48953cb33e4523813de26eb1667c49e8e 100644 (file)
@@ -374,7 +374,7 @@ static void remove_eafiles(const char *name, struct ea *ea)
     if ((dp = opendir(".")) == NULL) {
         dbd_log(LOGSTD, "Couldn't open the directory '%s/%s': %s",
                 cwdbuf, ADv2_DIRNAME, strerror(errno));
-        return;
+        goto exit;
     }
 
     while ((ep = readdir(dp))) {
@@ -388,9 +388,14 @@ static void remove_eafiles(const char *name, struct ea *ea)
         } /* if */
     } /* while */
 
+exit:
     if (dp)
         closedir(dp);
-
+    if ((chdir("..")) != 0) {
+        dbd_log(LOGSTD, "Couldn't chdir to '%s': %s", cwdbuf, strerror(errno));
+        /* we can't proceed */
+        longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */
+    }    
 }
 
 /*