home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl
- use strict;
-
- my $target = $ARGV[2];
- my $pkg = $ARGV[0];
-
- #####################################################################################################
-
- my $permissions_info_file = "/tmp/com.apple.installation.savedperm";
- my @stat_info;
- my $MODE = 2;
- my $UID = 4;
- my $GID = 5;
-
- if(-e $permissions_info_file) {
- if(open(PERMS_FILE_HDL, "$permissions_info_file")) {
- while(<PERMS_FILE_HDL>) {
- my $item = $_;
- chomp($item);
- push(@stat_info, $item);
- }
- close(PERMS_FILE_HDL);
- unlink($permissions_info_file);
-
- chown($stat_info[$UID], $stat_info[$GID], $target);
- chmod($stat_info[$MODE] & 07777, $target);
- }
- } else {
-
- print "Couldn\'t find saved permissions file.";
-
- }
-
- exit 0;
-
- #####################################################################################################
-
-
-