From: Frank Lahm Date: Fri, 2 Sep 2011 11:56:05 +0000 (+0200) Subject: Function checking and removing malformed ad:ea header files failed to chdir back... X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=481772c3528fa582441102a8e68775b22e743e02 Function checking and removing malformed ad:ea header files failed to chdir back to the original working directory --- diff --git a/NEWS b/NEWS index b6b387c4..3d244199 100644 --- 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 diff --git a/etc/cnid_dbd/cmd_dbd_scanvol.c b/etc/cnid_dbd/cmd_dbd_scanvol.c index 39280558..ece70dd4 100644 --- a/etc/cnid_dbd/cmd_dbd_scanvol.c +++ b/etc/cnid_dbd/cmd_dbd_scanvol.c @@ -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() */ + } } /*