mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
visudo: create temporary file as mod 0600 not 0700
This was due to a typo in the mode field when the temporary file was created. Noticed by Bjorn Baron of the sudo-rs project.
This commit is contained in:
@@ -499,7 +499,7 @@ edit_sudoers(struct sudoersfile *sp, char *editor, int editor_argc,
|
||||
if (sp->tpath == NULL) {
|
||||
if (asprintf(&sp->tpath, "%s.tmp", sp->dpath) == -1)
|
||||
sudo_fatalx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
|
||||
tfd = open(sp->tpath, O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU|S_IRUSR);
|
||||
tfd = open(sp->tpath, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR);
|
||||
if (tfd < 0)
|
||||
sudo_fatal("%s", sp->tpath);
|
||||
|
||||
|
Reference in New Issue
Block a user