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

Function audit_canon_path

freebsd/security/audit/audit_bsm_klib.c:497–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497void
498audit_canon_path(struct thread *td, int dirfd, char *path, char *cpath)
499{
500 struct vnode *cdir, *rdir;
501 struct pwd *pwd;
502 cap_rights_t rights;
503 int error;
504 bool vrele_cdir;
505
506 WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d",
507 __func__, __FILE__, __LINE__);
508
509 pwd = pwd_hold(td);
510 rdir = pwd->pwd_rdir;
511 cdir = NULL;
512 vrele_cdir = false;
513 if (*path != '/') {
514 if (dirfd == AT_FDCWD) {
515 cdir = pwd->pwd_cdir;
516 } else {
517 error = fgetvp(td, dirfd, cap_rights_init(&rights), &cdir);
518 if (error != 0) {
519 cpath[0] = '\0';
520 pwd_drop(pwd);
521 return;
522 }
523 vrele_cdir = true;
524 }
525 }
526
527 audit_canon_path_vp(td, rdir, cdir, path, cpath);
528
529 pwd_drop(pwd);
530 if (vrele_cdir)
531 vrele(cdir);
532}

Callers 2

audit_proc_coredumpFunction · 0.85
audit_arg_upathFunction · 0.85

Calls 5

pwd_holdFunction · 0.85
fgetvpFunction · 0.85
pwd_dropFunction · 0.85
audit_canon_path_vpFunction · 0.85
vreleFunction · 0.50

Tested by

no test coverage detected