Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Oct 2001 05:36:21 -0700 (PDT)
From:      Ruben de Groot <rdg_root@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   pwd returns absolute path when inside jail
Message-ID:  <20011019123621.72155.qmail@web12307.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi all,

I'm not sure if this question belongs in -questions (maybe -hackers?). Anyway,
here it is:

I've been setting up jails on one of my machines like this:

- made world with DESTDIR=/home/jailer/jail etcetera, following jail(8)
- created directories /jails/jail1 ... /jails/jailx
- copied /home/jailer/jail/dev, etc and var to each of the /jails/jail(x)
directories
- removed dev, etc, var from /home/jailer/jail

After this I can start any of the jails with the following script:

#!/bin/sh
ifconfig fxp0 192.168.10.$1 alias
mount -t null -o rdonly,union /home/jailer/jail /jails/jail$1
mount -t procfs proc /jails/jail$1/proc
jail /jails/jail$i host$1 192.168.0.$1 /bin/sh /etc/rc

This is working fine. I can login to any of the jails and can only see
processes and files inside the jail. What I don't like is the following:

<inside jail>

%cd /
%pwd
/
%cd /usr
%pwd
/usr
%cd /etc
%pwd
/jails/jail1/etc
%cd /jails/jail1/etc
/jails/jail1/etc: No such file or directory.


This happens also for /dev and /var, but not for the directories (like /usr,
/bin ) that were union-mounted on the jail.

Is this a bug? If not, can anyone explain this behaviour?

Thanks.


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011019123621.72155.qmail>