patch-2.3.99-pre8 linux/net/unix/af_unix.c
Next file: linux/scripts/cramfs/mkcramfs.c
Previous file: linux/net/ipv4/netfilter/iptable_mangle.c
Back to the patch index
Back to the overall index
-  Lines: 18
-  Date:
Fri May 12 11:37:39 2000
-  Orig file: 
v2.3.99-pre7/linux/net/unix/af_unix.c
-  Orig date: 
Thu May 11 15:30:08 2000
diff -u --recursive --new-file v2.3.99-pre7/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
@@ -45,6 +45,7 @@
  *					dgram receiver.
  *		Artur Skawina   :	Hash function optimizations
  *	     Alexey Kuznetsov   :	Full scale SMP. Lot of bugs are introduced 8)
+ *	      Malcolm Beattie   :	Set peercred for socketpair
  *
  *
  * Known differences from reference BSD that was tested:
@@ -982,6 +983,9 @@
 	sock_hold(skb);
 	unix_peer(ska)=skb;
 	unix_peer(skb)=ska;
+	ska->peercred.pid = skb->peercred.pid = current->pid;
+	ska->peercred.uid = skb->peercred.uid = current->euid;
+	ska->peercred.gid = skb->peercred.gid = current->egid;
 
 	if (ska->type != SOCK_DGRAM)
 	{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)