Page MenuHomeFreeBSD

Store dirfd of pidfile.
ClosedPublic

Authored by oshogbo on Jul 21 2017, 7:13 PM.
Tags
None
Referenced Files
F103406633: D11692.diff
Sun, Nov 24, 2:51 PM
Unknown Object (File)
Thu, Nov 21, 12:07 PM
Unknown Object (File)
Wed, Nov 20, 1:28 AM
Unknown Object (File)
Tue, Nov 19, 8:52 PM
Unknown Object (File)
Fri, Nov 8, 10:11 PM
Unknown Object (File)
Oct 22 2024, 10:29 AM
Unknown Object (File)
Oct 22 2024, 4:45 AM
Unknown Object (File)
Oct 17 2024, 1:03 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.