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:

I emailed the jailkit maintainer already. But, in the meantime, here are the patches. Hope this helps!

One Response to “Jailkit Patches to Fix RHEL getgrgid() and getpwuid() Bug”

  1. wyuwp Says:

    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.

Leave a Reply