int perm = value.getShort();
int id = value.getInt();
try {
boolean inPNS = true;
NodeMetadata m = null;
if(!config.isNonSharing()){
try {
m = namespace.getMetadata(path);
} catch (DirectoryServiceException e) {
inPNS = false;
}
}else{
inPNS=false;
}
if(!inPNS)
m = directoryService.getMetadata(path);
m.getStats().getXattr().put(name, buff);
LinkedList<Pair<String, String>> cannonicalIds=new LinkedList<Pair<String,String>>();
if(!config.isNonSharing()){
try{
List<String[]> l = directoryService.getCredentials(id);
for(String[] sx : l)
cannonicalIds.add(new Pair<String, String>(sx[0], sx[1]));
}catch (DirectoryServiceConnectionProblemException e){
System.err.println("DirectoryServiceConnectionProblemException - getCredential.");
}catch (DirectoryServiceException e){
System.err.println("DirectoryServiceException - getCredential.");
}
if(perm!=1){
if(perm == 4 || perm == 5){
daS.setPermition( m.getId_path(),"r", cannonicalIds);
updated=privateToPublic(path, m, id);
}else if(perm == 2 || perm == 3){
daS.setPermition( m.getId_path(),"w", cannonicalIds);
updated=privateToPublic(path, m, id);
}else if(perm == 0){
daS.setPermition( m.getId_path(),"", cannonicalIds);
if(!m.getStats().isPrivate())
updated=publicToPrivate(path, m, id);
}else{
daS.setPermition( m.getId_path(), "rw",cannonicalIds);
updated=privateToPublic(path, m, id);
}
}else{
daS.setPermition( m.getId_path(),"",cannonicalIds);
updated=publicToPrivate(path, m, id);
}
}
if(!updated){