Page MenuHomeFreeBSD

syslogd: unlink() -> unlinkat()
ClosedPublic

Authored by jfree on Aug 8 2023, 4:34 PM.
Tags
None
Referenced Files
F102058365: D41379.diff
Thu, Nov 7, 2:36 AM
Unknown Object (File)
Wed, Oct 30, 12:12 PM
Unknown Object (File)
Sat, Oct 26, 10:30 AM
Unknown Object (File)
Sat, Oct 26, 5:23 AM
Unknown Object (File)
Wed, Oct 23, 11:35 AM
Unknown Object (File)
Mon, Oct 21, 5:25 AM
Unknown Object (File)
Mon, Oct 21, 5:25 AM
Unknown Object (File)
Mon, Oct 21, 5:25 AM
Subscribers

Details

Summary
Save basename and dirname for use in unlinkat() when removing UNIX
sockets from fs.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Can you use our funlinkat() instead of keeping track of the directory descriptor?

Can you use our funlinkat() instead of keeping track of the directory descriptor?

Yes. not sure how I missed that.

Can you use our funlinkat() instead of keeping track of the directory descriptor?

Yes. not sure how I missed that.

Actually, after reading about this, I don't think so. It seems like funlinkat() purely exists to ensure that you're unlinking an inode that matches the given path. I don't think it can remove a file without the directory descriptor.

This revision is now accepted and ready to land.Aug 11 2023, 3:03 PM
This revision now requires review to proceed.Aug 12 2023, 3:48 AM
markj added inline comments.
usr.sbin/syslogd/syslogd.c
2229

I'm not convinced we need to do this cleanup (aside from the unlinkat()) immediately prior to exiting. There's a lot of other stuff that isn't cleaned up.

This revision is now accepted and ready to land.Aug 14 2023, 2:25 PM
usr.sbin/syslogd/syslogd.c
2229

I'm not convinced we need to do this cleanup (aside from the unlinkat()) immediately prior to exiting. There's a lot of other stuff that isn't cleaned up.

A good portion of this program is inconsistent in this matter. I'll remove it, though.

This revision now requires review to proceed.Aug 14 2023, 3:46 PM
emaste added inline comments.
usr.sbin/syslogd/syslogd.c
3563

separate from all of this work I wonder if following the xstrdup pattern makes sense

3567

Are we typically/often going to have more than one AF_LOCAL endpoint open, and would they share a directory? i.e., is it worth trying to cache and share dirfds?

This revision is now accepted and ready to land.Aug 14 2023, 5:40 PM
This revision was automatically updated to reflect the committed changes.