lkml.org 
[lkml]   [1996]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: How does chown(2) works with symlinks?
    Date
    >>         fd = open(...);
    >> fchown(fd,..);
    >>
    >> which should always work the way you expect.
    >
    >So long as you can open the file. Its possible you want to chown a file
    >you own
    >but can't open, and if chmod is consistent with chown (which I certainly
    >hope
    >is the case), you won't be able to chmod it before trying to open it.

    Hello? Are we talking about the same operating system here? Who do
    you think is allowed to change ownership of an inode? -- don't all
    shout at once.

    Admittedly POSIX.6 will make a difference to this, but it's hardly
    insurmountable.

    >It might be reasonable behaviour if there were ever a need to change the
    >owner
    >of a symlink. However, seeing as a symlink is a mere loophole in the
    >namespace
    >and has no function in itself, the owner, like its mode, is completely
    >irrelevent.

    symlink("/", "/tmp/symlink"). Now who can unlink("/tmp/symlink")?

    >It seems to me that not following symlinks will be more surprising than
    >following
    >them, and therefore more likely to open holes.

    It seems the reverse to me. Consider, for example, "chown -R
    luser.users /home/luser", after it's been restored from tape. What
    happens to the symlink to /etc/passwd that the user happens to have?
    For what purposes do you call chown(2) anyway?

    Please try to format text to lines of between about 50 and 70 columns
    each.

    -zefram


    \
     
     \ /
      Last update: 2005-03-22 13:37    [W:2.764 / U:0.336 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site