[lkml]   [1996]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Glitch in sys_chroot()

    On Thu, 14 Nov 1996, Elliot Lee wrote:

    > I still think that Linux should do the chdir() before the chroot(). If you
    > can provide a reason why - besides "because that's the way it has been
    > done" - I'd say you have a valid point. Until then I remain unconvinced,
    > because of the possible security concerns from lax programming.

    I don't think chroot() should do a chdir(). Why? Simply because chroot()
    is chroot() and chdir() is chdir(). Keep it simple.

    What if the current directory is, say, /usr/foo/bar/baz and you do a
    chroot("/usr/foo"). Should the chroot() do a chdir("/usr/foo") then also?
    I don't think so. This would definitely break a lot of old code.

    The semantics could of course be changed so that the chdir() is done if
    the current directory is outside the new root, but I think that would
    unneccesarily complicate both the semantics and the code.

    Johan Myreen

     \ /
      Last update: 2005-03-22 13:38    [W:0.016 / U:14.020 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site