Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libutil/pidfile.c
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | pidfile_open(const char *pathp, mode_t mode, pid_t *pidptr) | ||||
} | } | ||||
if (cap_rights_limit(dirfd, | if (cap_rights_limit(dirfd, | ||||
cap_rights_init(&caprights, CAP_UNLINKAT)) < 0 && errno != ENOSYS) { | cap_rights_init(&caprights, CAP_UNLINKAT)) < 0 && errno != ENOSYS) { | ||||
goto failed; | goto failed; | ||||
} | } | ||||
if (cap_rights_limit(fd, cap_rights_init(&caprights, CAP_PWRITE, | if (cap_rights_limit(fd, cap_rights_init(&caprights, CAP_PWRITE, | ||||
CAP_FSTAT, CAP_FTRUNCATE)) < 0 && | CAP_FSTAT, CAP_FTRUNCATE, CAP_EVENT)) < 0 && | ||||
errno != ENOSYS) { | errno != ENOSYS) { | ||||
goto failed; | goto failed; | ||||
} | } | ||||
pfh->pf_dirfd = dirfd; | pfh->pf_dirfd = dirfd; | ||||
pfh->pf_fd = fd; | pfh->pf_fd = fd; | ||||
pfh->pf_dev = sb.st_dev; | pfh->pf_dev = sb.st_dev; | ||||
pfh->pf_ino = sb.st_ino; | pfh->pf_ino = sb.st_ino; | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |