# linuxBrowseUserSpaceRestrictions.pl # # by Dean Giles # Version 1.0 # Jan 30, 2008 # # This Perl script lists all users on a specified volume with user space restrictions. # # This script has been designed to be run on Linux. # The API set can be downloaded from http://developer.novell.com/wiki/index.php/Virtual_File_Services_for_NetWare. # # The Perl script requires the name of an NSS pool, a storage pool, and the name of the new snapshot # as input. It requires that NSS be installed and an NSS pool be present. # { # User help function if (@ARGV < 2 || $ARGV[0] eq "/?" || $ARGV[0] eq "-?") { print "USAGE: perl linuxBrowseUserSpaceRestrictions.pl VOLUME_NAME\n"; print "Where VOLUME_NAME is the name of a volume on the server. \n"; print "and where USER_NAME is the dot delimited distinguished edir name of the user."; print "Example: perl linuxBrowseUserSpaceRestrictions.pl VOL1 user1.novell \n"; print "this will list all users on the specified volume with user space restrictions\n"; exit; } # Global Variables $volumeName = $ARGV[0]; $userName = $ARGV [1]; $file = "+". "". "". "". "$volumeName". "$userName". "". "". ""; # This is the command for initializing the virtual file for sending a command. print "File Name: $file \n"; print "Request Sent: $command \n"; if (!syswrite(NSSFILE, $command, length($command))) #Initialize the nss management file and write a command. { seek NSSFILE, 0, 0; # Make sure to start at the beginning of the file. sysread (NSSFILE, $error, 10000); #Read the error message. print "Error writing initialization to management file. \n"; print "$error \n\n"; #Print the error message to the screen. close (NSSFILE); } else { seek NSSFILE, 0, 0; # Make sure to start at the beginning of the file. sysread (NSSFILE, $reply, 10000); #Read the reply. print "$reply \n\n"; #Print the reply to the screen. close (NSSFILE); } }