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

Tony D'Amato tdamato@odu.edu
Tue, 08 Jun 2010 09:20:51 -0400


[submitted to openafs-bugs yesterday, Jun 7 - ticket #127356]

While setting up a FTP server on a Solaris 10 x86 machine running 
OpenAFS 1.4.12 with the FTP server's root
in OpenAFS space, I ran into the following problem: The FTP server 
issues the three calls to lock the user into the FTP root:

chdir(AFS_PATH);
chroot(AFS_PATH);
chdir("/");

The problem is that the third call (chdir("/")) returns a ENOENT error.

I've been able to reproduce this with the following code (replacing the 
full path with AFSSITE) on Solaris 8 and Solaris 10 clients running 
OpenAFS 1.4.12. On Solaris 8, chdir("/") changes the directory to the 
proper path and returns a zero success code, but on Solaris 10, 
chdir("/") fails to change directory and returns a ENOENT. On both 
Solaris 8 and 10, the chdir("/pub") changes directory and returns a zero 
return code.

--begin--
#define PATH "/afs/AFSSITE/ftp"

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

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!
-- 
Tony D'Amato, SCSA
Senior UNIX Systems Administrator
Server Support Group
Office of Computing and Communications Services
Old Dominion University