This may or may not be a bug, depending on whether or not pledging non-cosmopolitan binaries (i.e. /usr/bin/ls) is supported. The cosmopolitan ls works as expected.
I was testing out pledge with ls and I noticed the following.
./pledge -v r:$HOME/Downloads/bin -p 'stdio rpath' ls -lah displays permission errors and lists files.
./pledge -k -v r:$HOME/Downloads/bin -p 'stdio rpath' ls -lah fails with a 'Bad system call' (-k flag) (it kills on EPERM, which makes sense)
The permissions in the directory are r-x, and contain the cosmopolitan binaries. The output of both commands with --ftrace look identical (other than additional output including the permission errors and list of files)
Additional info:
The coredump with -k shows:
Program terminated with signal SIGSYS, Bad system call.
#0 ... in tcgetattr () from /usr/lib/libc.so.6
Adding tty to the pledge list, and rerunning, produces a coredump with:
Program terminated with signal SIGSYS, Bad system call.
#0 ... in listxattr () from /usr/lib/libc.so.6
Finally, adding fattr to the pledge list still produces the bad system call error when listxattr is called.
Version
Cosompolitan Pledge v1.9
/usr/bin/ls --version
ls (GNU coreutils) 9.5
What operating system are you seeing the problem on?
What happened?
Hello,
This may or may not be a bug, depending on whether or not pledging non-cosmopolitan binaries (i.e.
/usr/bin/ls
) is supported. The cosmopolitanls
works as expected.I was testing out
pledge
withls
and I noticed the following../pledge -v r:$HOME/Downloads/bin -p 'stdio rpath' ls -lah
displays permission errors and lists files../pledge -k -v r:$HOME/Downloads/bin -p 'stdio rpath' ls -lah
fails with a 'Bad system call' (-k flag) (it kills on EPERM, which makes sense)The permissions in the directory are
r-x
, and contain the cosmopolitan binaries. The output of both commands with--ftrace
look identical (other than additional output including the permission errors and list of files)Additional info:
The coredump with
-k
shows:Adding
tty
to the pledge list, and rerunning, produces a coredump with:Finally, adding
fattr
to the pledge list still produces the bad system call error whenlistxattr
is called.Version
Cosompolitan Pledge v1.9
/usr/bin/ls --version ls (GNU coreutils) 9.5
What operating system are you seeing the problem on?
Linux
Relevant log output