** Also affects: ecryptfs-utils (Ubuntu)
   Importance: Undecided
       Status: New

** Also affects: linux (Ubuntu)
   Importance: Undecided
       Status: New

-- 
getpwuid fails silently when run as root inside of mlockall()
https://bugs.launchpad.net/bugs/329264
You received this bug notification because you are a member of eCryptfs,
which is subscribed to ecryptfs-utils in ubuntu.

Status in “ecryptfs-utils” source package in Ubuntu: New
Status in “glibc” source package in Ubuntu: Confirmed
Status in “linux” source package in Ubuntu: New

Bug description:
Use this test program

#include <pwd.h>
#include <stdio.h>
#include <errno.h>
#include <sys/mman.h>
int main() {
    struct passwd *pw = NULL;
    uid_t id;
    if (mlockall(MCL_FUTURE)<0) {
        perror("mlockall");
        return 1;
    }
    id = getuid();
    pw = getpwuid(id);
    if (pw == NULL) {
        perror("getpwuid");
        return errno;
    }
    printf("[%s]\n", pw->pw_name);
    return 0;
}

Build on Intrepid, and on Jaunty.

Run as root and non-root.

r...@jaunty:
getpwuid: Success

kirkl...@jaunty:
getpwuid: Resource temporarily unavailable

r...@intrepid:
[root]

kirkl...@intrepid:
getpwuid: Resource temporarily unavailable



Running this program as root on intrepid used to work.  It does not in Jaunty.  
Additionally, errno is not set.

This regression is breaking mount.ecryptfs, which does a getpwuid() inside of 
just such an mlock.

:-Dustin

_______________________________________________
Mailing list: https://launchpad.net/~ecryptfs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ecryptfs
More help   : https://help.launchpad.net/ListHelp

Reply via email to