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 @@ integer:
|
|||||||
break;
|
break;
|
||||||
case SO_LABEL:
|
case SO_LABEL:
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
|
error = sooptcopyin(sopt, &extmac, sizeof(extmac),
|
||||||
|
sizeof(extmac));
|
||||||
|
if (error)
|
||||||
|
return (error);
|
||||||
error = mac_getsockopt_label_get(
|
error = mac_getsockopt_label_get(
|
||||||
sopt->sopt_td->td_ucred, so, &extmac);
|
sopt->sopt_td->td_ucred, so, &extmac);
|
||||||
if (error)
|
if (error)
|
||||||
@ -1610,6 +1614,10 @@ integer:
|
|||||||
break;
|
break;
|
||||||
case SO_PEERLABEL:
|
case SO_PEERLABEL:
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
|
error = sooptcopyin(sopt, &extmac, sizeof(extmac),
|
||||||
|
sizeof(extmac));
|
||||||
|
if (error)
|
||||||
|
return (error);
|
||||||
error = mac_getsockopt_peerlabel_get(
|
error = mac_getsockopt_peerlabel_get(
|
||||||
sopt->sopt_td->td_ucred, so, &extmac);
|
sopt->sopt_td->td_ucred, so, &extmac);
|
||||||
if (error)
|
if (error)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user