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

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)