mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-12 11:35:21 +02:00
Mark directories that are not executable as not writable, to be in sync with java.io.File (see also bug 154302)
This commit is contained in:
parent
d60ee146aa
commit
edd7b91887
1 changed files with 8 additions and 2 deletions
|
@ -292,8 +292,14 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
||||||
if (perms.indexOf('w',1)<=0) {
|
if (perms.indexOf('w',1)<=0) {
|
||||||
node.setWritable(false); //not writable by anyone
|
node.setWritable(false); //not writable by anyone
|
||||||
}
|
}
|
||||||
if (perms.indexOf('x',1)>0) {
|
if (node.isDirectory()) {
|
||||||
node.setExecutable(true); //executable by someone
|
if (perms.indexOf('x',1)<=0) {
|
||||||
|
node.setWritable(false); //directories that are not executable are also not readable
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (perms.indexOf('x',1)>0) {
|
||||||
|
node.setExecutable(true); //executable by someone
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (attrs.getExtended()!=null) {
|
if (attrs.getExtended()!=null) {
|
||||||
node.setExtendedData(attrs.getExtended());
|
node.setExtendedData(attrs.getExtended());
|
||||||
|
|
Loading…
Add table
Reference in a new issue