Sponsored Content
Top Forums UNIX for Advanced & Expert Users changing UGO to ACLs on a file Post 302289315 by davchris on Thursday 19th of February 2009 09:01:42 AM
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
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
GETFACL(1)						    BSD General Commands Manual 						GETFACL(1)

NAME
getfacl -- get ACL information SYNOPSIS
getfacl [-dhinqv] [file ...] DESCRIPTION
The getfacl utility writes discretionary access control information associated with the specified file(s) to standard output. If the getconf(1) utility indicates that {_POSIX_ACL_EXTENDED} is not in effect for a file then the standard discretionary access permissions are interpreted as an ACL containing only the required ACL entries. The following option is available: -d The operation applies to the default ACL of a directory instead of the access ACL. An error is generated if a default ACL cannot be associated with file. This option is not valid for NFSv4 ACLs. -h If the target of the operation is a symbolic link, return the ACL from the symbolic link itself rather than following the link. -i For NFSv4 ACLs, append numerical ID at the end of each entry containing user or group name. Ignored for POSIX.1e ACLs. -n Display user and group IDs numerically rather than converting to a user or group name. Ignored for POSIX.1e ACLs. -q Do not write commented information about file name and ownership. This is useful when dealing with filenames with unprintable char- acters. -v For NFSv4 ACLs, display access mask and flags in a verbose form. Ignored for POSIX.1e ACLs. The following operand is available: file A pathname of a file whose ACL shall be retrieved. If file is not specified, or a file is specified as -, then getfacl reads a list of pathnames, each terminated by one newline character, from the standard input. For an explanation of the ACL syntax, see the setfacl(1) manual page. EXIT STATUS
The getfacl utility exits 0 on success, and >0 if an error occurs. EXAMPLES
getfacl / Retrieve ACL for the directory /. getfacl -d / Retrieve the default ACL for the directory /, if any. SEE ALSO
setfacl(1), acl(3), getextattr(8), setextattr(8), acl(9), extattr(9) STANDARDS
The getfacl utility is expected to be IEEE Std 1003.2c compliant. HISTORY
Extended Attribute and Access Control List support was developed as part of the TrustedBSD Project and introduced in FreeBSD 5.0. AUTHORS
Robert N M Watson BSD
September 4, 2009 BSD
All times are GMT -4. The time now is 09:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy