Commit b8d5b2ac authored by Mac Newbold's avatar Mac Newbold
Browse files

Small change to make sure .forward files are owned by the user instead of...

Small change to make sure .forward files are owned by the user instead of root. Lots of them were getting left behind as root owned files.
parent 4a578bae
......@@ -529,6 +529,15 @@ sub CheckDotFiles()
}
chmod(0644, "$HOMEDIR/$user/.forward") or
fatal("Could not chmod $forward: $!");
$fileowner= (stat($forward))[4];
$dochown=0;
if ($fileowner==0) {
chown($user_number,$default_groupgid,"$HOMEDIR/$user/.forward") or
do {
warn("Could not chown $forward: $!");
$dochown=1;
};
}
}
#
......@@ -545,6 +554,11 @@ sub CheckDotFiles()
}
$UID = $SAVEUID;
if (defined($dochown) && $dochown!=0) {
chown($user_number,$default_groupgid,"$HOMEDIR/$user/.forward") or
warn("Could not chown $forward: $!");
}
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment