MCPcopy Create free account
hub / github.com/F-Stack/f-stack / biba_devfs_create_device

Function biba_devfs_create_device

freebsd/security/mac_biba/mac_biba.c:940–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

938}
939
940static void
941biba_devfs_create_device(struct ucred *cred, struct mount *mp,
942 struct cdev *dev, struct devfs_dirent *de, struct label *delabel)
943{
944 struct mac_biba *mb;
945 const char *dn;
946 int biba_type;
947
948 mb = SLOT(delabel);
949 dn = devtoname(dev);
950 if (strcmp(dn, "null") == 0 ||
951 strcmp(dn, "zero") == 0 ||
952 strcmp(dn, "random") == 0 ||
953 strncmp(dn, "fd/", strlen("fd/")) == 0)
954 biba_type = MAC_BIBA_TYPE_EQUAL;
955 else if (ptys_equal &&
956 (strncmp(dn, "ttyp", strlen("ttyp")) == 0 ||
957 strncmp(dn, "pts/", strlen("pts/")) == 0 ||
958 strncmp(dn, "ptyp", strlen("ptyp")) == 0))
959 biba_type = MAC_BIBA_TYPE_EQUAL;
960 else
961 biba_type = MAC_BIBA_TYPE_HIGH;
962 biba_set_effective(mb, biba_type, 0, NULL);
963}
964
965static void
966biba_devfs_create_directory(struct mount *mp, char *dirname, int dirnamelen,

Callers

nothing calls this directly

Calls 4

strcmpFunction · 0.85
strncmpFunction · 0.85
biba_set_effectiveFunction · 0.85
devtonameFunction · 0.50

Tested by

no test coverage detected