Tried to fix updx cache permissions

This commit is contained in:
maniacikarus
2009-05-08 11:48:20 +02:00
parent 1a63e5d2b1
commit 2b5b6b9e75
3 changed files with 8 additions and 6 deletions

View File

@@ -49,7 +49,6 @@ $vendorid =~ tr/A-Z/a-z/;
unless (-d "$repository/download/$vendorid")
{
system("mkdir -p $repository/download/$vendorid");
system("chown -R nobody.squid $repository/download/$vendorid");
system("chmod 775 $repository/download/$vendorid");
}
@@ -159,15 +158,13 @@ if ($_ == 0)
unless (-d "$repository/$vendorid")
{
system("mkdir -p $repository/$vendorid");
system("chown -R nobody.squid $repository/$vendorid");
system("mkdir -p $repository/$vendorid");
system("chmod 775 $repository/$vendorid");
}
unless (-d "$repository/$vendorid/$uuid")
{
system("mkdir -p $repository/$vendorid/$uuid");
system("chown -R nobody.squid $repository/$vendorid/$uuid");
system("chmod 775 $repository/$vendorid/$uuid");
}
@@ -183,7 +180,7 @@ if ($_ == 0)
&UPDXLT::setcachestatus("$repository/$vendorid/$uuid/checkup.log",time);
&UPDXLT::setcachestatus("$repository/$vendorid/$uuid/access.log",time);
system("chown -R nobody.squid $repository/$vendorid/$uuid/*");
system("/usr/local/bin/squidctrl setperms");
system("chmod 775 $repository/$vendorid/$uuid/*");
unlink ("$repository/download/$vendorid/$updatefile.info");

View File

@@ -106,6 +106,9 @@ case "$1" in
sleep 1
$0 start
;;
setperms)
chown -R nobody.squid /var/updatecache/
;;
*)
echo "Usage: $0 {start|stop|restart|status|flush}"

View File

@@ -38,8 +38,10 @@ int main(int argc, char *argv[]) {
safe_system("ln -fs ../init.d/squid /etc/rc.d/rc6.d/K00squid >/dev/null 2>&1");
} else if (strcmp(argv[1], "disable") == 0) {
safe_system("rm -f /etc/rc.d/rc*.d/*squid >/dev/null 2>&1");
} else if (strcmp(argv[1], "setperms") == 0) {
safe_system("/etc/rc.d/init.d/squid setperms");
} else {
fprintf(stderr, "\nBad argument given.\n\nsquidctrl (start|stop|restart|flush|reconfigure)\n\n");
fprintf(stderr, "\nBad argument given.\n\nsquidctrl (start|stop|restart|flush|reconfigure|setperms)\n\n");
exit(1);
}