Bug 97

Summary: Execution of a script that gives a sudo command blanks out screen until mouse is moved
Product: Sudo Reporter: Jason Williams <innocentpuppy>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: normal    
Version: 1.6.6   
Hardware: Other   
OS: Linux   

Description Jason Williams 2003-01-08 20:05:48 MST
sudo version: 1.6.5p2
linux version: Redhat 7.3 Kernel Build 2.4.18-3

I wrote a java GUI application to set the system time.  I don't want the 
application to have root access so I used sudo to give the application the 
needed permissions.  Problem is that off and on the screen blanks out whenever 
the portion of the code calling the script is run.  The only way for me to get 
the screen back is by moving the mouse.  I'm pasting the portion of the code 
that involves sudo.

        String input = "11221122"; //Is dynamic based on what user enters in GUI

        String[] cmd= {"sudo", "/root/setdate", input};

        try
        {
            Runtime rt = Runtime.getRuntime();

            Process p1 = rt.exec(cmd); //Executes the script that is present 
in /root/setdate

            p1.waitFor(); //Wait for the process to finish
        }
        catch(IOException e)
        {
            System.out.println(e);
        }
        catch(InterruptedException e)
        {
            System.out.println("Interrupt Exception");
        }

        setdate script contains only 2 lines
        1. #/bin/bash
        2. date $1

I've ran the same code without using sudo (Application was run as root so cmd = 
{"/root/setdate", input};) and there were no screen blank out problems.  If you 
would like to see the whole application, please let me know and I will send it 
to you.  Any suggestion would be appreciated.  Thank you.
Comment 1 Todd C. Miller 2004-08-05 17:38:04 MDT
Setting the clock into the future can cause the screen blanker to kick in since its idea of the amount of 
time since you were last active will be wrong.  This is not a sudo problem.