On Mon, Dec 08, 2014 at 08:27:07PM -0800, Michael Forney wrote:
> When you lstat "foo/", where foo is a symlink to a directory, you look
> up information about the directory, not the symlink.
> [...]
>
> See, this example (pruned for the system calls that matter)
>
> $ strace ls -l foo
> lstat("foo", {st_mode=S_IFLNK|0777, st_size=3, ...}) = 0
> stat("foo", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
> lrwxrwxrwx    1 michael  michael           3 Dec 09 20:22 foo -> bar
> $ strace ls -l foo/
> lstat("foo/", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
> -rw-------    1 michael  michael           0 Dec 09 20:23 hello
> -rw-------    1 michael  michael           0 Dec 09 20:23 world

I see, thanks. I didn't realize that the syscalls handled arguments with
slashes differently and thought it was handled at the application-level.

Eric

PS -- You can filter for certain syscalls by using the -e option of
strace e.g. strace -e lstat ...

Reply via email to