Project

General

Profile

Actions

Backport #6831

closed

test_getpwuid() on Mountain Lion

Added by kosaki (Motohiro KOSAKI) over 12 years ago. Updated about 12 years ago.

Status:
Closed
[ruby-core:46975]

Description

When using Mountain Lion, following test failure occur.

  1. Failure:
    test_getpwuid(TestEtc) [/ruby/git/test/etc/test_etc.rb:34]:
    <#<struct Struct::Passwd
    name="_appleevents",
    passwd="",
    uid=55,
    gid=55,
    gecos="AppleEvents Daemon",
    dir="/var/empty",
    shell="/usr/bin/false",
    change=0,
    uclass="",
    expire=0>> expected but was
    <#<struct Struct::Passwd
    name="_pcastagent",
    passwd="
    ",
    uid=55,
    gid=55,
    gecos="Podcast Producer Agent",
    dir="/var/pcast/agent",
    shell="/usr/bin/false",
    change=0,
    uclass="",
    expire=0>>.

getpwent() of Mountain Lion seems buggy. see below:

test_getpwent.c

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

int main(void)
{
struct passwd *ent;

while((ent = getpwent()) != NULL) {
if (ent->pw_uid == 55)
printf("%s:%d:%s\n", ent->pw_name, ent->pw_uid, ent->pw_gecos);
}

return 0;
}

result

_appleevents:55:AppleEvents Daemon
_pcastagent:55:Podcast Producer Agent

mrkn, what do you think?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0