Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 26 Nov 2014, 06:08
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Write permissions ignored [SOLVED]
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Author Message
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Mon 14 Mar 2011, 18:20    Post_subject:  Write permissions ignored [SOLVED]  

Hi

I've used Linux for some time but I've only recently been playing with Puppy Linux. In fact with this latest 5.20 release I'm using it more than my regular installed distro; it's a great piece of work, well done.

I just attempted to stop a game from writing to its rcfile and so I set the permissions to r--r--r-- i.e. 444, but the game still kept modifying it and I did too by opening it in Geany, modifying it and saving it back out. I know that everything's root:root, but is this behaviour correct?

Cheers,
Thunor

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Tue 15 Mar 2011, 08:57    Post_subject:  

Well, I guessed either I've asked a question that's been asked a million times before or I've underestimated the power of the superuser Very Happy

I've just tested this in a regular Linux installation and indeed when you are root, permissions are ignored. You can set permissions to 000 and it makes no difference with what you can do to it. I didn't know that!
Back to top
View user's profile Send_private_message Visit_website 
Shep

Joined: 08 Nov 2008
Posts: 851
Location: GIRT-BY-SEA

PostPosted: Tue 15 Mar 2011, 11:23    Post_subject:  

Yes, operating as root poses a hazard in not having the file permissions recognized!
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6458
Location: Auckland, New Zealand

PostPosted: Fri 18 Mar 2011, 20:21    Post_subject:  

Maybe you can run the game as another user.
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
PupGeek

Joined: 06 Sep 2009
Posts: 388

PostPosted: Sat 19 Mar 2011, 17:50    Post_subject:  

Another idea is to make a backup copy of the *rc file named with a .bak extension and write a script to copy the backup copy to the original *rc file before executing the program in question. It will perform as though it didn't write to the *rc file because you keep going back to the earlier one. If you want to be even more sophisticated you can include an option to save any changes the program made or not in the script to run when you close the program. Shell scripting makes almost anything like that doable.
Back to top
View user's profile Send_private_message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Sat 19 Mar 2011, 20:42    Post_subject:  

How to make a file immutable. Root cannot modify it or even delete it.
Except with chattr to put attributes back.

Code block demonstrates

Code:
[/mnt/sda2/lupu] chattr +i isolinux.cfg
[/mnt/sda2/lupu] lsattr
-------------- ./lupu-520.iso.md5
----i--------- ./isolinux.cfg
-------------- ./lupu-520.iso
-------------- ./boot.msg
-------------- ./help.msg
-------------- ./help2.msg
[/mnt/sda2/lupu] rm isolinux.cfg
rm: remove write-protected regular file `isolinux.cfg'? y
rm: cannot remove `isolinux.cfg': Operation not permitted
[/mnt/sda2/lupu]


~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6458
Location: Auckland, New Zealand

PostPosted: Sat 19 Mar 2011, 21:03    Post_subject:  

I get this error
Code:
/# chattr +i NewFile
chattr: Inappropriate ioctl for device while reading flags on NewFile

Google indicates this normally occurs when the file system is not ext2/ext3... I wonder what it means otherwise.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Sat 19 Mar 2011, 21:16    Post_subject:  

disciple wrote:
I get this error
Code:
/# chattr +i NewFile
chattr: Inappropriate ioctl for device while reading flags on NewFile

Google indicates this normally occurs when the file system is not ext2/ext3... I wonder what it means otherwise.


» don't keep trying expecting to get a different result, you are stuck

» I worked around it one time by rebooting, then immediately running
the command

» Some other workaround suggestions available, if I can find a kid to
advise me

» Maybe helps if not a zero byte file, I've not tested that

~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6458
Location: Auckland, New Zealand

PostPosted: Sat 19 Mar 2011, 21:27    Post_subject:  

Quote:
» Maybe helps if not a zero byte file, I've not tested that

FWIW it's not a zero byte file.

I'm not worried - I was just trying it out.
It works on files on my ext3 partition, just not in my ext2 save file (which is stored on a FAT partition, although I don't think that should matter.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Sat 19 Mar 2011, 22:56    Post_subject:  

disciple wrote:
Quote:
» Maybe helps if not a zero byte file, I've not tested that

FWIW it's not a zero byte file.

I'm not worried - I was just trying it out.
It works on files on my ext3 partition, just not in my ext2 save file (which is stored on a FAT partition, although I don't think that should matter.


It matters to me. I just tried it on Lupu 5.20 with a ext3 save file stored on an ext3 partition and it didn't work.

chattr is tool used in hardening your Linux, if it doesn't work, I suppose it is not configured to work.

I'll test things by running an actual Linux live CD. But, not a Linux I expect to be crippled or missing standard functions.

I'll report back.

~

_________________
New! Puppy Linux Links Page

Edited_time_total
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6458
Location: Auckland, New Zealand

PostPosted: Sat 19 Mar 2011, 23:15    Post_subject:  

FWIW if I mount my backup save file (by clicking on it in Rox) it works on files in that.

So I guess it is related to unionfs or something...

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6458
Location: Auckland, New Zealand

PostPosted: Sat 19 Mar 2011, 23:35    Post_subject:  

Ah. Of course. Unionfs is not ext2/3, therefore it does not work. If I go to /initrd/pup_rw then it works.
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Sat 19 Mar 2011, 23:44    Post_subject:  

disciple wrote:
Ah. Of course. Unionfs is not ext2/3, therefore it does not work. If I go to /initrd/pup_rw then it works.


Interesting. Nuances, good catch and workaround.

Here are my test results

I used a Live CD (smaller than Puppy Lupu)

Filename: Bootable ISO (RIPLinux-11.6-non-X.iso)

RIP LinuX home page

The test was successful.

If thunor is still reading, the complaint is solved. Well, thunor what will it
be?

~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send_private_message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Mon 21 Mar 2011, 01:53    Post_subject:  

disciple wrote:
Ah. Of course. Unionfs is not ext2/3, therefore it does not work. If I go to /initrd/pup_rw then it works.


yeah..doesn't work on pen drive for the same reason. Interesting command though...new to me. I'm surprised it isn't used more. I can think of lots of ways to employ it (like preventing permissions from getting overwritten and breaking cups, etc)

edit: I tested on some root:nobody cups files, such as /etc/printer.conf, and the printer works. Overwriting "nobody" permissions is the most common cause of cups breaking.
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2278

PostPosted: Mon 21 Mar 2011, 02:24    Post_subject:  

"I'll test things by running an actual Linux live CD. But, not a Linux I expect to be crippled or missing standard functions."
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0784s ][ Queries: 11 (0.0041s) ][ GZIP on ]