mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
conf: create directory for Unix domain command socket
Try to create the directory where will be the Unix domain command socket bound to allow starting with empty /var/run. Check the permissions and owner/group in case the directory already existed. It MUST NOT be accessible by others as permissions on Unix domain sockets are ignored on some systems (e.g. Solaris).
This commit is contained in:
7
util.h
7
util.h
@@ -130,10 +130,17 @@ extern int UTI_DecodePasswordFromText(char *key);
|
||||
|
||||
extern int UTI_SetQuitSignalsHandler(void (*handler)(int));
|
||||
|
||||
/* Get directory (as an allocated string) for a path */
|
||||
extern char *UTI_PathToDir(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);
|
||||
|
||||
/* Check if a directory is secure. It must not have other than the specified
|
||||
permissions and its uid/gid must match the specified values. */
|
||||
extern int UTI_CheckDirPermissions(const char *path, mode_t perm, uid_t uid, gid_t gid);
|
||||
|
||||
#endif /* GOT_UTIL_H */
|
||||
|
||||
Reference in New Issue
Block a user