Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to use ACL to prevent file overwrite?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
nivw
Apprentice
Apprentice


Joined: 09 Nov 2005
Posts: 261

PostPosted: Tue Jul 11, 2006 4:43 pm    Post subject: how to use ACL to prevent file overwrite? Reply with quote

Hay,
I read some about ACL , but couldnt find how to protect files from being overwriten.

May main goal is to protect /etc/portage/package.keywords from being overwriten when I do this:
echo <package> ~x86 >>/etc/portage/package.keywords

sometimes I forget the >> and do only >

Any idea?
Back to top
View user's profile Send private message
lnxz
Guru
Guru


Joined: 03 Jul 2005
Posts: 472
Location: Earth

PostPosted: Tue Jul 11, 2006 4:51 pm    Post subject: Reply with quote

If you use bash
Code:
set -C

should prevent that.
Back to top
View user's profile Send private message
nivw
Apprentice
Apprentice


Joined: 09 Nov 2005
Posts: 261

PostPosted: Tue Jul 11, 2006 4:55 pm    Post subject: Reply with quote

sweet!
any practical guide I should read about ACL?
Back to top
View user's profile Send private message
lnxz
Guru
Guru


Joined: 03 Jul 2005
Posts: 472
Location: Earth

PostPosted: Tue Jul 11, 2006 6:10 pm    Post subject: Reply with quote

Don't know about any guides besides those one might find with $search_engine, but there's always man acl/setfacl.
Also, I forgot to mention that set -C has nothing to do with ACL (just in case you didn't know).
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Tue Jul 11, 2006 8:05 pm    Post subject: Reply with quote

You can use chattr to change the attributes of the file. Specifically, the following command will allow the file to be appended to but will not allow you to overwrite the file.
Code:
chattr +a /etc/portage/package.keywords
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum