util: add mode, uid, gid parameters to UTI_CreateDirAndParents()

This commit is contained in:
Miroslav Lichvar
2015-08-10 14:56:17 +02:00
parent 9a83cab2f8
commit 236576c124
4 changed files with 42 additions and 34 deletions

7
util.h
View File

@@ -130,7 +130,10 @@ extern int UTI_DecodePasswordFromText(char *key);
extern int UTI_SetQuitSignalsHandler(void (*handler)(int));
/* Create a directory and any parent directories that don't exist */
extern int UTI_CreateDirAndParents(const char *path);
/* Create a directory with a specified mode (umasked) and set its uid/gid
(if not 0). Create also any parent directories that don't exist with mode
755 and default uid/gid. Returns 1 if created or already exists (even with
different mode/uid/gid), 0 otherwise. */
extern int UTI_CreateDirAndParents(const char *path, mode_t mode, uid_t uid, gid_t gid);
#endif /* GOT_UTIL_H */