Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#550611: please use libbsd instead of glib for strlcpy

45 views
Skip to first unread message

Thorsten Glaser

unread,
Oct 11, 2009, 6:56:54 PM10/11/09
to
Package: netcat-openbsd
Severity: wishlist

Please link against libbsd, now that it has been available in stable
for quite a while, instead of glib.

Some day, libbsd may get upped to important (I hope), so that this
can replace netcat-traditional and netcat6 at once. It’s also much
more lightweight a dependency AND the “original source” of strlcpy
and friends AND will probably require a much smaller patch only.


-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-6-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/mksh

Versions of packages netcat-openbsd depends on:
ii libc6 2.9-27 GNU C Library: Shared libraries
ii libglib2.0-0 2.22.2-2 The GLib library of C routines

netcat-openbsd recommends no packages.

netcat-openbsd suggests no packages.

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Guillem Jover

unread,
Jan 11, 2010, 6:10:03 PM1/11/10
to
tag 550611 patch
thanks

Hi!

On Sun, 2009-10-11 at 15:12:02 +0000, Thorsten Glaser wrote:
> Package: netcat-openbsd
> Severity: wishlist
>
> Please link against libbsd, now that it has been available in stable
> for quite a while, instead of glib.
>
> Some day, libbsd may get upped to important (I hope), so that this
> can replace netcat-traditional and netcat6 at once. It’s also much
> more lightweight a dependency AND the “original source” of strlcpy
> and friends AND will probably require a much smaller patch only.

Here's a patch to switch to libbsd. I've added few functions needed by
netcat-openbsd on the last upstream release so this helps in reducing
the delta with upstream. If there's more stuff you need in the future
please request it and I'll consider its addition.

Here's a summary of the changes:

* no-strtonum.patch: Remove, use strtonum from libbsd.
* openbsd-compat.patch: Remove, use readpassphrase from libbsd.
* quit-timer.patch: Change to use strtonum instead of strtoul.

* gcc-warnings.patch: Refreshed to take into account no-strotonum
patch removal.
* getservbyname.patch: Likewise.

* glib-strlcpy.patch: Remove hunks related to glib conversion
(strlcpy and arc4random) as those are now from libbsd. Remaining
changes are unrelated to glib, so rename to ...
* disable-setsockopts.patch: ... this.

* socks-b64-prototype.patch: Remove, not strictly libbsd related, but
as I was at it, switch to use the function from <resolv.h> which
requires to link against -lresolv on GNU systems, and avoids using
the local embedded code.

* bsd-compat.patch: New. This one should be obvious given the previous.

regards,
guillem

netcat-openbsd_libbsd.patch

Decklin Foster

unread,
Jan 11, 2010, 9:20:01 PM1/11/10
to
Excerpts from Guillem Jover's message of Mon Jan 11 18:00:23 -0500 2010:
> tag 550611 patch

Wonderful, thanks. I'll apply this.
--
things change.
dec...@red-bean.com

Thorsten Glaser

unread,
Feb 18, 2012, 3:20:01 PM2/18/12
to
Debian Bug Tracking System dixit:

>#550611: please use libbsd instead of glib for strlcpy
>
>It has been closed by Aron Xu <ar...@debian.org>.

This FTBFS (no pkg-config? did you forget to build in
a clean chroot, e.g. with cowbuilder?).

bye,
//mirabilos
--
“Having a smoking section in a restaurant is like having
a peeing section in a swimming pool.”
-- Edward Burr

Thorsten Glaser

unread,
Feb 18, 2012, 10:20:02 PM2/18/12
to
Dixi quod…

>This FTBFS (no pkg-config? did you forget to build in

Now builds but throws errors when installing:

Setting up netcat-openbsd (1.105-2) ...
update-alternatives: warning: forcing reinstallation of alternative /bin/nc.openbsd because link group nc is broken.
update-alternatives: warning: skip creation of /usr/share/man/man1/nc.1.gz because associated file /usr/share/man/man1/nc_openbsd.1.gz (of link group nc) doesn't exist.
update-alternatives: warning: not removing /usr/share/man/man1/nc.1.gz since it's not a symlink.
update-alternatives: warning: skip creation of /usr/share/man/man1/netcat.1.gz because associated file /usr/share/man/man1/nc_openbsd.1.gz (of link group nc) doesn't exist.

And indeed:

-rw-r--r-- 1 root root 5755 Feb 18 21:35 /usr/share/man/man1/nc.1.gz
lrwxrwxrwx 1 root root 7 Feb 18 21:37 /usr/share/man/man1/nc.openbsd.1.gz -> nc.1.gz

bye,
//mirabilos
--
[...] if maybe ext3fs wasn't a better pick, or jfs, or maybe reiserfs, oh but
what about xfs, and if only i had waited until reiser4 was ready... in the be-
ginning, there was ffs, and in the middle, there was ffs, and at the end, there
was still ffs, and the sys admins knew it was good. :) -- Ted Unangst über *fs

Aron Xu

unread,
Feb 19, 2012, 1:00:02 AM2/19/12
to
On Sun, Feb 19, 2012 at 11:00, Thorsten Glaser <t...@mirbsd.de> wrote:
> Dixi quod…
>
>>This FTBFS (no pkg-config? did you forget to build in
>
> Now builds but throws errors when installing:
>
> Setting up netcat-openbsd (1.105-2) ...
> update-alternatives: warning: forcing reinstallation of alternative /bin/nc.openbsd because link group nc is broken.
> update-alternatives: warning: skip creation of /usr/share/man/man1/nc.1.gz because associated file /usr/share/man/man1/nc_openbsd.1.gz (of link group nc) doesn't exist.
> update-alternatives: warning: not removing /usr/share/man/man1/nc.1.gz since it's not a symlink.
> update-alternatives: warning: skip creation of /usr/share/man/man1/netcat.1.gz because associated file /usr/share/man/man1/nc_openbsd.1.gz (of link group nc) doesn't exist.
>

Thanks for spotting this. I was a bit messy in the packaging of this
(actually patching on patched files had made me crazy). Will fix this
in another upload very soon.


--
Regards,
Aron Xu

Aron Xu

unread,
Feb 19, 2012, 3:00:01 AM2/19/12
to
On Sun, Feb 19, 2012 at 11:00, Thorsten Glaser <t...@mirbsd.de> wrote:
> Dixi quod…
>
>>This FTBFS (no pkg-config? did you forget to build in
>
> Now builds but throws errors when installing:
>
> Setting up netcat-openbsd (1.105-2) ...
> update-alternatives: warning: forcing reinstallation of alternative /bin/nc.openbsd because link group nc is broken.
> update-alternatives: warning: skip creation of /usr/share/man/man1/nc.1.gz because associated file /usr/share/man/man1/nc_openbsd.1.gz (of link group nc) doesn't exist.
> update-alternatives: warning: not removing /usr/share/man/man1/nc.1.gz since it's not a symlink.
> update-alternatives: warning: skip creation of /usr/share/man/man1/netcat.1.gz because associated file /usr/share/man/man1/nc_openbsd.1.gz (of link group nc) doesn't exist.
>

New version uploaded, and tested to be fine when upgrading from
1.89-4. But I can't guarantee the upgrade path from 1.105-2, but it
might not be too bad.



--
Regards,
Aron Xu

Thorsten Glaser

unread,
Feb 19, 2012, 11:00:02 AM2/19/12
to
Aron Xu dixit:

>Thanks for spotting this. I was a bit messy in the packaging of this
>(actually patching on patched files had made me crazy). Will fix this

You’re welcome, and I know the feeling for packages I took
over (cvs in squeeze uses dbs for crying out loud, and there
was a security fix recently, and NOW there is a complaint
that it ships /usr/share/info/dir)…

>New version uploaded, and tested to be fine when upgrading from
>1.89-4. But I can't guarantee the upgrade path from 1.105-2, but it
>might not be too bad.

Thanks. Looks ok:

Setting up netcat-openbsd (1.105-3) ...
update-alternatives: warning: forcing reinstallation of alternative /bin/nc.openbsd because link group nc is broken.

lrwxrwxrwx 1 root root 25 Feb 19 15:41 /usr/share/man/man1/nc.1.gz -> /etc/alternatives/nc.1.gz
lrwxrwxrwx 1 root root 15 Feb 19 11:35 /usr/share/man/man1/nc.openbsd.1.gz -> nc_openbsd.1.gz
-rw-r--r-- 1 root root 5756 Feb 19 11:34 /usr/share/man/man1/nc_openbsd.1.gz
lrwxrwxrwx 1 root root 20 Oct 6 2009 /bin/nc -> /etc/alternatives/nc*
-rwxr-xr-x 1 root root 22056 Feb 19 11:35 /bin/nc.openbsd*

bye,
//mirabilos
--
Support mksh as /bin/sh and RoQA dash NOW!
‣ src:bash (246 (265) bugs: 1 RC, 172 (186) I&N, 73 (78) M&W, 0 F&P)
‣ src:dash (74 (85) bugs: 3 RC, 27 (30) I&N, 44 (52) M&W, 0 F&P)
‣ src:mksh (1 bug: 0 RC, 0 I&N, 1 M&W, 0 F&P)
http://qa.debian.org/data/bts/graphs/d/dash.png is pretty red, innit?

Aron Xu

unread,
Feb 20, 2012, 2:50:02 AM2/20/12
to
Thanks!



--
Regards,
Aron Xu
0 new messages