Jailkit Patches to Fix RHEL getgrgid() and getpwuid() Bug
I just downloaded the latest version of jailkit (version 1.3-1) from Dag Wieer’s repository. Apparently when I installed it in my RHEL 4.0 x86_64 system, it does not work. I get the error “uid %d or gid %d does not have a name”. I checked and double-checked the installation but everything was fine. I started debugging and realized that getpwuid() and getgrgid() in RHEL under a jailed environment does not work as advertised. So, I wrote a patch that uses looped fgetgrent() and fgetpwent() instead.
Here is the patch:
Here are the RPMs:
- http://cng.ateneo.edu/cng/wyu/software/rpm/jailkit-1.3-2.rf.i386.rpm
- http://cng.ateneo.edu/cng/wyu/software/rpm/jailkit-1.3-2.rf.x86_64.rpm
- http://cng.ateneo.edu/cng/wyu/software/srpm/jailkit-1.3-2.rf.src.rpm
I emailed the jailkit maintainer already. But, in the meantime, here are the patches. Hope this helps!

August 2nd, 2006 at 10:07 pm
We found another bug in x86_64 jailkit. It seems that the jailkit scripts do not create the /usr/lib64 directory inside the jailkit causing all sorts of weird problems. After creating the jail directory, just don’t forget to do a ‘mkdir $JAILDIR/usr/lib64′. Let;s just call this “Missing lib64 directory in jail directory” bug solved.