Re: [OT] change user when executing some script

2007-06-15 Thread Galevsky
2007/6/15, Bob Proulx <[EMAIL PROTECTED]>: Galevsky wrote: > Many thanks for your comment and piece of code ;) I would not want to have warned that the sky was falling without being able to direct people to an underground bunker where they would be safe. :-) Ya, but not the whole contributors

Re: [OT] change user when executing some script

2007-06-14 Thread Bob Proulx
Galevsky wrote: > Many thanks for your comment and piece of code ;) I would not want to have warned that the sky was falling without being able to direct people to an underground bunker where they would be safe. :-) > In fact, I need my team to run a ruby tool, Yeah! Ruby! Good stuff. (I am

Re: [OT] change user when executing some script

2007-06-14 Thread Galevsky
Many thanks for your comment and piece of code ;) In fact, I need my team to run a ruby tool, but $RUBYLIB and the main routine call is done into a setgid shell script. The script belongs to special user and group: myTeam:myTeam, and all the members of the team have the ability to log as myTeam s

Re: [OT] change user when executing some script

2007-06-14 Thread Bob Proulx
Galevsky wrote: > When user3 will launch the script later, he will get the user1 > permissions thanks to the setguid flag on the script, and will be able Setuid scripts are a security hole! It is almost impossible to prevent anyone from becoming the owner of the script in those cases. Better wou

Re: [OT] change user when executing some script

2007-06-14 Thread Galevsky
Hereafter is one of the solutions: the files handled by the script must reside into a user1 directory with setgid flag turned on, and 775 permissions mode. All the files created into this dir will belongs to user1' group. So, user2 will launch the script and generate a user2,user1group permission

Re: [OT] change user when executing some script

2007-06-14 Thread Galevsky
Thank you guys. Unfortunately, I cannot do that since I am not root and can neither add group nor modify any /etc/*. That is the reason why I was looking for a solution to change the user when executing the script. setuid and setgid are nice to apply the script owner permissions to the users, but

Re: [OT] change user when executing some script

2007-06-13 Thread Bob Proulx
Douglas Allan Tutty wrote: > Galevsky wrote: > > How can I make the /home/user1/testfile belong to user1, the owner of > > the script instead of the user that launches it ? > > On DEBIAN, to remove a file, you need write permissions on the directory > in which it resides. I suppose user1 could gi

Re: [OT] change user when executing some script

2007-06-13 Thread Douglas Allan Tutty
On Wed, Jun 13, 2007 at 05:12:34PM +0200, Galevsky wrote: > Let's have 3 users: user1, user2 and user3 > let's have a user1 script: /home/user1/script.sh > > Script is: > > #!/bin/bash > if [ -f '/home/user1/testfile' ] > then rm /home/user1/testfile > else touch /home/user1/testfile > fi > >

Re: [OT] change user when executing some script

2007-06-13 Thread Andrew J. Barr
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Galevsky <[EMAIL PROTECTED]> wrote: > NB: I run on SunOS 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Fire. So why did you mail this list? This list is for Debian, most versions of which use a GNU/Linux kernel, unless you are using Debian on an OpenSo

[OT] change user when executing some script

2007-06-13 Thread Galevsky
Hi, it is not the first time that i am facing this kind of problem, but I never find out . I decided to ask for some help. Let's have 3 users: user1, user2 and user3 let's have a user1 script: /home/user1/script.sh Script is: #!/bin/bash if [ -f '/home/user1/testfile' ] then rm /home/use