From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13566 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: getspnam: errno=ENOENT for absent user Date: Wed, 26 Dec 2018 10:47:19 -0500 Message-ID: <20181226154719.GO23599@brightrain.aerifal.cx> References: <20181226122917.GD21289@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1545839128 5377 195.159.176.226 (26 Dec 2018 15:45:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Dec 2018 15:45:28 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Philippe =?utf-8?B?R3LDqWdvaXJl?= To: musl@lists.openwall.com Original-X-From: musl-return-13582-gllmg-musl=m.gmane.org@lists.openwall.com Wed Dec 26 16:45:24 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gcBN5-0001Ie-NN for gllmg-musl@m.gmane.org; Wed, 26 Dec 2018 16:45:23 +0100 Original-Received: (qmail 1845 invoked by uid 550); 26 Dec 2018 15:47:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 1797 invoked from network); 26 Dec 2018 15:47:31 -0000 Content-Disposition: inline In-Reply-To: <20181226122917.GD21289@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13566 Archived-At: On Wed, Dec 26, 2018 at 01:29:17PM +0100, Szabolcs Nagy wrote: > * Philippe Grégoire [2018-12-25 17:07:14 -0500]: > > 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? > > based on > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwnam.html > "If the requested entry was not found, errno shall not be changed." > > this should be fixed in musl. Thanks for checking this. I'll write and commit a fix. Rich