Page MenuHomeFreeBSD

syslogd: unlink() -> unlinkat()
ClosedPublic

Authored by jfree on Aug 8 2023, 4:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 6:10 AM
Unknown Object (File)
Sun, Dec 22, 5:13 PM
Unknown Object (File)
Fri, Dec 6, 12:46 AM
Unknown Object (File)
Thu, Dec 5, 12:10 AM
Unknown Object (File)
Nov 8 2024, 1:58 AM
Unknown Object (File)
Nov 7 2024, 5:56 AM
Unknown Object (File)
Nov 7 2024, 5:38 AM
Unknown Object (File)
Nov 7 2024, 4:38 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 Not Applicable
Unit
Tests Not Applicable

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
2352

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
2352

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
3792

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

3796

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.