---
name: "cr_cansee"
section: "9freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cr_cansee/9freebsd"
---

# cr\_cansee(9freebsd)

determine visibility of objects given their user credentials

## NAME

**cr\_cansee** – determine visibility of objects given their user credentials

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/systm.h\>**

**#include \<sys/ucred.h\>**

*int*\

**cr\_cansee**(*struct ucred \*u1*, *struct ucred \*u2*);

## DESCRIPTION

This function determines the visibility of objects in the kernel based on the real user IDs and group IDs in the credentials *u1* and *u2* associated with them.

The visibility of objects is influenced by the [sysctl(8)](/sysctl/8.md) variables *security.bsd.see\_other\_gids* and *security.bsd.see\_other\_uids*, as per the description in [cr\_seeothergids(9)](/cr_seeothergids/9.md) and [cr\_seeotheruids(9)](/cr_seeotheruids/9.md) respectively.

## RETURN VALUES

This function returns zero if the object with credential *u1* can “see” the object with credential *u2*, or ESRCH otherwise.

## ERRORS

- \[ESRCH\]

  The object with credential *u1* cannot “see” the object with credential *u2*.

- \[ESRCH\]

  The object with credential *u1* has been jailed and the object with credential *u2* does not belong to the same jail as *u1*.

- \[ESRCH\]

  The MAC subsystem denied visibility.

## SEE ALSO

[cr\_seeothergids(9)](/cr_seeothergids/9.md), [cr\_seeotheruids(9)](/cr_seeotheruids/9.md), [mac(9)](/mac/9.md), [p\_cansee(9)](/p_cansee/9.md)
