diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-09 11:51:35 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-09 11:51:35 -0400 |
commit | c973b112c76c9d8fd042991128f218a738cc8d0a (patch) | |
tree | e813b0da5d0a0e19e06de6462d145a29ad683026 /security/selinux/hooks.c | |
parent | c5fbc3966f48279dbebfde10248c977014aa9988 (diff) | |
parent | 00dd1e433967872f3997a45d5adf35056fdf2f56 (diff) |
Merge with /shiny/git/linux-2.6/.git
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 5e755a3f4cae..9f9463000683 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -826,7 +826,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent | |||
826 | sid = sbsec->def_sid; | 826 | sid = sbsec->def_sid; |
827 | rc = 0; | 827 | rc = 0; |
828 | } else { | 828 | } else { |
829 | rc = security_context_to_sid(context, rc, &sid); | 829 | rc = security_context_to_sid_default(context, rc, &sid, |
830 | sbsec->def_sid); | ||
830 | if (rc) { | 831 | if (rc) { |
831 | printk(KERN_WARNING "%s: context_to_sid(%s) " | 832 | printk(KERN_WARNING "%s: context_to_sid(%s) " |
832 | "returned %d for dev=%s ino=%ld\n", | 833 | "returned %d for dev=%s ino=%ld\n", |
@@ -3125,12 +3126,12 @@ static int selinux_socket_connect(struct socket *sock, struct sockaddr *address, | |||
3125 | 3126 | ||
3126 | if (sk->sk_family == PF_INET) { | 3127 | if (sk->sk_family == PF_INET) { |
3127 | addr4 = (struct sockaddr_in *)address; | 3128 | addr4 = (struct sockaddr_in *)address; |
3128 | if (addrlen != sizeof(struct sockaddr_in)) | 3129 | if (addrlen < sizeof(struct sockaddr_in)) |
3129 | return -EINVAL; | 3130 | return -EINVAL; |
3130 | snum = ntohs(addr4->sin_port); | 3131 | snum = ntohs(addr4->sin_port); |
3131 | } else { | 3132 | } else { |
3132 | addr6 = (struct sockaddr_in6 *)address; | 3133 | addr6 = (struct sockaddr_in6 *)address; |
3133 | if (addrlen != sizeof(struct sockaddr_in6)) | 3134 | if (addrlen < SIN6_LEN_RFC2133) |
3134 | return -EINVAL; | 3135 | return -EINVAL; |
3135 | snum = ntohs(addr6->sin6_port); | 3136 | snum = ntohs(addr6->sin6_port); |
3136 | } | 3137 | } |