When implementing getsockopt() for SO_LABEL and SO_PEERLABEL, make
sure to sooptcopyin() the (struct mac) so that the MAC Framework knows which label types are being requested. This fixes process queries of socket labels. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
This commit is contained in:
parent
5d9d409ca9
commit
12cbb9dc56
@ -1599,6 +1599,10 @@ sogetopt(so, sopt)
|
||||
break;
|
||||
case SO_LABEL:
|
||||
#ifdef MAC
|
||||
error = sooptcopyin(sopt, &extmac, sizeof(extmac),
|
||||
sizeof(extmac));
|
||||
if (error)
|
||||
return (error);
|
||||
error = mac_getsockopt_label_get(
|
||||
sopt->sopt_td->td_ucred, so, &extmac);
|
||||
if (error)
|
||||
@ -1610,6 +1614,10 @@ sogetopt(so, sopt)
|
||||
break;
|
||||
case SO_PEERLABEL:
|
||||
#ifdef MAC
|
||||
error = sooptcopyin(sopt, &extmac, sizeof(extmac),
|
||||
sizeof(extmac));
|
||||
if (error)
|
||||
return (error);
|
||||
error = mac_getsockopt_peerlabel_get(
|
||||
sopt->sopt_td->td_ucred, so, &extmac);
|
||||
if (error)
|
||||
|
Loading…
Reference in New Issue
Block a user