Description
public OutputStream getOutputStream() throws IOException { FsPermission fileperms = new FsPermission(BLOBSTORE_FILE_PERMISSION); try { out = fileSystem.create(path, (short) this.getMetadata().get_replication_factor()); fileSystem.setPermission(path, fileperms); fileSystem.setReplication(path, (short) this.getMetadata().get_replication_factor()); } catch (IOException e) { ...... out = fileSystem.create(path, (short) this.getMetadata().get_replication_factor()); fileSystem.setPermission(path, dirperms); fileSystem.setReplication(path, (short) this.getMetadata().get_replication_factor()); } ...... }
We can see that there are permission settings for path in both try and catch, but the permission in catch is different from that in try. In catch, the permission `dirperms` is given to the file. I think there is a problem here, and it should be the same as The permissions in try are consistent.
Permissions should be set according to the following code
public OutputStream getOutputStream() throws IOException { FsPermission fileperms = new FsPermission(BLOBSTORE_FILE_PERMISSION); try { out = fileSystem.create(path, (short) this.getMetadata().get_replication_factor()); fileSystem.setPermission(path, fileperms); fileSystem.setReplication(path, (short) this.getMetadata().get_replication_factor()); } catch (IOException e) { ...... out = fileSystem.create(path, (short) this.getMetadata().get_replication_factor()); fileSystem.setPermission(path, fileperms); fileSystem.setReplication(path, (short) this.getMetadata().get_replication_factor()); } ...... }