Subject: Re: strange teapop process
To: None <>
From: Christian Biere <>
List: netbsd-users
Date: 01/30/2004 06:38:31
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Antoine Jacoutot wrote:
> ps output of teapop looks like this:
> teapop dDhil:nNp:st:vu stdin is not a socket\r\n Mailbox already locked.

That looks strange, yes..
> For now, everything seems to work ok, but I'm a little bit concern about =
> strange output.

I'd be as well.

> On teapop mailling list, they said it might be a problem with
> NetBSD and getopt().

Or maybe just the wrong moon-phase?

> Anyone seeing this behaviour ?

I haven't compiled it, but by looking at the sources it's almost trivial
to tell that they're doing a couple of things the wrong way.

Why don't they try the following:
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[])
  char *s[] =3D { "I", " don't", " know", " what", " I'm", " doing!" };

  (void) argc;
  argv[0] =3D s[0];
  return 0;

Run it with "./blah Am I stupid or what?" and look at the output of ps.
You might also kindly ask them WTF they're trying to do here:

=46rom pop_socket.c:
pop_socket_send(FILE * fd, const char *fmt, ...)
	char buf[512];

	va_list ap;
#if __STDC__
	va_start(ap, fmt);
	vsnprintf(buf, 508, fmt, ap);
	if (!(buf[strlen(buf - 2)] =3D=3D '\r' && buf[strlen(buf - 1)] =3D=3D '\n'=
		strcat(buf, "\r\n");

There are at least 5 bugs plus a don't-do-this in this piece of code. Sorry,
in case your eyes are bleeding now.


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.4 (NetBSD)