NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/44027: libnetpgp: is there a reason for calling exit(3)?



>Number:         44027
>Category:       lib
>Synopsis:       libnetpgp: is there a reason for calling exit(3)?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 02 15:50:00 +0000 2010
>Originator:     Peter Pentchev
>Release:        
>Organization:
>Environment:
>Description:
Thanks for writing and maintaining netpgp!

In the process of packaging it for use in Debian, I noticed that
the __ops_print_packet() function in packet-print.c may terminate
the running program if an unexpected packet type is encountered.
Since this routine seems to be used for displaying diagnostic
messages in several other functions, this strikes me as a bit strange -
apart from the general weirdness of having a library function call
exit(3), this particular case may lead to differences in operation
in debug and "normal" mode of other programs that simply use
the netpgp library.

I guess there is a reason for writing __ops_print_packet() this way;
still, if for some reason it would appear that this behavior is,
let us say, slightly outdated and overtaken by events, here's a little
patch to replace the exit() with a simple "return".  Of course,
the NetBSD community is fully in its right to decide against this,
and that'll be all right, too :)
>How-To-Repeat:

>Fix:
Apply the simple patch at:
http://devel.ringlet.net/security/netpgp/patches/03-do-not-call-exit.patch

Thanks for your time, and keep up the great work!



Home | Main Index | Thread Index | Old Index