Posts

Post not yet marked as solved
1 Replies
402 Views
Using Catalina 10.15.2 and 10.5.3 it is not possible to create a file if the path is relative and traverses a root directory that is also symlinked. This includes: /etc, /home, /var, and /tmp. It is not reproducible on directories that are not symlinks or root mounts (created using /etc/synthetic.conf), i.e '/User' works correctly.This was discovered when using the AWS CLI command to copy a file, the destination of the copy is a relative path from the current working directory.Steps to Reproduce:In terminal:$ pwd /Users/dillon $ touch ../../tmp/a.txt touch: ../../tmp/a.txt: No such file or directory $ touch /tmp/b.txt # works fineSimple C program:#include <fcntl.h> #include <unistd.h> int main(int argc, char** argv){ if(argc != 2){ return 1; } int filedesc = open(argv[1], O_CREAT); if(filedesc < 0){ return 1; } return close(filedesc); }
Posted
by _dillon.
Last updated
.