Skip to content
Snippets Groups Projects
Commit 600e9daa authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

do not chown on ro filesystem

parent 5478c1bb
No related branches found
No related tags found
No related merge requests found
......@@ -69,14 +69,21 @@ int sanitize_system(ssexec_t *info)
/** create extra directory for service part */
if (!info->owner) {
auto_check(SS_LOGGER_SYSDIR) ;
/** filesystem may on ro at boot.
* only pass through chmod if it exists yet.
* It should already exist at boot time because service
* was enabled and so sanitize_system was run at least one time */
if (access(SS_LOGGER_SYSDIR, F_OK) < 0) {
if (!youruid(&log_uid,SS_LOGGER_RUNNER) ||
!yourgid(&log_gid,log_uid))
log_dieusys(LOG_EXIT_SYS,"get uid and gid of: ",SS_LOGGER_RUNNER) ;
auto_check(SS_LOGGER_SYSDIR) ;
if (chown(SS_LOGGER_SYSDIR,log_uid,log_gid) == -1)
log_dieusys(LOG_EXIT_SYS,"chown: ",SS_LOGGER_RUNNER) ;
if (!youruid(&log_uid,SS_LOGGER_RUNNER) ||
!yourgid(&log_gid,log_uid))
log_dieusys(LOG_EXIT_SYS,"get uid and gid of: ",SS_LOGGER_RUNNER) ;
if (chown(SS_LOGGER_SYSDIR,log_uid,log_gid) == -1)
log_dieusys(LOG_EXIT_SYS,"chown: ",SS_LOGGER_RUNNER) ;
}
auto_check(SS_SERVICE_SYSDIR) ;
auto_check(SS_SERVICE_ADMDIR) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment