Re: Failure in running system from within perl within apache - solved

2005-04-08 Thread Shachar Shemesh
Tzafrir Cohen wrote: On Thu, Apr 07, 2005 at 06:53:50PM +0300, Shachar Shemesh wrote: The problem was that some directory in the path was not set according to perlsuid's strict rules. As a result, system never returned, printing the reason to stderr (but there was no one there to receive it,

Re: Failure in running system from within perl within apache

2005-04-08 Thread Shachar Shemesh
Yedidyah Bar-David wrote: On Thu, Apr 07, 2005 at 06:55:57PM +0300, Shachar Shemesh wrote: Yedidyah Bar-David wrote: If you do, note you can't strace a suid exec. To do this, strace -p as root. From the strace man page: If strace is installed setuid to root then the invoking

Re: Failure in running system from within perl within apache

2005-04-08 Thread Muli Ben-Yehuda
On Fri, Apr 08, 2005 at 10:24:22AM +0300, Shachar Shemesh wrote: You can't use -p on a SUID program that takes less than half a second to run. Just not feasible. So put a sleep in front. If it's not your program, use ptrace to put a sleep in front ;-) Cheers, Muli -- Muli Ben-Yehuda

Re: Failure in running system from within perl within apache

2005-04-08 Thread Shachar Shemesh
Muli Ben-Yehuda wrote: On Fri, Apr 08, 2005 at 10:24:22AM +0300, Shachar Shemesh wrote: You can't use -p on a SUID program that takes less than half a second to run. Just not feasible. So put a sleep in front. If it's not your program, use ptrace to put a sleep in front ;-) Cheers, Muli

Re: Failure in running system from within perl within apache

2005-04-08 Thread Muli Ben-Yehuda
On Fri, Apr 08, 2005 at 10:55:38AM +0300, Shachar Shemesh wrote: Remind me how you ptrace a SUID program again, will you? Using a setuid helper or running as root of course ;-) Not to mention that I don't think strace will have much success in attaching to a program I'm ptracing... It

Re: Failure in running system from within perl within apache - solved

2005-04-08 Thread Tzafrir Cohen
On Fri, Apr 08, 2005 at 09:25:44AM +0300, Shachar Shemesh wrote: Tzafrir Cohen wrote: On Thu, Apr 07, 2005 at 06:53:50PM +0300, Shachar Shemesh wrote: The problem was that some directory in the path was not set according to perlsuid's strict rules. As a result, system never returned,

Failure in running system from within perl within apache

2005-04-07 Thread Shachar Shemesh
Hi all, I'm building a small web application. As I want this app to make changes in the system, I'm using a suid (non-root) perl executable to carry out most of the actual operations, and the application (read - apache) runs this executable. So far, so good. One of the operations I need

Re: Failure in running system from within perl within apache

2005-04-07 Thread Gabor Szabo
On Apr 7, 2005 4:09 PM, Shachar Shemesh [EMAIL PROTECTED] wrote: One of the operations I need carried out is creating an SSH key. I use the following syntax inside the perl script: if( system(ssh-keygen, -q, -b, $1, -t, dsa, -f, /home/user/.ssh/id_dsa, -N, , -C, $2 )==0 ) {

Re: Failure in running system from within perl within apache

2005-04-07 Thread Yedidyah Bar-David
On Thu, Apr 07, 2005 at 05:09:00PM +0300, Shachar Shemesh wrote: Hi all, I'm building a small web application. As I want this app to make changes in the system, I'm using a suid (non-root) perl executable to carry out most of the actual operations, and the application (read - apache) runs

Re: Failure in running system from within perl within apache - solved

2005-04-07 Thread Shachar Shemesh
Shachar Shemesh wrote: Hi all, I'm building a small web application. As I want this app to make changes in the system, I'm using a suid (non-root) perl executable to carry out most of the actual operations, and the application (read - apache) runs this executable. So far, so good. One of the

Re: Failure in running system from within perl within apache

2005-04-07 Thread Shachar Shemesh
Yedidyah Bar-David wrote: If you do, note you can't strace a suid exec. To do this, strace -p as root. From the strace man page: If strace is installed setuid to root then the invoking user will be able to attach to and trace pro- cesses owned by any user. In addition setuid and

Re: Failure in running system from within perl within apache - solved

2005-04-07 Thread Tzafrir Cohen
On Thu, Apr 07, 2005 at 06:53:50PM +0300, Shachar Shemesh wrote: The problem was that some directory in the path was not set according to perlsuid's strict rules. As a result, system never returned, printing the reason to stderr (but there was no one there to receive it, as it was from a