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

Bug#376756: marked as done (libc6: popen() should return NULL)



Your message dated Thu, 24 Aug 2006 03:18:34 +0200
with message-id <44ECFE6A.3090007@aurel32.net>
and subject line Bug#376756: libc6: popen() should return NULL
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libc6
Version: 2.3.6-15
Severity: normal

Hello,

According to section 15.2 of glibc-doc ("Pipe to a Subprocess") the
function popen() should return NULL if it failed to open the pipe.
However, the function is returning a non NULL pointer, as can be seen
by running the program below:

--------------------------------------
/* testpopen.c */
#include <stdio.h>

int main(){
  FILE *F = NULL;
  printf("Before: F = %p\n", F);
  F = popen("nothing", "w");
  printf("After:  F = %p\n", F);
  pclose(F);
  return 0;
}
--------------------------------------

$ gcc testpopen.c
$ ./a.out
Before: F = (nil)
After:  F = 0x501010
sh: nothing: command not found

Thanks,


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-amd64-k8
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)

Versions of packages libc6 depends on:
ii  tzdata                        2006g-2    Time Zone and Daylight Saving Time

libc6 recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
Jakson A. Aquino a écrit :
On Wed, Jul 05, 2006 at 03:02:54PM +0200, Gabor Gombas wrote:
This means that popen() _did_ succeed (it has invoked the shell). The
fact that the shell could not interpret the command and therefore exited
with an error is not popen()'s business anymore.

I'm sorry for reporting the "bug". After your explanation, I could see
that the documentation example is clear enough about popen() return
value.


Ok, closing the bug then.

--
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

--- End Message ---

Reply to: