Script to find/apply Solaris 10 ACL's


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to find/apply Solaris 10 ACL's
# 1  
Old 11-16-2009
Script to find/apply Solaris 10 ACL's

This may be a question for a different forum, but as I will need a script I thought I would start here.

We recently migrated from Solaris 8 to Solaris 10. The file system in question here is ZFS, meaning the method for listing and applying ACL's has changed dramatically. To make a long story shorter - does anyone have or know of a script that will traverse a directory structure and collect the ACL's? By ACL's I mean the extended permissions given a file or object - (I include this because in Solaris 10/ZFS all file permissions are considered ACL's whereas with older versions of the OS only permissions granted with 'setfacl' were considered ACL's).

Thanks for any pointers,

Mike
# 2  
Old 11-16-2009
Code:
 find /PATH -exec ls -ld {} \; |grep "^..........+"

You can use getfacl to list these files ACL setting.
# 3  
Old 11-17-2009
Not on a ZFS file system - getfact/setfacl have been deprecated... replaced with chmod options for setfacl and ls options (vV) for getfacl.
# 4  
Old 11-19-2009
Code:
 
USER=$1
START=$2
ACL_LIST=$3
if [[ ${3} == "" ]]
then
        ACL_LIST=/tmp/acl_list.out
fi

find $START | xargs ls -ld  2>/dev/null |  grep "^..........+" 2>/dev/null > $ACL_LIST
for user in $USER
do
        echo "$user has the following ACL permissions:"
        for DIR in `cat $ACL_LIST | awk '{print $9}' `
        do
                ls -ldV $DIR | grep $user  > /dev/null 2>&1
                RET=$?
        
                if [[ ${RET} -eq 0 ]]
                then
                        echo ""
                        echo $DIR 
                        ls -ldV $DIR | grep $user
                        echo "" 
                fi
        done
done

Works for me...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Set ACL permissions Solaris

I want to set ACL permissions using this command in solaris 10 , but I get an error message. server# mkdir dir1 server# setfacl -m user:allan:rwx dir1 setacl error: Operation not applicable Any one can help in this matter. Please use CODE tags as required by forum rules! (2 Replies)
Discussion started by: AbuAliiiiiiiiii
2 Replies

2. UNIX for Beginners Questions & Answers

How to apply acl?

hi, i am facing problem with acls, as a root i logged in and applied acl for directory(dir5),by using command setfacl -m u:user1:rwx dir5 but when i logged in as user1 i am not able to access that folder even though i applied full permission to that directory as a root.can any one help me on... (2 Replies)
Discussion started by: cmanoj489
2 Replies

3. Solaris

ACL on the Solaris

we have two Solaris 10 servers with same configuration and settings. We have hard mounted the NFS with the version 4. In one of the server the newer ACL commands are working fine (chmod and ls -v) whereas in another only posix (getfacl and setfacl alone is working) when we try ls -V in in that... (13 Replies)
Discussion started by: sathishbabu89
13 Replies

4. Shell Programming and Scripting

help using find/xargs to apply mp3gain to files

I need to apply mp3gain (album mode) to all mp3 files in a given directory. Each album is in its own directory under /media/data/music/albums for example: /media/data/music/albums/foo /media/data/music/albums/bar /media/data/music/albums/more What needs to happen is: cd... (4 Replies)
Discussion started by: audiophile
4 Replies

5. Solaris

Apply Patch 119963-21 to Solaris 10 Sparc

Hi, One of the pre requirements o upgrade Netbackup 6.5.4 to 7.1 is to apply Patch 119963-21 to all media servers. My media servers are Oracle Databases ( e-business suite and for other 3rd party app ). I read the Patch 119963-21's README and there is no Install Requirements for this... (10 Replies)
Discussion started by: HishamN
10 Replies

6. Solaris

Solaris 10 ZFS ACL help

All, Does anyone know of a simple way to traverse a file system and collect all ACL's (or ACE's as they are called now)? We use to be able to use getfacl fairly easily for this task but now we are forced to use -v or -V with the 'ls' command to get the extended permissions for a... (1 Reply)
Discussion started by: Shoeless_Mike
1 Replies

7. Shell Programming and Scripting

Apply script to several archives in several Folders.

Hello. I'm here again. I have a script in python and bash, and I need execute this script over all files in all folders. Example: Folder: CMDB Subfolders: router1 router2 switch1 switch2 and in this folders exists a file called... (3 Replies)
Discussion started by: bobbasystem
3 Replies

8. Shell Programming and Scripting

ACL Analyzer Script

Hello, I am trying to make a bash script that will analyze and document Cisco (router) ACLs that will output a file with the source, destination, protocol, and ports (ports of the destination only) into a text file. The whole reason why all our current ACLs need to be documented is because we... (3 Replies)
Discussion started by: Okema
3 Replies

9. Filesystems, Disks and Memory

ACL problem due to mv command used in solaris

Hi All, Is there any way to use mv command and that should apply ACL on the moved files that is already set in distination location This mv command is running in a solaris system. File system is NFS. Problem I am facing : Currently mv command removes ACL from moved files and also it... (0 Replies)
Discussion started by: Tlogine
0 Replies

10. Linux

How to find and apply patches in RHAT linux?

Hi: This is an elementary qs. Thanks in advance, (4 Replies)
Discussion started by: bbose
4 Replies
Login or Register to Ask a Question