From: Henry Y. <hy...@mv...> - 2010-04-30 23:27:50
|
If a sudo file exists, the patch doesn't touch it. If it does not, a sudoers file will be created and then it will remove it afterwards. I wouldn't feel confortable having a script modify a sudoers file if it already exists. The sudoers content that it does put in place just enables the root user to use sudo, which would not give it any more access than it already has. This text is available in every sudoers file I've looked at. While I was testing the patch with the ltp-dev branch, I noticed that the -n option was put in front of every sudo call in commit 2aa40f7e10518977881b933cc93b8f50847cf3cf in order to suppress the interactive password check. However, neither sudo 1.6.8p12 from MontaVista Linux 6 or 1.6.9p17 from Ubuntu 9.04 supports the -n option. The patch also removes the -n option from sudo calls. This option was added in 3/2008. Signed-Off-By: <hy...@mv...> On Fri, Apr 30, 2010 at 1:15 PM, Garrett Cooper <yan...@gm...> wrote: > On Fri, Apr 30, 2010 at 12:27 PM, Henry Yei <hy...@mv...> wrote: >> Speaking of the utimesat test and prerequisites, our test systems >> don't have a sudoers file by default, so we have an internal patch to >> utimesat to create a default one if non exist and remove it after the >> test is done. Would that be of interest to LTP? >> >> On Tue, Apr 27, 2010 at 11:27 PM, Caspar Zhang <cas...@gm...> wrote: >>> On Wed, Apr 28, 2010 at 2:04 PM, Garrett Cooper <yan...@gm...> wrote: >>>> The first item is different from the other two. The first one ignores the >>>> signal (SIG_IGN), whereas the latter two cases reset the handler to the >>>> default one (SIG_DFL). I prefer the former format, because otherwise the >>>> signal handlers become reentrable on accident. >>> >>> I see. Thank you. >>> >>> The final patch ;-) > > If it: > > 1. Works in all cases, i.e. doesn't use version specific constructs > for sudo (which I haven't seen thus far, but just to be safe). > 2. Is properly reverted when the test is done (which includes the > following scenarios): > a. File already exists. Backup the old file, revert it when the > test is completed (regardless of whether or not the test passed or the > test failed properly [*]). > b. File doesn't exist. Nuke the file after the test is done. > > ... sure. > Thanks, > -Garrett > > [*] SIGKILL or SIGSTOP can't be avoided, so technically it's a best effort. > |