Using FreeVSD 1.4.10, Perl 5.6.1, RH 6.2 with kernel 2.4.16
I need to have a user chmod some files to the ownership of
another user. Outside of VSD, ie running on the hosting server,
this can be done with a perl script and a C wrapper suid. Ie:
------------X--------------------
#!/usr/bin/perl
$ENV{PATH} = "/bin:/usr/bin:/usr/mv/bin";
$ENV{BASH_ENV} = "/home/foo.bashrc";
$ENV{SHELL} = "/bin/sh";
$ENV{IFS} = " ";
`chgrp -R ic /home/foocat/*`
`chown ic.ic /home/foo/www/cbin/*`;
`chmod u+s /home/foo/www/cbin/*`;
----------------X---------------------
and a *very* simple wrapper:
---------------X------------------
#include <unistd.h>
void main () {
execl ("/usr/bin/perl","sc.pl","/home/foo/bin/sc.pl",NULL);
}
------------X-------------
Both are owned root.root, the C executable is suid and
run by user foo.
or even doing it all in simple C without the perl script:
---------------X----------------
#include <unistd.h>
#include <stdio.h>
int main (void) {
system ("chgrp -R ic /home/foo/cat");
system ("chown ic.ic /home/foo/www/cbin/*");
system ("chmod u+s /home/foo/www/cbin/*");
}
-----------------X--------------
Again the resulting C executable is root.root, suid and run by
user 'foo'.
The problem is that 'chown' will not work within a VS. In both
cases foo is in ic's group and vice versa, and all other factors
are identical. Chgrp and chmod work OK, and using either of
these chown will work on the hosting server when run by foo,
but not in the VS. The error message is:
Chown: blah: Operation not permitted.
Does anyone have any idea on how to fix this so that it will work?
TIA
Lyn St George
------------------------- The freeVSD Support List --------------------------
Subscribe: mailto:[EMAIL PROTECTED]?body=subscribe%20freevsd-support
Unsubscribe: mailto:[EMAIL PROTECTED]?body=unsubscribe%20freevsd-support
Archives: http://freevsd.org/support/mail-archives/freevsd-support
-----------------------------------------------------------------------------