X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 2A884DC0169 for ; Mon, 30 Jun 2014 04:34:52 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id y10so7468414pdj.8 for ; Sun, 29 Jun 2014 21:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Qt0yHe1WvXN+iRb24gHTaoEoETH3iA6Obh9ceClApJ0=; b=cStWUCF60nUNVaMBlW3p0/2Moal0g+me9uSIIGelFw5YENof3SjWcPKw1RjXq/rn/n 29ai1bxTu0RY+PjpYwPKXHBbCJtBM7q7pnM1uJibMVVqc1kuM6YLuLbcu2tg46G/BYT6 N0U0Iw6GofG6ll9raY0IIPMP8Lhj56GuAC1E4u+zkkUBJQhgGcd9KpKIGw6DE94WGXUK nbMB2wak/CppLihaz+cKZYQQhiF92aTYGY30ynAyrknTjjfcUshxNOP4ey3+iV0VHrqn KbUN1lkwAOAp8zuEZi28bj3xuqI6w97Az3+bX4uanhAhiCtoYt6VmCIKKYtnU7kAZ4Ed 6kLA== X-Received: by 10.68.254.103 with SMTP id ah7mr49280563pbd.159.1404102890477; Sun, 29 Jun 2014 21:34:50 -0700 (PDT) Received: from newbook ([50.0.227.219]) by mx.google.com with ESMTPSA id i10sm93023433pat.36.2014.06.29.21.34.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jun 2014 21:34:49 -0700 (PDT) Date: Sun, 29 Jun 2014 21:35:13 -0700 From: Isaac Dunham To: musl@lists.openwall.com Cc: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] Re: [musl] cups debugging, continued Message-ID: <20140630043512.GB16088@newbook> References: <20140629194829.GA1994@newbook> <20140630001201.GA14838@newbook> <20140630012830.GA16088@newbook> <20140630020311.GD179@brightrain.aerifal.cx> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140630020311.GD179@brightrain.aerifal.cx> User-Agent: Mutt/1.5.23 (2014-03-12) On Sun, Jun 29, 2014 at 10:03:11PM -0400, Rich Felker wrote: > On Sun, Jun 29, 2014 at 06:28:31PM -0700, Isaac Dunham wrote: > > On Sun, Jun 29, 2014 at 05:12:01PM -0700, Isaac Dunham wrote: > > > Now I hit the next issue: the 'lpd' backend reports > > > 'Unable to reserve port: Invalid argument' > > > And I need to figure out what's causing this--or rather, what the solution is. > > > Right now, I'm stuck (lpd is the main way to access it, and it isn't working). > > OK, now we're in cups-1.7.3/backend/lpd.c: > > > > ....the problem is a local implementation of rresvport_af(), trying to reserve > > a port but failing. > > > > And strace -p `pidof lpd` says this: > > Process 16113 attached > > restart_syscall(<... resuming interrupted call ...>) = 0 > > geteuid32() = 0 > > socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 7 > > bind(7, {sa_family=AF_INET, sin_port=htons(905), sin_addr=inet_addr("0.0.0.0")}, 256) = -1 EINVAL (Invalid argument) > > Where did the value of 256 for socklen_t come from? That's almost > surely the cause of the EINVAL. sockaddr_in should have a length of > 16, not 256. Apparently this: if (!bind(fd, (struct sockaddr *)&addr, sizeof(addr))) return (fd); addr is of type http_addr_t, defined in cups/http.h thus: typedef union _http_addr_u /**** Socket address union, which **** makes using IPv6 and other **** address types easier and **** more portable. @since CUPS 1.2/OS X 10.5@ ****/ { struct sockaddr addr; /* Base structure for family value */ struct sockaddr_in ipv4; /* IPv4 address */ #ifdef AF_INET6 struct sockaddr_in6 ipv6; /* IPv6 address */ #endif /* AF_INET6 */ #ifdef AF_LOCAL struct sockaddr_un un; /* Domain socket file */ #endif /* AF_LOCAL */ char pad[256]; /* Padding to ensure binary compatibility */ } http_addr_t; I'm not sure how to handle this. Thanks, Isaac Dunham --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---