Add closefrom sudoers option to start closing at a point other than 3.

Add closefrom_override sudoers option and -C sudo flag to allow the
user to specify a different closefrom starting point.
This commit is contained in:
Todd C. Miller
2004-12-16 18:33:49 +00:00
parent 74c19b024a
commit 051a2110a4
8 changed files with 96 additions and 29 deletions

View File

@@ -490,9 +490,10 @@ send_mail(line)
}
argv[i] = NULL;
/* Close password and group files so we don't leak fds. */
/* Close password, group and other fds so we don't leak. */
sudo_endpwent();
sudo_endgrent();
closefrom(STDERR_FILENO + 1);
/*
* Depending on the config, either run the mailer as root