[torquedev] unix domain sockets for clients
Garrick Staples
garrick at usc.edu
Sat Jan 12 19:30:19 MST 2008
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torquedev/attachments/20080112/b891b756/attachment.bin
More information about the torquedev
mailing list