[bug] set_permissions.sh wrong "chown" call

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,366
Location
www.poralix.com
Hello,

It seems there is a typo in line

Code:
chown $5 $2:$3 $1

of

Code:
set_file()
{
        if [ -e "$1" ] || [ "$6" = "nocheck" ]; then
                log "set $1 $2:$3 $4 flag $5";


                #chown goes first.
                #A 4755 file is set to 755 if chown is called after chmod.


                chown $5 $2:$3 $1
                chmod $5 $4 $1
        fi


}

in /usr/local/directadmin/scripts/set_permissions.sh

this call

Code:
set_file /home 711 root $RT_GRP 711

would do the following:

Code:
chown 711 711:root /home

and it will end with wrong permissions on /home dir and probably other files/dirs:

Code:
[root@server ~]# ls -ld /home/
drwx--x--x. 433 711 root 16384 Mar 30 05:37 /home/
[root@server ~]# chown 0:0 /home
[root@server ~]# ls -ld /home/
drwx--x--x. 433 root root 16384 Mar 30 05:37 /home/
[root@server ~]#


Please fix it.
 
Thanks for the report. I've changed:
Code:
set_file /home 711 root $RT_GRP 711
to be
Code:
set_file /home root $RT_GRP 711
John
 
Back
Top