Skip to content

OS_chmod is requiring read access  #650

@zanzaben

Description

@zanzaben

Describe the bug
If you don't have read access to a file then OS_chmod will not be able to change it. This is most likely caused by chmod opening the file as a way to avoid filename race potential, see the code snip.

To Reproduce

  1. Set the file access to write only.
  2. Try to change the access using OS_chmod
  3. will get an OS_ERROR

Expected behavior
You should be able to change the permissions of a file without read access.

Code snips

/* Open file to avoid filename race potential */
fd = open(local_path, O_RDONLY);
if (fd < 0)
{
return OS_ERROR;
}

System observed on:
Ubuntu 20.04

Reporter Info
Alex Campbell GSFC

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions