]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fixup 724 fix for fname_after_chroot() calls.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 1 Dec 2015 08:54:53 +0000 (08:54 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 1 Dec 2015 08:54:53 +0000 (08:54 +0000)
git-svn-id: file:///svn/unbound/trunk@3557 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
winrc/win_svc.c

index b8adac88801a1057c76ec392dc2e6471478a0b3f..2f834f19603f624a61a84f926d337f667ebc0f09 100644 (file)
@@ -1,3 +1,6 @@
+1 December 2015: Wouter
+       - Fixup 724 fix for fname_after_chroot() calls.
+
 30 November 2015: Ralph
        - Implemented qname minimisation
 
index 24a4ce7ebeddafc0ff05f33787f71ec5d2b4ed2b..09b78adbc9bf9482ae0764b9e316d852481a594f 100644 (file)
@@ -346,6 +346,12 @@ service_init(int r, struct daemon** d, struct config_file** c)
                                (strrchr(dirbuf, '\\'))[0] = 0;
                        } else log_err("GetModuleFileName had no path");
                        dir = dirbuf;
+                       if(dirbuf[0]) {
+                               /* adjust cfg->directory for the 
+                                * fname_after_chroot calls later to work */
+                               free(cfg->directory);
+                               cfg->directory = memdup(dir, strlen(dir)+1);
+                       }
                }
                if(chdir(dir)) {
                        log_err("could not chdir to %s: %s",