...
Code Block | ||
---|---|---|
| ||
... int fd = open(file_name, O_CREAT | O_WRONLY); /* access permissions are missing */ if (fd == -1){ /* Handle Error */ } ... |
Compliant Solution:
...
open()
...
(POSIX)
Access permissions for the newly created file should be specified in the third parameter to open()
. Again, the permissions may be influenced by the value of umask()
.
...