Page MenuHomeFreeBSD

Store dirfd of pidfile.
ClosedPublic

Authored by oshogbo on Jul 21 2017, 7:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 11, 3:27 PM
Unknown Object (File)
Wed, Nov 27, 3:25 AM
Unknown Object (File)
Nov 25 2024, 6:33 PM
Unknown Object (File)
Nov 24 2024, 2:51 PM
Unknown Object (File)
Nov 21 2024, 12:07 PM
Unknown Object (File)
Nov 20 2024, 1:28 AM
Unknown Object (File)
Nov 19 2024, 8:52 PM
Unknown Object (File)
Nov 8 2024, 10:11 PM
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.