mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
Looser owner/permission checks for an uninstalled sudoers file.
We don't check the owner or permissions on a sudoers file that is specified as an argument to visudo by default. However, the owner and mode of files included via @includedir were still checked. This commit makes the owner and permissions checks for filed included via @includedir follow the same as for the original sudoers file.
This commit is contained in:
parent
b2a32f95ee
commit
ef4ce5c08a
@ -229,8 +229,16 @@ main(int argc, char *argv[])
|
|||||||
usage(1);
|
usage(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check/set owner and mode for installed sudoers file. */
|
if (fflag) {
|
||||||
if (!fflag) {
|
/* Looser owner/permission checks for an uninstalled sudoers file. */
|
||||||
|
if (!use_owner) {
|
||||||
|
sudoers_uid = -1;
|
||||||
|
sudoers_gid = -1;
|
||||||
|
}
|
||||||
|
if (!use_perms)
|
||||||
|
SET(sudoers_mode, S_IWUSR);
|
||||||
|
} else {
|
||||||
|
/* Check/set owner and mode for installed sudoers file. */
|
||||||
use_owner = true;
|
use_owner = true;
|
||||||
use_perms = true;
|
use_perms = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user