bug-hurd
[Top][All Lists]
Advanced

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

Re: Bug#187391: PortingIssues sockaddr_un


From: Robert Millan
Subject: Re: Bug#187391: PortingIssues sockaddr_un
Date: Thu, 10 Apr 2003 21:27:20 +0200
User-agent: Mutt/1.5.3i

On Mon, Apr 07, 2003 at 04:48:07PM +0300, Ognyan Kulev wrote:
> 
> sockaddr_un su;
> /* AF_LOCAL is the canonical flag in Glibc.
>    Use AF_UNIX if you want compatibility.  */
> su.sun_family = AF_LOCAL;
> /* Copy the string into sun_path. It must be
>    no longer than approximately 100 characters. */
> strcpy (su.sun_path, "/path/to/socket");

this is wrong, there is no garantee that "/path/to/socket" isn't longer
than 108 chars, then su.sun_path would overflow.

> SUN_LEN macro is not defined in The Single UNIX Specification Version 3 
> (see sys/un.h manpage).

we're talking about Glibc, which may or may not adhere to standards, but
has its own way of doing this. refer to the official Glibc documentation
in info format. the manpages from the "Linux programmer's manual" are made
by third parties outside Glibc developement (probably as a pretension that
their "Linux system" is not a variant of GNU), and are crappled with serious
bugs (see #152136) that help introducing programming errors.

according to the Glibc docs, sun_path is not defined by SUN_LEN, but
has a fixed length of 108 chars.

-- 
Robert Millan

make: *** No rule to make target `war'.  Stop.

Another world is possible - Just say no to genocide




reply via email to

[Prev in Thread] Current Thread [Next in Thread]