changing UGO to ACLs on a file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users changing UGO to ACLs on a file
# 1  
Old 02-19-2009
changing UGO to ACLs on a file

Hello,

I have a directory and a list of files in it on which I'd like to set ACLs and quota.
To set ACLs regarding the UGO rights set at the moment, I haven't found any other way than grabbing the UGO rights set on the file with a shell cut command and then applying setfacl commands to that file
i.e :

-rwxr-xr-x toto

u=`ls -l toto | awk ' { print $1 } ' | cut -c2-4`
g=`ls -l toto | awk ' { print $1 } ' | cut -c5-7`
o=`ls -l toto | awk ' { print $1 } ' | cut -c8-10`

then ...
echo "setfacl -m u:$u,g:$g,o:$o toto" > /tmp/acllist

then
setfacl -f /tmp/acllist toto

Is there a way to transpose existing UGO rights onto ACLs directly on the file ?

Thanks a lot
# 2  
Old 02-22-2009
Humm. As far as I am aware, when you change UGO permissions using chmod or from within an application, the corresponding entry in both a minimum ACL or extended ACL object changes as well - so what you are doing should be unnecessary.
# 3  
Old 06-20-2009
The purpose is to set vxfs quota on existing files that have no particular ACL set. I have no other way than getting UGO permissions and change them to ACLs for to recalculate the exact quota usage on files for a usergroup, I will have to chgrp the group to which quota is set on ...
I'll try to explain this way :
at the moment I have this directory

drwxrwxr-x user1 grp1 toto -> no particular ACL
containing one of the files :
-rwxrwxr-x user2 grp2 file1 -> no particular ACL

To set the quota for grp1 and grp2 usergroups, I create a group named i.e "global" and set quota on it. I also recursively chown the owner and the "global" group of the files as the quota will be calculated on the "global" group. The old UGO permissions will be changed to ACL on folders and files to maintain the access rights set before.
This way, the files will UGO belong to an user that has unlimited quota, they will belong to the "global" group, and users still be able to access their files through the ACLS.

drwxrwxr-x uluser global toto -> acl set for user1 and grp1
containing one of the files :
-rwxrwxr-x uluser global file1 -> acl set for user2 and grp2
Quota calculated for global group

I'm aware that I will have to crontab a script that recursively propagate the "uluser" and "global" UGO permissions to calculate the quota on new files
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Unable to set ACLs on sulog - need to grant read permission to a normal user on AIX 6.1

Hi, I need to grant read permission to a normal user on sulog file on AIX 6.1. As root I did acledit sulog and aclget shows "extended permissions" as "enabled" and normal user "splunk" has read permissions. When I try to access sulog as splunk user it won't allow and aclget for splunk user... (6 Replies)
Discussion started by: prvnrk
6 Replies

2. Red Hat

Is there limit on number of ACLs' per directory in Redhat

I work on a distribution application on Linux which generates bulk reference data extract feeds and stores them on a Linux server. I have several consumer applications access the files stored on this Linux server using FTPS protocol. However in order for consumer applications to have access to... (2 Replies)
Discussion started by: waavman
2 Replies

3. Red Hat

ACLs - How can i create new executable files

Hello experts, I would like to know if is possible to create a default acl rule to a directory. in this directory all files created should have executable permissions by the group IT. i tried setfacl -m d:g:it:rwx /files tried to change the mask setfacl -m m::rwx /files but i still... (3 Replies)
Discussion started by: berveglieri
3 Replies

4. UNIX for Advanced & Expert Users

Does regular Linux installation in fact uses any ACLs in any file/dir?

Hi everybody As the title says I wonder if the usual (in my case Ubuntu 14.04 LTS) linux installation root does in fact uses any of the ACLs possible extensions in any of its files/dirs I ask this because I usually use tar to backup the entire root (in offline) with a command like this (root... (2 Replies)
Discussion started by: man-walking
2 Replies

5. Solaris

ZFS ACLS and vim

Hi, Does anyone know a way of making vim preserve ZFS NFSv4 ACLS? Without disabling file backups in vim that is. Thanks in advanced. (10 Replies)
Discussion started by: akame
10 Replies

6. Red Hat

Chmod overiding default ACLs.

Afternoon all, This should be a simple task. I have set up default acls on a directory to allow user user1 to read it. This directory is owned by root:root. setfacl -d -m u:user1:rx /directory I also did via the group. This works fine, new files made by root are readable. ... (4 Replies)
Discussion started by: snoop6060
4 Replies

7. Emergency UNIX and Linux Support

Squid acls

Hi guys, There is a line in squid default configuration: # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !SSL_ports acls are applied from top down, so CONNECT acl will deny access to all non SSL and SSL ports. I mean it never reaches the second access rule. (0 Replies)
Discussion started by: majid.merkava
0 Replies

8. UNIX for Dummies Questions & Answers

Changing file content based on file header

Hi, I have several text files each containing some data as shown below: File1.txt >DataHeader Data... Data... File2.txt >DataHeader Data... Data... etc. What I want is to change the 'DataHeader' based on the file name. So the output should look like: File1.txt >File1 ... (1 Reply)
Discussion started by: Fahmida
1 Replies

9. Shell Programming and Scripting

changing csv file contents to file of rows

i have a file a.txt contents as 1,2,3,4,......etc...in a single line, i want to write to another file in rows as 1 2 3 4 5 can u help? i do not know the length of a.txt (4 Replies)
Discussion started by: pravfraz
4 Replies
Login or Register to Ask a Question