Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Technical issues/questions of an intermediate or advanced nature.

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Yes, because at least the system doesn't get broken.
4
50%
No, because no one should use rootcopy in a non-POSIX file system.
2
25%
I don't care or I don't understand the relevance of this.
2
25%
 
Total votes: 8

fulalas
DEV Team
DEV Team
Posts: 2050
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#1 by fulalas » 18 Aug 2020, 06:46

I need your feedback on this, guys. But first let me introduce you the idea behind it :)

When we put files inside rootcopy folder that is stored in a non-POSIX file system (i.e. non-Unix, like FAT or NTFS), what Porteus has always been doing during boot is copying all this content with the following permission:

For files:

Code: Select all

-rwxrwxrwx guest root
For folders:

Code: Select all

drwxrwxrwx guest root
This happens as a convention because non-POSIX partitions don't have support for file/folder permission.

The problem is: when Porteus is copying these files/folders from a non-POSIX rootcopy it's also changing the file permission of the destination.

Let's get one real case example to illustrate: VirtualBox. It's known for being very sensitive to its files/folders permissions to the point it may simply refuse to run or boot a VM if it detects that some permission is different from what it expects. So imagine you want to put in your non-POSIX rootcopy folder some file in rootcopy/opt. What will happen after boot is that /opt folder will have the following permission:

Code: Select all

drwxrwxrwx guest root
Instead of the expected:

Code: Select all

drwxr-xr-x root root
Because of that, as you might expect, VirtualBox will refuse to work properly.

My idea to work around this issue is to simply copy all non-POSIX rootcopy content without changing any system folder destination permission. Of course, this behavior won't apply to POSIX file system (i.e. Unix partitions).

Let me know if you think this is reasonable or dangerous or anything that comes to your mind :)

User avatar
Ed_P
Contributor
Contributor
Posts: 8359
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#2 by Ed_P » 18 Aug 2020, 19:27

I boot from ISOs and my files; modules, changes, optional, reside on NTFS partitions. This senario has worked for me for many years, if your change stops this from working I am against it. :)
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2067
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#3 by donald » 18 Aug 2020, 19:36

Hmm...(to) prevent system permission changes means not to allow changing the permissions,right?

[poll]
Because of the wording I'm not sure which answer is the right one.

I vote for:
Yes,(porteus should prevent permission changes),..no one should use rootcopy
in a non-POSIX file system.

On the other hand, I don't care because I only use ext file systems.. :)

fulalas
DEV Team
DEV Team
Posts: 2050
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#4 by fulalas » 18 Aug 2020, 20:37

@Ed_P, me too. But you're changing system file permissions without even noticing. If you put something inside your rootcopy/opt and try to use VirtualBox, it won't work properly. And that's just one example. Changing system permissions is not a good option.

@donald, yes, it's to not allow system permissions to change after rootcopy in non-POSIX file system.

I understand that by using a non-POSIX file system the user is extending compatibility, since FAT, for instance, can be read by basically all systems, including TVs and stereos, while Unix partitions are more restricted. I wish I could use FAT, but it doesn't support symlinks, so I have to use NTFS, which is not 100% compatible, but at least it's way better than any POSIX partition.

donald
Full of knowledge
Full of knowledge
Posts: 2067
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#5 by donald » 18 Aug 2020, 21:21

@fulalas
I understand that FAT/NTFS is more compatible to whatever.
But I don't understand the relevance...

I put an OS onto an USB-drive and run the OS the best way possible.
It's Linux, so install it with a suitable filesystem.
Folder / file permissions / attributes must be observed.

Do this drive have to be compatible? - with what? - a TV? --
In the rare case i have to transfer files to a windows PC or car stereo or whatever,
I reach into a box full of older USB sticks and take one.(FAT formatted)
Who has only one USB-thumb drive these days?

fulalas
DEV Team
DEV Team
Posts: 2050
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#6 by fulalas » 19 Aug 2020, 08:56

@donald, different people, different needs :)

User avatar
Blaze
DEV Team
DEV Team
Posts: 3882
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#7 by Blaze » 19 Aug 2020, 11:58

If this trash support on the FAT/NTFS fs, I vote YES.
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

fulalas
DEV Team
DEV Team
Posts: 2050
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#8 by fulalas » 19 Aug 2020, 22:24

@Blaze, it's not related.

@all, my main question here is: would it hurt to provide better support for rootcopy in non-POSIX file systems?

donald
Full of knowledge
Full of knowledge
Posts: 2067
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#9 by donald » 19 Aug 2020, 22:35

How exactly do you want to do that?

fulalas
DEV Team
DEV Team
Posts: 2050
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#10 by fulalas » 19 Aug 2020, 23:34

I already told you: just need to not change file system permissions when restoring rootcopy stored in non-POSIX partitions. :)

donald
Full of knowledge
Full of knowledge
Posts: 2067
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#11 by donald » 20 Aug 2020, 00:14

Yes, but how?
I would like to read / understand how you want to achieve this.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3932
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#12 by ncmprhnsbl » 20 Aug 2020, 02:56

let me see if can distill this down:
presently when rootcopy is loaded at boot: (this is all scripted in initrd: see /mnt/live/linuxrc)
it copies preserving attributes( cp -af) , which is exactly what you want with POSIX.
there is nothing at the moment to prevent rootcopy coming from a nonPOSIX source, which then causes wrong attributes. ie. eg. ntfs has one set of bogus permissions rxwrwxrwx read/write/execute anybody ..
fulalas proposal (aiui) is to :
1. detect the source filesystem
2. if it's nonPOSIX ) just use cp -rf ...thus the files/folders then take on the permissions of the system folders.. which is less wrong but still wrong
3. if it's POSIX cp -af is used
what i would rather see:
1. nonPOSIX rootcopy disabled by default ie. just won't work at all
2. if the above(allow nonPOSIX) is to be entertained, it should enabled specifically via a cheatcode : eg ntfs-rootcopy (with appropriate admonitions in cheatcodes document)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

roadie
Full of knowledge
Full of knowledge
Posts: 400
Joined: 02 Jan 2011, 18:41
Distribution: Porteus 5.0-RC1
Location: In a hayfield

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#13 by roadie » 20 Aug 2020, 04:15

I think a method of using a cheatcode would be fine, better than just instituting a change. I never use a non-POSIX filesystem, so I'll admit my bias up front. I want reliabilty and having seen what can happen with FAT32 and .dat savefiles, no thanks. It's already set up in linuxrc to detect a non-POSIX so maybe not too hard to add for a cheatcode.

Maybe I've missed it, but I don't recall rootcopy being advocated much, let alone on a non-POSIX filesystem, just .dat savefiles. I use rootcopy exclusively, have for a long time and consider it one of the best features of Porteus. Especially if you're hacking things, very easy to move files into rootcopy and take it for a spin. If it works, move them into the new build.

I agree with the cheatcode idea because I'm currently fighting whatever is changing attributes on my latest shiny thing. I'd much rather have choice, than something just being done and that's the way it is.

User avatar
Ed_P
Contributor
Contributor
Posts: 8359
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#14 by Ed_P » 20 Aug 2020, 05:51

ncmprhnsbl wrote:
20 Aug 2020, 02:56
what i would rather see:
1. nonPOSIX rootcopy disabled by default ie. just won't work at all
2. if the above(allow nonPOSIX) is to be entertained, it should enabled specifically via a cheatcode : eg ntfs-rootcopy (with appropriate admonitions in cheatcodes document)
I vote for this idea.
Ed

User avatar
babam
Warlord
Warlord
Posts: 528
Joined: 16 Nov 2016, 10:30
Distribution: Porteus 5.0rc3 Xfce K6.1.1
Location: Rainy city

Should Porteus prevent system permission changes when rootcopy is stored in non-POSIX file system?

Post#15 by babam » 20 Aug 2020, 06:23

Should not use Rootcopy on non-POSIX filesystem.
Sorry, my English is bad.

Post Reply