[torquedev] unix domain sockets for clients

Glen Beane glen.beane at gmail.com
Sat Jan 12 20:40:53 MST 2008


On Jan 12, 2008 9:30 PM, Garrick Staples <garrick at usc.edu> wrote:

> On Sat, Jan 12, 2008 at 04:07:29PM -0500, Glen Beane alleged:
> > I just did a check on trunk to make sure things are OK on OS X and it
> will
> > no longer compile:
> >
> >
> > ../Libifl/pbsD_connect.c: In function 'send_unix_creds':
> > ../Libifl/pbsD_connect.c:545: error: 'SCM_CREDENTIALS' undeclared (first
> use
> > in this function)
> > ../Libifl/pbsD_connect.c:545: error: (Each undeclared identifier is
> reported
> > only once
> > ../Libifl/pbsD_connect.c:545: error: for each function it appears in.)
> > ../Libifl/pbsD_connect.c:548: error: 'struct ucred' has no member named
> > 'uid'
> > ../Libifl/pbsD_connect.c:549: error: 'struct ucred' has no member named
> > 'gid'
> > ../Libifl/pbsD_connect.c:550: error: 'struct ucred' has no member named
> > 'pid'
> >
> >
> >  Looks like the configure test is going to have to be changed a bit so
> the
> > unix sockets are not enabled on OS X.
>
> Bah.  You aren't allowed to send bug reports.  I only accept patches from
> you!
>
>
> Try this:
> Index: src/lib/Libifl/pbsD_connect.c
> ===================================================================
> --- src/lib/Libifl/pbsD_connect.c       (revision 1733)
> +++ src/lib/Libifl/pbsD_connect.c       (working copy)
> @@ -542,12 +542,14 @@
>   msg.msg_controllen = sizeof(buf);
>   cmsg = CMSG_FIRSTHDR(&msg);
>   cmsg->cmsg_level = SOL_SOCKET;
> -  cmsg->cmsg_type = SCM_CREDENTIALS;
> +  cmsg->cmsg_type = SCM_CREDS;
>   cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred));
>   uptr = (struct ucred *)CMSG_DATA(cmsg);
> -  uptr->uid = getuid();
> -  uptr->gid = getgid();
> +  SPC_PEER_UID(uptr) = getuid();
> +  SPC_PEER_GID(uptr) = getgid();
> +#ifdef linux
>   uptr->pid = getpid();
> +#endif
>   msg.msg_controllen = cmsg->cmsg_len;
>
>   return (sendmsg(sd, &msg, 0) != -1);
>



process_request.c: In function 'get_creds':
process_request.c:195: error: invalid application of 'sizeof' to incomplete
type 'struct ucred'
process_request.c:235: error: invalid application of 'sizeof' to incomplete
type 'ucreds'
process_request.c:245: error: dereferencing pointer to incomplete type
process_request.c:245: error: dereferencing pointer to incomplete type
process_request.c:247: error: dereferencing pointer to incomplete type
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/torquedev/attachments/20080112/a33d345d/attachment.html


More information about the torquedev mailing list