[OpenAFS-devel] solaris 10: chdir("/") after chroot(path) returns ENOENT

Tony D'Amato tdamato@odu.edu
Tue, 08 Jun 2010 10:53:40 -0400


-------- Original Message --------
Subject: Re: [OpenAFS-devel] solaris 10: chdir("/") after chroot(path) 
returns ENOENT
From: Derek Atkins <warlord@MIT.EDU>
To: D'Amato, Tony <tdamato@odu.edu>
Date: 06/08/2010 10:36 AM

> "Tony D'Amato"<tdamato@odu.edu>  writes:
>
>> int main(void)
>> {
>> chdir(PATH);
>> chroot(PATH);
>> chdir("/");
>> chdir("/pub");
>> }
>> --end--
>>
>> I've been scratching my head over this one. Let me know if I can
>> provide any traces and/or dumps that can help troubleshoot
>> this... Thanks!
>
> What if you chdir("/pub"); chdir("/");  ?

Same thing - chdir("/pub") works, but chdir("/") fails with ENOENT. 
Here's part of a sanitized truss:

3002:   chdir("/afs/PATH/ftp")             = 0
3002:   chroot("/afs/PATH/ftp")            = 0
3002:   chdir("/pub")                      = 0
3002:   chdir("/")                         Err#2 ENOENT

-- 
Tony D'Amato, SCSA
Senior UNIX Systems Administrator
Server Support Group
Office of Computing and Communications Services
Old Dominion University