From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Goldstein Subject: Re: [PATCH v2 1/2] libxl: fix _SC_GETPW_R_SIZE_MAX usage Date: Thu, 14 Jan 2016 20:55:57 -0600 Message-ID: <56985FBD.5090806@cardoe.com> References: <1452784011-73931-1-git-send-email-roger.pau@citrix.com> <1452784011-73931-2-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5385755088090521037==" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aJuYY-00053X-6h for xen-devel@lists.xenproject.org; Fri, 15 Jan 2016 02:56:06 +0000 Received: by mail-qk0-f196.google.com with SMTP id e124so15478413qkc.3 for ; Thu, 14 Jan 2016 18:56:04 -0800 (PST) In-Reply-To: <1452784011-73931-2-git-send-email-roger.pau@citrix.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: Roger Pau Monne , xen-devel@lists.xenproject.org Cc: Ian Jackson , Wei Liu , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============5385755088090521037== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rt9GoK0ULT4pn9nahNx6h17SaGPnHSFas" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rt9GoK0ULT4pn9nahNx6h17SaGPnHSFas Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 1/14/16 9:06 AM, Roger Pau Monne wrote: > If sysconf(_SC_GETPW_R_SIZE_MAX) fails for any reason just use an initi= al > buffer size of 2048. This is not a critical failure, and the code that > makes use of this buffer is able to expand it later if required. >=20 > Signed-off-by: Roger Pau Monn=C3=A9 > --- > Cc: Ian Jackson > Cc: Stefano Stabellini > Cc: Ian Campbell > Cc: Wei Liu > --- > Changes since v1: > - Use a default buffer size if sysconf(_SC_GETPW_R_SIZE_MAX) fails for= any > reason, this should not be a critical failure. > --- > tools/libxl/libxl_dm.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 0aaefd9..a088d71 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -730,9 +730,10 @@ static int libxl__dm_runas_helper(libxl__gc *gc, c= onst char *username) > =20 > buf_size =3D sysconf(_SC_GETPW_R_SIZE_MAX); > if (buf_size < 0) { > - LOGE(ERROR, "sysconf(_SC_GETPW_R_SIZE_MAX) returned error %ld"= , > - buf_size); > - return ERROR_FAIL; > + buf_size =3D 2048; > + LOG(DEBUG, > +"sysconf(_SC_GETPW_R_SIZE_MAX) failed, setting the initial buffer size= to %ld", > + buf_size); > } > =20 > while (1) { >=20 Looks sane to me. Reviewed-by: Doug Goldstein --=20 Doug Goldstein --rt9GoK0ULT4pn9nahNx6h17SaGPnHSFas Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0 iQJ8BAEBCgBmBQJWmF/AXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNTM5MEQ2RTNFMTkyNzlCNzVDMzIwOTVB MkJDMDNEQzg3RUQxQkQ0AAoJEKK8A9yH7RvUhRAQAJW9EcIY3GTgVpsji/vT2iAK 3i67o8Ldz7fVdKvsQRM8QTq50oJ1X79QvuQpBDi9gAhUcTxf7paIND8glJX5xqy6 2At4zopNDtIlfXp1f3L1vo5IVq+222XEamFd/Z7HPNza2sQe23wFZycDJRVAxw7i O7RqINW72VBaqU8pR/aCL3ZmqGHcuIBgKWXxle9lCnuALeGMwPZeVmSvZq6W6rGK mA5Nxm2jxb5kJ/kgU8yGB3mjwbwwFYiBssyFnhvbC7COHMlh+mcxl+yyQ9c+j0/0 8cQ+wK/PjWEjXP7KOynU/YX1vCv50r1ItBnZRaCJqOajfSjhcoaFeRl/0uYgK5Ty 9yqd9S9d1BLKAmI9y//3elrFZH3+0211d8OtjQu4xH8lj1em/fN5tcZcEDREAUc3 lc077r27LjVIrGIVHQQoboasRqnT5HcDYjAjoeQ3DIv09KKudOCsyGvBe7SDS+D8 GqjHD2IgmL9cSnGrxd1GwppKHDFQltk7oum0pFI0XTNRSq+0z881TYSTRdXl+1sT vd3Zmvt0hDYD8fwbt1Vk3Mh3q7wmkl6Vi7IJlzGp80gvlKoH9rpVrNHqcy8qjSvJ 4+BlbqwaP2FTHc176RoeL0l+cck/3E2LRKEnSqdUN2fOg3XxEdZfHWFPC9G35l4U cq9A+gqFiKwgiqKx2QfP =9aUv -----END PGP SIGNATURE----- --rt9GoK0ULT4pn9nahNx6h17SaGPnHSFas-- --===============5385755088090521037== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5385755088090521037==--