Page MenuHomeFreeBSD

syslogd: unlink() -> unlinkat()
ClosedPublic

Authored by jfree on Aug 8 2023, 4:34 PM.
Tags
None
Referenced Files
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
Unknown Object (File)
Feb 21 2024, 8:45 PM
Unknown Object (File)
Jan 8 2024, 2:05 PM
Unknown Object (File)
Dec 25 2023, 6:45 PM
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.