Re: #define SCM_RIGHTS 1

Mark Gray (markgray@iago.nac.net)
24 Jan 1998 05:59:45 -0500


Alex Belits <abelits@phobos.illtel.denver.co.us> writes:

>
> ...at least /usr/include/linux/socket.h has it in all versions since 2.0.
>
> However after a user of my program complained about it not compiling on
> Red Hat 5.0, I have installed Red Hat 5.0 with libc 6, changed various
> definitions and signedness incompatibilities in my source, recompiled it
> only to find that...
>
> /usr/include/socketbits.h:
>
> ---8<---
> /* Socket level message types. */
> enum
> {
> SCM_RIGHTS, /* Data array contains access rights. */
> /*#define SCM_RIGHTS SCM_RIGHTS*/
> __SCM_CREDENTIALS, /* Data array is `struct ucred'. */
> __SCM_CONNECT /* Data array is `struct scm_connect'. */
> };

[snip]
enum
{
SCM_RIGHTS = 0x01, /* Data array contains access rights.
*/
#define SCM_RIGHTS SCM_RIGHTS
__SCM_CREDENTIALS = 0x02, /* Data array is `struct ucred'. */
__SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'.
*/
};
[snip]

This is 2.0.33,
~$ rpm -qf /usr/include/socketbits.h
glibc-devel-2.0.6-8
~$

Tell them to upgrade to 2.0.6-8

> --->8---
>
> ...in other words, SCM_RIGHTS now is zero in user space, so kernel 2.0.32,
> not being enlightened about glibc opinion about SCM_RIGHTS, loudly
> complained to every attempt of sending file descriptors. Placing
> SCM_RIGHT=1 in that enum and recompiling program again produced perfectly
> usable executable.
>
> And, of course, kernel sources have no traces of __SCM_CREDENTIALS or
> __SCM_CONNECT. What is that? And what should I tell to users that compile
> my program, patch socketbits.h?
>
> --
> Alex
>
>