diff options
-rw-r--r-- | source3/winbindd/winbindd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 7e8a1b58e8..698c96cd53 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1285,6 +1285,7 @@ int main(int argc, char **argv, char **envp) int opt; TALLOC_CTX *frame; NTSTATUS status; + bool ok; /* * Do this before any other talloc operation @@ -1424,12 +1425,18 @@ int main(int argc, char **argv, char **envp) exit(1); } - if (!directory_exist(lp_lockdir())) { - mkdir(lp_lockdir(), 0755); + ok = directory_create_or_exist(lp_lockdir(), geteuid(), 0755); + if (!ok) { + DEBUG(0, ("Failed to create directory %s for lock files - %s\n", + lp_lockdir(), strerror(errno))); + exit(1); } - if (!directory_exist(lp_piddir())) { - mkdir(lp_piddir(), 0755); + ok = directory_create_or_exist(lp_piddir(), geteuid(), 0755); + if (!ok) { + DEBUG(0, ("Failed to create directory %s for pid files - %s\n", + lp_piddir(), strerror(errno))); + exit(1); } /* Setup names. */ |