af_unix: dont send SCM_CREDENTIAL when dest socket is NULL
authordingtianhong <dingtianhong@huawei.com>
Mon, 25 Mar 2013 17:02:04 +0000 (17:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Mar 2013 16:33:55 +0000 (12:33 -0400)
commit14134f6584212d585b310ce95428014b653dfaf6
treedfaa64172441eecd90557d1f1bedba1695fa4cd6
parent465c0a165938992455357982d7f15ac105528b4a
af_unix: dont send SCM_CREDENTIAL when dest socket is NULL

SCM_SCREDENTIALS should apply to write() syscalls only either source or destination
socket asserted SOCK_PASSCRED. The original implememtation in maybe_add_creds is wrong,
and breaks several LSB testcases ( i.e. /tset/LSB.os/netowkr/recvfrom/T.recvfrom).

Origionally-authored-by: Karel Srot <ksrot@redhat.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c