Ph.pl: A Permissions harvester for CFEngine

From Cfwiki

Jump to: navigation, search

Ph.pl

Permissions harvester for CFEngine.

Prints CFEngine file statements for each file/dir encountered onto STDOUT.

Typical usage is pipe files from a find to this script while capturing the output to a file, and then adding it to a CFEngine configuration file.

For instance:

    find / -type file | ./ph.pl -fc > newscript.cf

The purpose of this script is to enable an admin to take a snapshot of a new system and have CFEngine enforce the existing permissions.

Download from http://www.adamsinfoserv.com/software/ph.tar.gz

Output from "./ph.pl -h":

Permissions harvester for CFEngine.

usage: ph.pl [-fcih]

       -f              Use fix{plain,dir} instead of defaulting to warn.
       -c              Output checksum directive for each file.
       -h              This help screen.


Written by: Russell Adams <rladams@adamsinfoserv.com>

Licensed under GPLv2.

[Note to author of this page: if you're going to post a link to a tarball of your script, could you please include a version number in the tarball (like blahblah-1.00.tar.gz) so people can track updates? Also, I think it may still have a '@' in double-quoted string bug? Frankly, best would be if you just paste short scripts like this right into the wiki!]

Note This more or less does the same on linux:

 find / -type f -printf "%p o=%u g=%g mode=%m act=fixplain ch=md5\n"
Personal tools