From owner-freebsd-ports Mon Aug 5 7:17:55 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0EC7437B401 for ; Mon, 5 Aug 2002 07:17:48 -0700 (PDT) Received: from creme-brulee.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BE2643E77 for ; Mon, 5 Aug 2002 07:17:47 -0700 (PDT) (envelope-from marcus@marcuscom.com) Received: from [10.2.1.0] (vpn-client-0.marcuscom.com [10.2.1.0]) by creme-brulee.marcuscom.com (8.12.5/8.12.5) with ESMTP id g75EHbEF012231; Mon, 5 Aug 2002 10:17:37 -0400 (EDT) (envelope-from marcus@marcuscom.com) Subject: Re: [comp.unix.bsd.freebsd.misc] Problems building certain ports From: Joe Marcus Clarke To: Mark Evenson Cc: ports@FreeBSD.ORG In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-7dFpEIHK37tyvy2NzjiH" X-Mailer: Ximian Evolution 1.0.8 Date: 05 Aug 2002 10:17:13 -0400 Message-Id: <1028557033.318.35.camel@gyros.marcuscom.com> Mime-Version: 1.0 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --=-7dFpEIHK37tyvy2NzjiH Content-Type: text/plain Content-Transfer-Encoding: 7bit On Mon, 2002-08-05 at 09:27, Mark Evenson wrote: > From: Mark Evenson > Subject: Problems building certain ports > Date: 05 Aug 2002 09:21:39 -0400 > > I have been having a problem building ports depending on the "in place" > features of sed: > > quid:/usr/ports/lang/guile$ make > ===> Extracting for guile-1.4.1_2 > >> Checksum OK for guile-1.4.1.tar.gz. > ===> guile-1.4.1_2 depends on executable: libtool - found > ===> guile-1.4.1_2 depends on shared library: ltdl.1 - found > ===> Patching for guile-1.4.1_2 > ===> Applying FreeBSD patches for guile-1.4.1_2 > sed: stdout: Bad file descriptor > *** Error code 1 > > Stop in /usr/ports/lang/guile. > > I have read what I could find about others having a similar problem, but it > seems that I am experiencing something different. My system is a freshly > built STABLE-20020722, and my ports tree is also current, which should get > me around the problems I have been able to find by searching the FreeBSD mailing > list archives about not having the version of sed installed that takes the > "-i" argument. > > The one thing I did notice was that if I run the same command as root, it > succeeds, which lead me to suspect that I was running into some sort of > "limits" like restriction. No amount of fooling with "limits", "ulimits", > and the 'login.conf' database seems to allow me to get the port to compile > as a regular user, so I have more or less given up on this line of thinking > (unless root can *always* use as much resources as it needs regardless of > the various settings of limits). Also for the guile port, only some 105 > files are passed to the "xargs sed ..." part of the command, which if > invoked "manually" (i.e. by cutting and pasting the arguments to sed rather > than using xargs) succeeds, so it seems more like there is some bad > interaction between 'xargs' and 'sed' here. > > Can anyone shed some light on this problem? This has to do with the permissions on the files being worked on by sed. You'll note for the guile, they're all 444. During in-place editing, sed reopens stdout to be the output filename. It never checks to see if this succeeds. Therefore, the error perpetuates until it tries to close a file descriptor that isn't open. I'm not sure what the correct fix is here. Certainly, we could modify sed to do a chmod before reopening stdout to add write permissions for the owner. The attached patch does just that. Joe > > Thanks, > Mark > > ---- > > > > -- > Mark Evenson > > "A screaming comes across the sky. It has happened before, but there is > nothing to compare to it now." -- PGP Key : http://www.marcuscom.com/pgp.asc --=-7dFpEIHK37tyvy2NzjiH Content-Disposition: attachment; filename=main.c.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=main.c.diff; charset=ISO8859-1 --- usr.bin/sed/main.c.orig Mon Aug 5 10:16:06 2002 +++ usr.bin/sed/main.c Mon Aug 5 10:16:26 2002 @@ -424,6 +424,9 @@ return -1; } =20 + /* Make sure the file is writeable */ + chmod(*filename, orig.st_mode | S_IWUSR); + if (*inplace =3D=3D '\0') { char template[] =3D "/tmp/sed.XXXXXXXXXX"; =20 --=-7dFpEIHK37tyvy2NzjiH-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message