On Apr 27, 2010, at 4:03 AM, Caspar ZHANG wrote:

> 
> ----- "Garrett Cooper" <[email protected]> wrote:
> 
>> On Apr 27, 2010, at 2:23 AM, Caspar ZHANG wrote:
>> 
>>> <syscalls-utimensat01-run-sudo-without-tty.patch>
>> 
>>      What good would this do if the value's deleted and not restored? It's
>> better to document this IMO because then it at least brings the issue
>> to light as there may be other areas of the tree that require this
>> kind of intervention.
> 
> I didn't realize this matter, thanks for pointing it out. So what if adding 
> the `Defaults requiretty' value back after this test finished? 

        If it's commented out (which is better than it being deleted), sure. 
Just be sure to do the inverse operation via trap ... EXIT ;), like:

setup
trap 'trap "" EXIT; teardown' EXIT

        You may want to execute the handler before the setup call is invoked to 
ensure that everything done is properly undone in the event of a failure during 
setup.
        Also, watch out for cases where a user may have done:

# requiretty

instead of:

requiretty

        It probably would be wise to preserve all leading and trailing 
characters for teardown to avoid inadvertently enabling requiretty in sudo.
        The EXIT trap handler isn't 100% foolproof, but it protects against all 
but SIGKILL or SIGSTOP from being executed as they're NMIs.
Cheers,
-Garrett
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to