mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
[246234] Change of file permissions changes the file owner
This commit is contained in:
parent
076f019680
commit
bd849bd10b
1 changed files with 3 additions and 8 deletions
|
@ -1970,15 +1970,10 @@ public class UniversalFileSystemMiner extends Miner {
|
||||||
String result = simpleShellCommand("chmod " + permAttributes[0], file); //$NON-NLS-1$
|
String result = simpleShellCommand("chmod " + permAttributes[0], file); //$NON-NLS-1$
|
||||||
|
|
||||||
String previousGroup = getFilePermission(file, PERMISSION_GROUP);
|
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);
|
String previousUser = getFilePermission(file, PERMISSION_OWNER);
|
||||||
if (!previousUser.equals(permAttributes[1])){
|
if (!previousUser.equals(permAttributes[1]) || !previousGroup.equals(permAttributes[2])){
|
||||||
// set the user
|
// set the user and group at once
|
||||||
simpleShellCommand("chown " + permAttributes[1], file); //$NON-NLS-1$
|
simpleShellCommand("chown " + permAttributes[1] + ":" + permAttributes[2], file); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue