Skip to contentSkip to conversation

Does _need_to_be_root deserve to live?

DISCUSSION Theodore Ts'o 2 participants 2 messages Feb 11, 2016

lore
Share & tools
lore
#0 lore raw

There appear to be a number of tests that need to mount and unmount scratch or su to $qa_user that don't call the helper _need_to_be_root.

Also, sicne the check script calls _check_filesystems between every single test, which requires unmounting and remounting the test and/or scratch file systems, does the _need_to_be_root check make any sense at all?

And if doesn't make any sense, is it worth it to submitting a patch that just removes all mention of _need_to_be_root from the tests and common/rc?

Cheers,

- Ted

#1 lore raw
Quoted 11 lines · Theodore Ts'o

There appear to be a number of tests that need to mount and unmount scratch or su to $qa_user that don't call the helper _need_to_be_root.

Also, sicne the check script calls _check_filesystems between every single test, which requires unmounting and remounting the test and/or scratch file systems, does the _need_to_be_root check make any sense at all?

And if doesn't make any sense, is it worth it to submitting a patch that just removes all mention of _need_to_be_root from the tests and common/rc?

I think it's safe to remove all _need_to_be_root calls, because there's already a user-id check in "check"

346 if [ id -u -ne 0 ]
347 then
348 echo "check: QA must be run as root"
349 exit 1
350 fi

Thanks,
Eryu