Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:Staging:A
cronie
safe-backup-permissions.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File safe-backup-permissions.patch of Package cronie
Index: cronie-cronie-1.7.0/src/crontab.c =================================================================== --- cronie-cronie-1.7.0.orig/src/crontab.c +++ cronie-cronie-1.7.0/src/crontab.c @@ -520,6 +520,7 @@ static int backup_crontab(const char *cr FILE *backup_file; struct stat sb; int retval = 0; + mode_t old_umask; /* create backup directory */ if ((env_value = getenv("XDG_CACHE_HOME")) != NULL) { @@ -590,6 +591,9 @@ static int backup_crontab(const char *cr } } + // ensure backup file has strict permssions. Crontabs are not readable for + // other users and might contain sensitive information + old_umask = umask(0077); if ((backup_file = fopen(backup_path, "w+")) == NULL) { fprintf(stderr, "Failed to write to the backup file: "); perror(backup_path); @@ -598,6 +602,8 @@ static int backup_crontab(const char *cr } swapback: + umask(old_umask); + if (swap_uids_back() < OK) { perror("swapping uids back"); exit(ERROR_EXIT);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor