Add secdata to unix_streams.
Subsystems (2)
PATCH 1/1 Add secdata to unix_streams.
The unix_dgram routines add secdata to socket message, but the unix_stream routines do not. We add the two missing lines of code.
Signed-off-by Pat Kane <[email protected]>
--- net/unix/af_unix.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
net/unix/af_unix.c +3 -0
@@ -1642,6 +1642,8 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, max_level = err +1 ; fds_sent = true; +unix_get_secdata (siocb->scm, skb); + err =memcpy_fromiovec (skb_put (skb, size), msg->msg_iov, size);if (err) {kfree_skb (skb);
@@ -1930,6 +1932,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, }else {/* Copy credentials */ scm_set_cred (siocb->scm,UNIXCB (skb).pid,UNIXCB (skb).cred); +unix_set_secdata (siocb->scm, skb); check_creds =1 ; }
Signature · 1 line
1.7.1
Quoted 3 lines · On Tue, 22 Mar 2011 18:27:02 -0500 Pat Kane wrote:
The
unix_dgramroutines add secdata to socket message, but theunix_streamroutines do not. We add the two missing lines of code.
Please copy [email protected] on networking patches.
We who? :)
Quoted 20 lines
Signed-off-by Pat Kane <[email protected]>--- net/unix/af_unix.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)net/unix/af_unix.c +2
-0@@ -1642,6 +1642,8 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, max_level = err +1 ; fds_sent = true; +unix_get_secdata (siocb->scm, skb); + err =memcpy_fromiovec (skb_put (skb, size), msg->msg_iov, size);if (err) {kfree_skb (skb);
net/unix/af_unix.c static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, · line 1938
Quoted 7 lines
net/unix/af_unix.c +1
-0@@ -1930,6 +1932,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, }else {/* Copy credentials */ scm_set_cred (siocb->scm,UNIXCB (skb).pid,UNIXCB (skb).cred); +unix_set_secdata (siocb->scm, skb); check_creds =1 ; }
gmail (?) mucked up the indentation tabs -- they are all spaces. Not good.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***