From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH] libxl: Be more careful with error handling in libxl__dm_runas_helper() Date: Thu, 26 Nov 2015 10:26:29 +0000 Message-ID: <20151126102629.GI15747@citrix.com> References: <1448488569-3003-1-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1448488569-3003-1-git-send-email-boris.ostrovsky@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: wei.liu2@citrix.com, xen-devel@lists.xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, Nov 25, 2015 at 04:56:09PM -0500, Boris Ostrovsky wrote: > getpwnam_r() has fairly complicated return rules. From man pages: > > RETURN VALUE > ... > On success, getpwnam_r() and getpwuid_r() return zero, and set > *result to pwd. If no matching password record was found, these > functions return 0 and store NULL in *result. In case of error, > an error number is returned, and NULL is stored in *result. > ERRORS > 0 or ENOENT or ESRCH or EBADF or EPERM or ... > The given name or uid was not found. > This is Linux manpage. Actually http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwnam.html doesn't specify such behaviour. And FreeBSD doesn't share Linux's view either. Wei.