handling of 'use chroot'

Martin Pool mbp at samba.org
Sat Sep 1 09:39:15 EST 2001

On 31 Aug 2001, "John E. Malmberg" <malmberg at Encompasserve.org> wrote:
> The OpenVMS C runtime support currently does not have a chroot().

That's fine.  Although at the moment there is no configure test for
chroot, there certainly could be in the future.  We have tests for
other unixy features, such as hardlinks, and we do our best on
platforms like NT that don't have them.

In fact, perhaps we should go ahead and test for chroot now, since at
the moment I think one of the quirks of installing rsync on NT is that
you must always set 'use chroot = no'.

> It lists the function as LEGACY implying that it should not be used in
> new code.  It also states that "There is no portable use that an
> application can make of this interface."

Aw :-(.  chroot is cool.

On the other hand it is in the Linux Standard Base, which shows at
least one standards body likes it.

> The concept of a single root directory does not exist on OpenVMS.
> As such, the chroot() function does not mean anything more than chdir().

> The concept of a single root directory does not exist on OpenVMS.
> As such I have been aliasing chroot() to just be chdir() just to get
> rid of the "no chroot" diagnostics.

Well, the difference is that you can think of chroot stacked under
future chdir calls, so simply substituing chdir for chroot will not
quite work.

For example: after calling chdir(/mnt/sda1), then chroot(/home/mbp)
puts me in the directory that is "really" /mnt/sda1/home/mbp.

The push_dir functions in rsync allow us to fake this when not running
as root, and I think you should work from them too.  I don't know a
lot about directories on VMS, though.


More information about the rsync mailing list