Bug 123237 - cpio is broken on some non-glibc systems due to an unexistent stpcpy function
Bug#: 123237 Product:  Gentoo/Alt Version: unspecified Platform: All
OS/Version: Other Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: base-system@gentoo.org Reported By: bbj@gentoo.org
Component: Other
URL: 
Summary: cpio is broken on some non-glibc systems due to an unexistent stpcpy function
Keywords:  
Status Whiteboard: 
Opened: 2006-02-18 00:36 0000
Description:   Opened: 2006-02-18 00:36 0000
NetBSD has no such stpcpy function. I created a patch to fix this on systems
that have no stpcpy.

The patch must be applied after all the patches (especially after
cpio-2.6-writeOutHeaderBufferOverflow.patch from #112140).

------- Comment #1 From Benigno B. Junior (RETIRED) 2006-02-18 00:37:00 0000 -------
Created an attachment (id=80068) [details]
cpio-2.6-bsd.patch

There goes the patch.

------- Comment #2 From Robert Sebastian Gerus 2006-02-18 00:46:46 0000 -------
Compiled on DragonFly with this patch. Failed without it.

------- Comment #3 From Karol Pasternak (RETIRED) 2006-02-18 02:09:16 0000 -------
On OpenBSD too,
base-system, please apply this patch.

------- Comment #4 From Diego E. 'Flameeyes' Pettenò 2006-02-18 03:56:48 0000 -------
Going to commit in overlay in the mean time.

Oh it needs an AT_M4DIR="m4" eautoreconf as it changes configure.ac, but it
works otherwise.

Benigno, did you send it to upstream already?

------- Comment #5 From Benigno B. Junior (RETIRED) 2006-02-18 04:32:00 0000 -------
Yes, I just sent him a notification of this patch and the one from #112140,
because this patch depends on cpio-2.6-writeOutHeaderBufferOverflow.patch.
Thanks for adding it.

------- Comment #6 From SpanKY 2006-02-18 11:31:56 0000 -------
i dont think that's the right fix at all

cpio already has a lib subdir for functions that the host doesnt support, you
should be putting stpcpy.c in there like the other stuff and then updating
AC_REPLACE_FUNCS

------- Comment #7 From Diego E. 'Flameeyes' Pettenò 2006-02-18 11:41:32 0000 -------
Uh that's gnulib stuff... it's quite difficult to patch it out, this solution
works with the least changes. And it's already fixed upstream in next version.

------- Comment #8 From SpanKY 2006-02-18 11:56:10 0000 -------
i wasnt talking about the source tarball but about the upstream repo ... the
patch posted is not correct for upstream

but they've committed a fix upstream that involves pulling in stpcpy from
gnulib

------- Comment #9 From Benigno B. Junior (RETIRED) 2006-02-18 12:53:01 0000 -------
This replacing is not wrong. If this stpcpy implementation used by gnulib is
something like this, I would say that this patch "cpio-2.6-bsd.patch" is better
than it:
http://cvs.savannah.nongnu.org/viewcvs/bison/bison/lib/Attic/stpcpy.c?view=markup

Btw, the problem seems to be finished, and that's very good. :)

------- Comment #10 From SpanKY 2006-02-18 13:31:49 0000 -------
> This replacing is not wrong.

it is wrong for upstream ... but it's a non issue since it's been fixed
correctly in upstream cpio cvs

------- Comment #11 From SpanKY 2006-02-18 13:47:49 0000 -------
added a revised version of this patch to cvs