All pastes #11005 Raw Edit

Something

public text v1 · immutable
#11005 ·published 2005-05-05 02:33 UTC
rendered paste body
## trying to use screen on a remote server, and i find it only works as root
## so i used "strace screen" as root and non-root, then compared the results.
##
## i notice root seems to be able to readlink() just fine ('strace -e readlink screen' as root):
readlink("/proc/self/fd/0", "/dev/pts/15", 511) = 11
readlink("/proc/self/fd/0", "/dev/pts/15", 4095) = 11

## but not as uid 1000 (same command):
readlink("/proc/self/fd/0", 0xbfffdf1c, 511) = -1 EACCES (Permission denied)
readlink("/proc/self/fd/0", 0x80a6f18, 4095) = -1 EACCES (Permission denied)

## however, when i do 'strace -e readlink ls -l /proc/self/fd/0' it returns > 0
readlink("/proc/self/fd/0", "/dev/pts/9", 128) = 10