From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13569 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: Fri, 28 Dec 2018 17:00:36 -0500 Message-ID: <20181228220036.GQ23599@brightrain.aerifal.cx> References: <20181226122917.GD21289@port70.net> <20181226154719.GO23599@brightrain.aerifal.cx> 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 1546034325 16402 195.159.176.226 (28 Dec 2018 21:58:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2018 21:58:45 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13585-gllmg-musl=m.gmane.org@lists.openwall.com Fri Dec 28 22:58:41 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 1gd09Q-00048u-2M for gllmg-musl@m.gmane.org; Fri, 28 Dec 2018 22:58:40 +0100 Original-Received: (qmail 22147 invoked by uid 550); 28 Dec 2018 22:00:49 -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 22128 invoked from network); 28 Dec 2018 22:00:48 -0000 Content-Disposition: inline In-Reply-To: <20181226154719.GO23599@brightrain.aerifal.cx> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13569 Archived-At: On Wed, Dec 26, 2018 at 10:47:19AM -0500, Rich Felker wrote: > 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. Should be fixed in commit 9db81b862d95326d43af7c7fae9078ad9ff5bd6f with a related tweak in de7dc1318f493184b20f7661bc12b1829b957b67. Rich