dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: exec()

  1. #1
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    54

    exec()

    Hmmm...

    I wonder, since exec() run as the user "nobody" how can I get it to do things that I in shell only can do as myself.

    Shellscript? (I used UNIX tcsh-script 5 years ago... not since then).

    /Marcus

  2. #2
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    Possibly using su? There could be a security problem there though - maybe if you created a shell script which contained the su command.

    Adam

  3. #3
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    54
    How do I use "su"?

    If I execute it in the shell I get a question for password. That is good, but how do I answer it from a script?

    /Marcus

  4. #4
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    I would presume there is a command-line option to pass the password on the command. Try a Google search.

    Adam

  5. #5
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    54
    Well, the "man" (man su) or the search for su(1) gives the answere that this is the proper synopsis.

    su [options] [username] [arguments]

    Anyone who knows if I can pass the password along in the arguments?

    I tried "-c"-option, but that just passed it on to the first prompt appearing after the password prompt.

    /Marcus

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles