Commit bfda63f
committed
selinux: correct return values in selinux_socket_getpeersec_dgram()
Instead of returning -EINVAL if any type of error occurs, limit
-EINVAL to only those errors caused by passing a bad/invalid socket
or packet/skb. In other cases where everything is correct but there
isn't a valid peer label we return -ENOPROTOOPT.
This helps make selinux_socket_getpeersec_dgram() more consistent
with selinux_socket_getpeersec_stream().
Signed-off-by: Paul Moore <paul@paul-moore.com>1 parent 90593ca commit bfda63f
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5193 | 5193 | | |
5194 | 5194 | | |
5195 | 5195 | | |
5196 | | - | |
| 5196 | + | |
| 5197 | + | |
5197 | 5198 | | |
5198 | 5199 | | |
5199 | 5200 | | |
5200 | | - | |
5201 | 5201 | | |
5202 | 5202 | | |
5203 | 5203 | | |
5204 | 5204 | | |
5205 | 5205 | | |
5206 | 5206 | | |
5207 | 5207 | | |
5208 | | - | |
5209 | | - | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
5210 | 5212 | | |
5211 | 5213 | | |
| 5214 | + | |
5212 | 5215 | | |
5213 | 5216 | | |
5214 | 5217 | | |
5215 | 5218 | | |
5216 | 5219 | | |
5217 | | - | |
5218 | 5220 | | |
5219 | 5221 | | |
5220 | | - | |
| 5222 | + | |
5221 | 5223 | | |
5222 | 5224 | | |
5223 | 5225 | | |
| |||
0 commit comments