View previous topic :: View next topic |
Author |
Message |
nivw Apprentice
Joined: 09 Nov 2005 Posts: 261
|
Posted: Tue Jul 11, 2006 4:43 pm Post subject: how to use ACL to prevent file overwrite? |
|
|
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 |
|
|
lnxz Guru
Joined: 03 Jul 2005 Posts: 472 Location: Earth
|
Posted: Tue Jul 11, 2006 4:51 pm Post subject: |
|
|
If you use bash
should prevent that. |
|
Back to top |
|
|
nivw Apprentice
Joined: 09 Nov 2005 Posts: 261
|
Posted: Tue Jul 11, 2006 4:55 pm Post subject: |
|
|
sweet!
any practical guide I should read about ACL? |
|
Back to top |
|
|
lnxz Guru
Joined: 03 Jul 2005 Posts: 472 Location: Earth
|
Posted: Tue Jul 11, 2006 6:10 pm Post subject: |
|
|
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 |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Tue Jul 11, 2006 8:05 pm Post subject: |
|
|
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 |
|
|
|