mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-29 19:09:36 -05:00
Merge pull request #600 from InfrastructureServices/remote-unix-chmod
Change file mode before changing file owner
This commit is contained in:
commit
370a855f08
1 changed files with 1 additions and 1 deletions
|
|
@ -300,6 +300,7 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
|
|||
*/
|
||||
if(fd != -1) {
|
||||
#ifdef HAVE_CHOWN
|
||||
chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
|
||||
if (cfg->username && cfg->username[0] &&
|
||||
cfg_uid != (uid_t)-1) {
|
||||
if(chown(ip, cfg_uid, cfg_gid) == -1)
|
||||
|
|
@ -307,7 +308,6 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
|
|||
(unsigned)cfg_uid, (unsigned)cfg_gid,
|
||||
ip, strerror(errno));
|
||||
}
|
||||
chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
|
||||
#else
|
||||
(void)cfg;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue