ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Total beginner here. I need a cgi script to run as root to recursively change file permissions. I slapped something together from examples, but Apache complains:
Quote:
Insecure dependency in chmod while running setuid at /var/www/cgi-bin/set-perms.pl line 13., referer: https://example.com/cgi-bin/
This is the script:
Code:
#!/usr/bin/perl -wT
BEGIN {
$ENV{PATH} = "";
}
use strict;
use File::Find;
$|++;
my $baseDir = "/var/www/test/";
my $modeFile = oct(664);
my $modeDir = oct(2775);
sub setperms {
chmod($modeFile, $_) if(-f $_); <------/line 13/
chmod($modeDir, $_) if(-d $_);
chown(-1, 1005, $_);
}
find(\&setperms, "$baseDir");
Distribution: debian on servers, ubuntu on desktops/laptops
Posts: 45
Rep:
The problem is that when Mac users mount a file system on our Linux server locally via MacFUSE, the permissions for new files/dirs they create follow their local umask settings and ignore the directory sticky bit set on the Linux server.
Wouldn't we have the same problem if we used ACLs on the Linux box? Wouldn't files user create over MacFUSE mounts come with their local ACL attributes like they come with their local Unix permissions?
I don't like the idea of running cgi scripts as root any more than the next guy, so I finally gave up on the idea and gave these users sudo rights to run a permission fixing script.
Wouldn't we have the same problem if we used ACLs on the Linux box? Wouldn't files user create over MacFUSE mounts come with their local ACL attributes like they come with their local Unix permissions?
I don't know but given the ease with which you can test such stuff I'd say try and let us know.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.