Bug 97 - Execution of a script that gives a sudo command blanks out screen until mouse is moved
Execution of a script that gives a sudo command blanks out screen until mouse...
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.6
Other Linux
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-08 20:05 MST by Jason Williams
Modified: 2004-08-05 21:38 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.