Page MenuHomeFreeBSD

clear_tmp: Remove all chflags bits in /tmp before the clear proccess is initiated

Authored by gbe on Jul 1 2020, 10:40 AM.


Group Reviewers
Contributor Reviews (base)
Src Committers

Remove all chflags bits in /tmp before the clear proccess is initiated

I know that this is a little bit controversial, but in my opinion an rc option
named clear_tmp_enable should empty /tmp no matter what options are set for
files and directory in a temp directory.

Test Plan

Creation of files and directories that have the immutable flag set and
a followed system reboot. The /tmp directory should be empty.

Diff Detail

Lint OK
No Unit Test Coverage
Build Status
Buildable 32086
Build 29607: arc lint + arc unit

Event Timeline

gbe requested review of this revision.Jul 1 2020, 10:40 AM
gbe created this revision.

I also feel it is a bit controversial, if we set the immutable flag then we probably don't want it get deleted (then why put it under /tmp?)

Maybe we can have another flag, say, clear_tmp_remove_flags or something like that to explicitly state that we want to remove the flags.

gbe added a subscriber: ngie.

@lwhsu The original problem was about undeletable files after a kyua ran. @ngie has fixed them a while ago. I am also using tmpfs now, so I would think that this differential was overcome by events.

This shouldn't be committed to head.