Page MenuHomeFreeBSD

syslogd: unlink() -> unlinkat()
ClosedPublic

Authored by jfree on Aug 8 2023, 4:34 PM.
Tags
None
Referenced Files
F86259990: D41379.diff
Mon, Jun 17, 6:35 PM
Unknown Object (File)
Wed, Jun 5, 11:34 AM
Unknown Object (File)
Mon, Jun 3, 4:25 PM
Unknown Object (File)
Apr 23 2024, 6:41 AM
Unknown Object (File)
Apr 10 2024, 4:26 PM
Unknown Object (File)
Mar 13 2024, 1:12 AM
Unknown Object (File)
Mar 13 2024, 1:12 AM
Unknown Object (File)
Mar 13 2024, 1:02 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
2320

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
2320

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
3764

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

3768

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.