cannot copy to /system (or other root folders)

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
mastabog
Junior Member
Junior Member
Posts: 72
Joined: 2004-03-07, 21:36 UTC

cannot copy to /system (or other root folders)

Post by *mastabog »

Hi,

I've had this bug since early RC stages. Even though I'm rooted and I enabled root functions everywhere in TC, and I also manually remounted /system from .R to .RW, I still cannot copy files from the other panel or from clipboard into such folders. There is no error when copying. It just doesn't do it. It applies to other such folders like /data.

I compared to other file managers like ES File Manager and they don't have a problem writing files in those folders.

This is at the moment the biggest annoyance I have with TC for android. Otherwise it's truly great!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48072
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Please open the context menu of the /system folder and check what permissions it has. Make sure to set the "w" permissions for user, group, and other. I guess that ES file manager does this automatically when you try to write to a protected folder, but I think that this is quite risky. These folders are read only for a good reason.
Author of Total Commander
https://www.ghisler.com
mastabog
Junior Member
Junior Member
Posts: 72
Joined: 2004-03-07, 21:36 UTC

Post by *mastabog »

I would think pretty much all users who root their phones are aware of the risks. I wouldn't have done it and activated the option of root functions everywhere otherwise.

The /system folder has 755 permissions but I'm not trying to write to /system. I'm trying to write to /data/local (for instance), which also has 755. I see TC has a button to remount into .RW mode from .R mode, which I activated.

Please correct me if I'm misinterpreting, but why offer the option to enable root functions everywhere and also the option to remount in .RW mode if you don't allow writing to / or /system folders?

The behaviour and attitude of ES File Explorer is correct in my opinion. It has two options in the menu "Root explorer" and "Mount file system" (the latter mounts / and /system as writable). It gives a warning when activating them. That's the correct attitude, i.e. leave the choice to the user, don't make it for him. TC should do the same.

Would you please consider implementing an option to mount system folders as writeable?
User avatar
dindog
Senior Member
Senior Member
Posts: 315
Joined: 2010-10-18, 07:41 UTC

Post by *dindog »

I don't think that is wise to offer universal root access by default.

too dangerous.
mastabog
Junior Member
Junior Member
Posts: 72
Joined: 2004-03-07, 21:36 UTC

Post by *mastabog »

dindog wrote:I don't think that is wise to offer universal root access by default.

too dangerous.
It's not by default at all ... it's a user's choice since they would have to select it in the options. Whoever roots their phone knows the risks too. it would be an optional feature. Warn but leave the choice to the user, don't make it for him.

Right now it seems TC is not capable of writing to certain folders at all, be it by default or not. Maybe I'm missing something but can you tell me how I can use TC to write a file to /data/local for instance? (without manually remounting using external means)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48072
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Right now it seems TC is not capable of writing to certain folders at all, be it by default or not.
I have already explained that this is a question of the rights YOU set for these folders. There are actually 3 precautions by the system to prevent accidental modification of files in system areas:

1. The tree is separated in various separate file systems like /system and /data. You need to make sure (with the mount button) that the file system is not read only, but allows reading+writing (rw).
2. The folder needs to have write rights, so users can add or delete files
3. If you want to modify an existing file, you also need write rights for that file

These rights aren't there for fun - otherwise they could have used something like FAT32 which does not handle user rights at all. Therefore TC respects these rights and doesn't change them by itself. It's very dangerous to just ignore these rights and write to locations which are actually write protected.

I'm considering to show a warning that the target is write protected, and give the user the option to unprotect it. But doing this without asking is going too far.
Author of Total Commander
https://www.ghisler.com
mastabog
Junior Member
Junior Member
Posts: 72
Joined: 2004-03-07, 21:36 UTC

Post by *mastabog »

ghisler(Author) wrote:These rights aren't there for fun - otherwise they could have used something like FAT32 which does not handle user rights at all. Therefore TC respects these rights and doesn't change them by itself. It's very dangerous to just ignore these rights and write to locations which are actually write protected.

I'm considering to show a warning that the target is write protected, and give the user the option to unprotect it. But doing this without asking is going too far.
I never said that write access should be the default. Why are you both implying that? I specifically suggested to warn but leave the choice to the user by offering such an option.

All of us who root our phones are aware of the risks and we root it for one reason: to be *less* restricted than Google intended. You seem to have already acknowledged that (though only partly) since you do have an option called "Root functions everywhere".

If you want to gain more user-base, i.e. those of use who want to use TC for writing to protected dirs, then just add the option for us to enable to do so (warn and shout beforehand if you wish, we won't mind). ES File Explorer did, but TC has so much more potential in many respects.

I don't know how much clearer I can be. It's just a suggestion for a much needed feature for advanced users. I'm not looking to have an argument ...
User avatar
dindog
Senior Member
Senior Member
Posts: 315
Joined: 2010-10-18, 07:41 UTC

Post by *dindog »

mastabog wrote:
dindog wrote:I don't think that is wise to offer universal root access by default.

too dangerous.
It's not by default at all ... it's a user's choice since they would have to select it in the options. Whoever roots their phone knows the risks too. it would be an optional feature. Warn but leave the choice to the user, don't make it for him.

Right now it seems TC is not capable of writing to certain folders at all, be it by default or not. Maybe I'm missing something but can you tell me how I can use TC to write a file to /data/local for instance? (without manually remounting using external means)
get the right to edit is one thing, universal is another.

I bet many people been root and modified file in system, even they do that wrong, they can flash the rom again and fixed everything... but not the case with some other folder, and I don't believe all people knowing that
mastabog
Junior Member
Junior Member
Posts: 72
Joined: 2004-03-07, 21:36 UTC

Post by *mastabog »

dindog wrote:get the right to edit is one thing, universal is another.

I bet many people been root and modified file in system, even they do that wrong, they can flash the rom again and fixed everything... but not the case with some other folder, and I don't believe all people knowing that
Ok, on that note I think I won't upset strong opinions even further. Maybe Christian will (please) consider my suggestion: an option, with a warning, but an option nonetheless. A damn useful one. You would gain back this user.
dr.science
Junior Member
Junior Member
Posts: 4
Joined: 2012-06-07, 02:46 UTC

Post by *dr.science »

As I know, every file explorer for the android has a "mount system" option. I'm surprised that the TC has not. There must be such an option in a professional file explorer.
mastabog
Junior Member
Junior Member
Posts: 72
Joined: 2004-03-07, 21:36 UTC

Post by *mastabog »

dr.science wrote:As I know, every file explorer for the android has a "mount system" option. I'm surprised that the TC has not. There must be such an option in a professional file explorer.
Thank you. My point exactly.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48072
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Do you mean re-mounting a read only partition as read-write? This requires root rights. You can add a button to TC's toolbar which does this if your devices is rooted, by choosing "Root functions everywhere" in the settings.
Author of Total Commander
https://www.ghisler.com
dr.science
Junior Member
Junior Member
Posts: 4
Joined: 2012-06-07, 02:46 UTC

Post by *dr.science »

ghisler(Author) wrote:Do you mean re-mounting a read only partition as read-write? This requires root rights. You can add a button to TC's toolbar which does this if your devices is rooted, by choosing "Root functions everywhere" in the settings.
Thank you for the solution. It works.
But it would be nice to have a switcher in the settings menu:

Code: Select all

[ON]  mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
[OFF] mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
 
mastabog
Junior Member
Junior Member
Posts: 72
Joined: 2004-03-07, 21:36 UTC

Post by *mastabog »

dr.science wrote:
ghisler(Author) wrote:Do you mean re-mounting a read only partition as read-write? This requires root rights. You can add a button to TC's toolbar which does this if your devices is rooted, by choosing "Root functions everywhere" in the settings.
Thank you for the solution. It works.
But it would be nice to have a switcher in the settings menu:

Code: Select all

[ON]  mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
[OFF] mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
 
I think it is essential to have that as a menu option (which was my point all along) if TC is to be regarded as a powerful file manager. I understand it's an advanced feature, but otherwise there's little point in having other kind of "root functions everywhere" options to be honest.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48072
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Why a menu when you can have a button?
Author of Total Commander
https://www.ghisler.com
Post Reply