Page MenuHomeFreeBSD

Store dirfd of pidfile.
ClosedPublic

Authored by oshogbo on Jul 21 2017, 7:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 9 2024, 4:05 AM
Unknown Object (File)
Dec 20 2023, 4:33 AM
Unknown Object (File)
Nov 18 2023, 5:27 PM
Unknown Object (File)
Nov 13 2023, 3:10 AM
Unknown Object (File)
Sep 15 2023, 1:11 AM
Unknown Object (File)
Aug 24 2023, 6:20 AM
Unknown Object (File)
Aug 1 2023, 5:30 AM
Unknown Object (File)
Aug 1 2023, 5:30 AM
Subscribers
None

Details

Summary

This allow us to remove pidfile in capability mode thanks to unlinkat(2).

PR: 220524

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

oshogbo created this revision.

Regenerate with -U99999.

lib/libutil/pidfile.c
133 ↗(On Diff #31068)

Should we try to limit the rights on this descriptor to CAP_UNLINKAT once the pidfile is open? AFAIK this can be done even if the process is not in capability mode. The cap_rights_limit() man page isn't very clear on this though.

170 ↗(On Diff #31068)

Seems like we should be careful to preserve errno as you did above?

277 ↗(On Diff #31068)

The addition of braces here is inconsistent with the if statement above.

Update diff after markj@ review.

oshogbo added inline comments.
lib/libutil/pidfile.c
133 ↗(On Diff #31068)

I would like to do that in separate commit, is that fine with you?

Works fine in my testing with your flopenat() patch applied as well.

Thanks for addressing this!

lib/libutil/pidfile.c
252 ↗(On Diff #31199)

I would kill this blank line.

133 ↗(On Diff #31068)

Sure.

This revision is now accepted and ready to land.Jul 25 2017, 9:20 PM
This revision was automatically updated to reflect the committed changes.