WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] why does boot process change /opt ownership to root?  (Read 4912 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: [Solved] why does boot process change /opt ownership to root?
« Reply #15 on: October 20, 2020, 03:18:28 AM »
I think the change is fine, added to git. Any fresh opt is still root:staff, only a customized one stays with its own ownership.
The only barriers that can stop you are the ones you create yourself.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: [Solved] why does boot process change /opt ownership to root?
« Reply #16 on: October 20, 2020, 04:57:37 AM »
Hi, Core people!

Gazing over owners, permissions and dirs I was surprised by
Code: [Select]
tc@box:~$ ls -ld /
drwxr-xr-x   17 tc       staff          380 Jul  4 15:55 //

Is it ok to own / not by root? Or I am doing something wrong?

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: [Solved] why does boot process change /opt ownership to root?
« Reply #17 on: October 20, 2020, 05:46:26 AM »
As an exercise I've booted with "base" bootcode and
Code: [Select]
cd /
rm -r home

without sudo and any problems.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1509
Re: [Solved] why does boot process change /opt ownership to root?
« Reply #18 on: October 20, 2020, 09:06:40 AM »
I think the change is fine, added to git.
Yay! :)

curaga, I realized later that we can accomplish the same result with one line instead of two, like this:
Code: [Select]
    yes n | cp -ai /opt/* /opt/.[!.]* "$MOUNTPOINT"/opt/ 2>/dev/null
This is a more elegant change (more efficient, keeps line count the same). I've tested it in my remastered TCL and it works exactly as intended.



Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: [Solved] why does boot process change /opt ownership to root?
« Reply #19 on: October 20, 2020, 01:08:01 PM »
User tc has sudo access without a password, so access to the root dir doesn't really harm anything.
The only barriers that can stop you are the ones you create yourself.