#!/usr/athena/bin/perl

$fscmd = $ARGV[0];
shift;
  if($ARGV[0]=~/neg/) { $neg = "-negative";
  shift;}
  else {$neg = "";}
$group = $ARGV[0];
$perms = $ARGV[1];

$odir = `pwd`;
chop($odir);
&fsdir($odir);


sub fsdir {
	local($d) = @_;
	local(@fasd);

	$level++;
	$response = `fs la $d`;
	$response =~ /system:anyuser (\w+)/;
	$access = $1;
	if($access=~/r/){
		print("Directory $d:  $access\n") if $level >3;
	}
	opendir(ID, $d);
	$dit = ".";
	while($dit ne "") {$dit =readdir(ID);
	push(@fasd, $dit); }
	closedir(ID);
	foreach $p (@fasd) {
		if((-d $d."/".$p) && ($p ne ".") && ($p ne "..") && ($p ne "")) {
			$nd = $d."/".$p;
			&fsdir($nd) if $level < 4;
		}
	}
	$level--;
}
#  #   Let tomcat know when I fix this up
