1 |
On Sunday 03 June 2007, Dan Cowsill wrote: |
2 |
> Hey list, |
3 |
> |
4 |
> It has been a constant burden to me to have to change the file |
5 |
> permissions of files I've copied so that other users can access them |
6 |
> and modify them. Say I have a number of documents in the /root |
7 |
> folder which the root user owns. Now I want to transfer them to my |
8 |
> non-priveliged user so I can work on them... But I have to chown them |
9 |
> so that is possible. |
10 |
> |
11 |
> It just occured to me that there must be an easier way to do things |
12 |
> like this and I was wondering if you fine fellows could guide me down |
13 |
> the right path. |
14 |
|
15 |
A custom script? Maybe something like (named as chowncp) |
16 |
|
17 |
#!/bin/bash |
18 |
# |
19 |
chown $1 $2 |
20 |
cp $2 $3 |
21 |
|
22 |
Permissions would be something like x only for owner (root), called |
23 |
something like this: |
24 |
|
25 |
chowncp dan <file1> <file2> |
26 |
|
27 |
It's way incomplete, I'll let you figure out your own '[ -f ...' checks |
28 |
but you get the idea. |
29 |
|
30 |
I'm also sure ext3/reiser acls can force ownership of new files (it can |
31 |
do it for groups), but I'm way too lazy to figure it out right now, it |
32 |
being Friday and all... |
33 |
|
34 |
alan |
35 |
|
36 |
-- |
37 |
Optimists say the glass is half full, |
38 |
Pessimists say the glass is half empty, |
39 |
Developers say wtf is the glass twice as big as it needs to be? |
40 |
|
41 |
Alan McKinnon |
42 |
alan at linuxholdings dot co dot za |
43 |
+27 82, double three seven, one nine three five |
44 |
-- |
45 |
gentoo-user@g.o mailing list |