I am using Teamsite 6.1 on Solaris and having some difficulty changing the file permissions of selected DCRs using the system command within a perl script.Specifically:system("/usr/bin/chgrp tsusers $name");system("/usr/bin/chmod 777 $name");where $name is the full file path of the DCR within iwmntThe result is the file remaining the same without any changes.The script is being run within Teamsite as the logged in user. So far I have attempted the following:run as masterensured the DCR is not lockedrun as the the owner of the locked fileAny help or additional things to try would be appreciated
I am using Teamsite 6.1 on Solaris and having some difficulty changing the file permissions of selected DCRs using the system command within a perl script.Specifically:system("/usr/bin/chgrp tsusers $name");system("/usr/bin/chmod 777 $name");
my $cmd1 = qq(/usr/bin/chgrp 777 $name);my $cmd2 = qq(/usr/bin/chmod 777 $name);my $res1 = qx($cmd1 2>&1);my $res2 = qx($cmd2 2>&1);warn("uid: $<\neuid: $>\n$cmd1: $res1$cmd2: $res2);
Note: While I agree with Nipper about using the built-in chown/chmod functions - it's mostly for efficiency. The issue about running harmful commands through scripts is a coding / design issue not a perl issue as perl doesn't care what you put into the system() or qx() calls ... unless it's running in "taint" mode.
That is strange. I noticed that I could not use rm (and not in a taint mode scenerio) but I could use unlink. I will have to play with it again. I also just use the built in functions for ease.Andy
...Is there another way to change the owner of the file whilst running as a different logged in user?Thanks for your continued help on this
yes, sorry for not including that information before.UID ($<) and EUID ($>) confirm that it is being run as 5061677 which in my case is the logged in user.The script is being run from a custom menu