Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b43e36e4f5b4d375342c848e6305f0d5@pgregoire.xyz>
Date: Tue, 25 Dec 2018 17:07:14 -0500
From: Philippe Grégoire <pg@...egoire.xyz>
To: musl@...ts.openwall.com
Subject: getspnam: errno=ENOENT for absent user

Hi,

I'm working with saltstack on Alpine Linux and am getting trouble
managing users. I tracked the problem down to musl and the fact
that getspnam sets errno to ENOENT when a user is missing. This
behavior differs from glibc which leaves errno to 0 and makes
the user relies on the return value; when the name is missing.

Semantically, ENOENT makes sense, but this is breaking compatibility
with other softwares, at the moment. I'll send a patch over to
saltstack so that current systems are supported, but believe it
should be fixed here too for future compatibility. What do you think?

Please, Cc me for reply as I'm not subscribed.


Program to demonstrate the issue:

#include <errno.h>
#include <shadow.h>
#include <stdio.h>
int main(void)
{
         errno = 0;
         void* r = getspnam("enoent);
         perror("getspnam");
         printf("%p\n", r);
}

On Debian:
getspnam: Success
(nil)

On Alpine:
getspnam: No such file or directory
0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.