Skip to content
BSD syscall#393

svc · unix #393

__mac_set_lctx

Updates the MAC label of the calling thread's login context.

Prototype

int __mac_set_lctx(struct mac *mac_p);

Returns: int

Arguments

NameTypeDirDescription
mac_pstruct mac-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard393
xnu-1699.24.8macOS 10.7 Lion393
xnu-2050.18.24macOS 10.8 Mountain Lion393
xnu-2422.115.4macOS 10.9 Mavericks393
xnu-2782.40.9macOS 10.10 Yosemite393
xnu-1486.2.11—393
xnu-1504.15.3—393
xnu-1504.3.12—393
xnu-1504.7.4—393
xnu-1504.9.17—393
xnu-1504.9.26—393
xnu-1504.9.37—393
xnu-1699.22.73—393
xnu-1699.22.81—393
xnu-1699.24.23—393
xnu-1699.26.8—393
xnu-1699.32.7—393
xnu-2050.22.13—393
xnu-2050.24.15—393
xnu-2050.48.11—393
xnu-2050.7.9—393
xnu-2050.9.2—393
xnu-2422.1.72—393
xnu-2422.100.13—393
xnu-2422.110.17—393
xnu-2422.90.20—393
xnu-2782.1.97—393
xnu-2782.10.72—393
xnu-2782.20.48—393
xnu-2782.30.5—393

Notes

Writes the lctx label after the affected policies' mpo_lctx_check_label_update hooks accept the change. Like its siblings it is effectively dead code on shipping macOS; expect ENOSYS or policy refusal.

Detection

Any invocation should be considered hostile reconnaissance of unused syscall surface.

Related APIs

__mac_get_lctx__mac_get_lcid