[chrony-dev] create_dir in util.c - permissions |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-dev] create_dir in util.c - permissions
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Sat, 21 Nov 2015 13:37:37 +1300
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpcorp.com; s=a0-2; h=Feedback-ID:X-Smtpcorp-Track:To:Date:Message-Id: Subject:From; bh=EY9zBueAR4OdnA5adfKuhrByVaw5bJRu8tBGRjJwyZo=; b=Ob9yXUgwuDbo r7qres7tC8hY0DeOEe/DbO2JNDwUvRLafzS5oqb6piRR4kPFreI6DkrAmDqNm1zxNUhNkLPGdtocp fwBiKMopBhiQ6aGFwQ4MxWQi3/wq53LWkHE2W9XomLsOwwFuKPbLpfrzxPSn2FA7IwcljXPdd/GHt ou3K1UsZu22NrnOFsTOxlzbWVY18SYDuGlWNYoIWWY/TzHvSIOQ7m3iaV3KGql/K5stW6ua2TeXOF cFQyolx/4p7H+gnmbdFxQj4S76PdRafXlOKRZKi7tQkGtTNu9dWpS7mJ0Ewqv+Xnw8gecNwoLStUi wbHZ5ojZpDxs5uzBys6YKA==;
- Feedback-id: 149811m:149811acx33YQ:149811s_fa1BU7Nb:SMTPCORP
Something I noticed when enabling a non-privileged user after having previously been running chronyd as root.
If a directory already exists, create_dir just returns
if (S_ISDIR(buf.st_mode))
return 1;
LOG(LOGS_ERR, LOGF_Util, "%s is not directory", p);
return 0;
I think there should be a call to chown(p, uid, gid) before the return.
Not sure what to do with any existing directory contents. Maybe they should also be chown() 'd.
Or maybe the system administrator should be doing all this manually. :)
--
Bryan
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.