Modifing a preference via applescript changes file group I recently request help about modifying firewall settings via command-line (see my previous question).
Everything is working, but I have noticed that whenever I use this command in an applescript, the file group changes from wheel to staff.  

Before:

-rw-r--r--  1 root  wheel


After running the script:

-rw-r--r--  1 root  staff


Repairing Disk Permissions fixed the issue but change it to admin instead of wheel.

After fixing permissions:

-rw-r--r--  1 root  admin


However, I want to know:  


Why is this happening, and
if it can raise security issues?
In short, it doesn't matter.

ls -l print out consists of status (10 character), number of links, owner, group, etc.

Of the first 10 characters describe file type(1), owner permission(3), group permission, and permission for others. In the case of

 -rw-r--r--  1 root  wheel


File type: - means regular file.

Owner Permission: rw- means user root can read and write.

Group Permission: r-- means user(s) in group wheel can read only.

Others: r-- means user(s) not in group wheel can also read only.

So you don't have to read the rest to know there is not security risk for what the group is.

So what are the users in wheel, admin and staff?

$dscacheutil -q group -a name wheel; dscacheutil -q group -a name staff; dscacheutil -q group -a name admin


You get:

name: wheel
password: *
gid: 0
users: root 

name: staff
password: *
gid: 20
users: root 

name: admin
password: *
gid: 80
users: root YourUserNameHere


wheel is a legacy thing from UNIX. OS X never bothered to change it. When you sudo the file, sudo automatically use group staff. If you don't want the group name to change on the file, do:

sudo -g wheel defaults write /Library/Preferences/com.apple.alf globalstate -int 2