CR_CANSEE(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– CR_CANSEE(9) πŸ’–

okay bestie, this is CR_CANSEE(9) from the Kernel Developer's Manual β€” section 9, kernel dev territory, and it's literally about deciding whether one credential can β€œsee” another subject or object. No cap. πŸ‘‘


🌸 NAME 🌸

cr_cansee β€” determine visibility of objects given their user credentials


✨ SYNOPSIS ✨

#include <sys/proc.h>

int
cr_cansee(struct ucred *u1, struct ucred *u2);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: this function determines if a subject with credential u1 can see a subject or object associated to credential u2. That's it. That's the whole plot β€” visibility, but for creds. πŸ‘€

Specific types of subjects may need to submit to additional or different restrictions. As an example, for processes, see p_cansee(9), which calls this function. So if you're here from process land, that's your next stop. 🫢

The implementation relies on cr_bsd_visible(9), and consequently the sysctl(8) variables referenced in its manual page influence the result. Highkey important: those sysctls are part of the vibe. ✨


πŸŽ€ RETURN VALUES πŸŽ€

This function returns zero if the subject with credential u1 can β€œsee” the subject or object with credential u2. Otherwise it returns ESRCH. That's the whole vibe check: 0 means visible, ESRCH means nope. πŸ’…


πŸ”₯ ERRORS πŸ”₯

  • [ESRCH] β€” The subject with credential u1 has been jailed and the subject or object with credential u2 does not belong to the same jail or one of its sub-jails, as determined by prison_check(9). πŸš”
  • [ESRCH] β€” The MAC subsystem denied visibility.
  • [ESRCH] β€” cr_bsd_visible(9) denied visibility according to the BSD security policies in force.

🌈 SEE ALSO 🌈

Go read these, bestie: cr_bsd_visible(9), mac(9), p_cansee(9), prison_check(9). iykyk πŸ’œ


xoxo, this page is from Debian, dated August 18, 2023 β€” CR_CANSEE(9) signing off πŸ’…πŸ’–

πŸ“¦ where this page comes from