1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +02:00

[246234] Change of file permissions changes the file owner

This commit is contained in:
David McKnight 2008-09-04 18:37:07 +00:00
parent 076f019680
commit bd849bd10b

View file

@ -1970,15 +1970,10 @@ public class UniversalFileSystemMiner extends Miner {
String result = simpleShellCommand("chmod " + permAttributes[0], file); //$NON-NLS-1$
String previousGroup = getFilePermission(file, PERMISSION_GROUP);
if (!previousGroup.equals(permAttributes[2])){
// set the group
simpleShellCommand("chown :" + permAttributes[2], file); //$NON-NLS-1$
}
String previousUser = getFilePermission(file, PERMISSION_OWNER);
if (!previousUser.equals(permAttributes[1])){
// set the user
simpleShellCommand("chown " + permAttributes[1], file); //$NON-NLS-1$
if (!previousUser.equals(permAttributes[1]) || !previousGroup.equals(permAttributes[2])){
// set the user and group at once
simpleShellCommand("chown " + permAttributes[1] + ":" + permAttributes[2], file); //$NON-NLS-1$
}