Bug 76

Summary: mail_always causing sudo to fail
Product: Sudo Reporter: Thiago Conde Figueiró <thiago>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: normal    
Version: 1.6.3   
Hardware: PC   
OS: Linux   

Description Thiago Conde Figueiró 2002-04-05 07:56:27 MST
If you set mail_always and then try to run "sudo su user" the su command will fail:

[thiago@hermes thiago]$ alias w=whoami
[thiago@hermes thiago]$ w
thiago
[thiago@hermes thiago]$ sudo su teste
[thiago@hermes thiago]$ stty: standard input: Input/output error
[teste@hermes thiago]$ w
thiago
[thiago@hermes thiago]$ [teste@hermes thiago]$
[thiago@hermes thiago]$ exit

[thiago@hermes thiago]$

I alias'ed w to whoami because after the error any key you type is accepted as a command, thus when I tried to type whoami it issued the command 'w', then 'a', then etc.

My sudoers:
Defaults        syslog=auth, mail_always, insults
User_Alias      OPERADOR =      user1,\
                                user2,\
                                thiago
Cmnd_Alias      SU = /bin/su, /usr/bin/passwd
root    ALL=(ALL) ALL
OPERADOR        hermes = /bin/su [!-]*,\
                         !/bin/su *root*,\
                         !/bin/su *OPERADOR*
OPERADOR        hermes = /usr/bin/passwd [!-]*,\
                         !/usr/bin/passwd *root*,\
                         !/usr/bin/passwd *OPERADOR*

By the way, *OPERADOR* doesn't work, I was only testing :-).

I still received the command log by mail as expected, though.
Comment 1 Todd C. Miller 2003-03-19 19:23:03 MST
I believe this is the same issue as bug #102.  There is a patch for the problem attached to that bug number.

*** This bug has been marked as a duplicate of 102 ***