ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: TS-7250 CGI file upload

To:
Subject: Re: [ts-7000] Re: TS-7250 CGI file upload
From: Jim Jackson <>
Date: Mon, 5 May 2008 19:32:41 +0100 (BST)


On Mon, 5 May 2008, igorarm wrote:

> Thanx a lot for your help, it was a permission problem, all fixed now.
> However i have one more question
>
> I'm trying to restart a linux process from the web screen that i have
> created. i run php and use shell_exec() function passing in the path
> to the startup script like this:
>
> shell_exec("/etc/init.d/start.sh restart);
> Apache runs as user nobody, so i created a user www and restarted apache.
> Now there is still a permission problem with this. The program,
> originally is being started when the board powers up.

Yes, but by root. The /etc/init.d/ scripts are really meant to run as the 
superuser, root. What you need to do is create a small setuid C program
that executes the init.d script with the parameters you give the program.
You install this program and run

  chown root program
  chmod +s program

to set the ownership to root and the setuid bit on (google for an 
explanation of setuid). Replace execution of program in the exec_shell 
statement. Setuid scripts don't work and are a serious security hole.


> i have qa
> symbolic link to the startup script in /etc/rc.d/rc3.d
> so initially the program is being started by root.
> how can i make it so i can still start, stop and restart the
> application usinf my startup script but from the web page.
> thanx a lot for you help
>
> Igor
>
>
> --- In  Jim Jackson <> wrote:
>>
>>
>>
>>
>> On Wed, 30 Apr 2008, igorarm wrote:
>>
>>> Hi.
>>> I would like to sate right away I'm very new to CGI.
>>> I'm trying to run either a C cgi program or a PHP script to upload a
>>> file on the server(C cgi program is from the CGIC library that i have
>>> crosscompiled, php script was from google searching).
>>> I couldn't get neither of them to actually succeed in uploading
> the file.
>>> When i run the CIGC cgi test program and don't specify the filename to
>>> upload (so upload is disabled) everything works like a dream, however
>>> every time i tried to upload a file using it, i get Internal Server
>>> Error message from the apache.
>>> I run the php modded apache server which i downloaded from here.
>>> If anyone succeeded on running a file upload cgi or php script on
>>> TS-72XX board, please let me know how you did it.
>>
>> It's probably nothing to do with being on the TS board.
>> It is quite likely a file permissions problem.
>> Check which user apache runs as, and make sure your file/directory
>> permissions allow that user to write the relevant file.
>>
>
>
>

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU