Lines Matching +full:sub +full:- +full:groups

42 # where the 0700 denotes "octal 7-0-0".
48 # &B_chmod ("u-s" , "/bin/mount")
50 # &B_chmod ("go-rwx", "/bin/mount")
55 # the permissions to the pre-Bastille state.
62 sub B_chmod($$) {
74 if ($new_perm =~ /([ugo]+)([+-]{1})([rwxst]+)/) {
105 # the current permissions, by OR-ing (for +) or XOR-ing (for -).
172 elsif ($add_remove eq '-') {
187 if ( -e $file ) {
191 # if the distribution is HP-UX then the modifications should
193 if(&GetDistro =~ "^HP-UX"){
196 # making changes revert-able
222 # where the 0700 denotes "octal 7-0-0".
232 sub B_chmod_if_exists($$) {
241 if ( -e $file_expr ) {
254 # the file/directory owner to the pre-Bastille state.
264 sub B_chown($$) {
284 if ( -e $file ) {
289 # if the distribution is HP-UX then the modifications should
291 if(&GetDistro =~ "^HP-UX"){
294 # making ownership change revert-able
315 sub B_chown_link($$){
328 &B_log("ACTION","chown -h $newown,\"$original_file\";\n");
329 if ( -e $file ) {
331 `$chown -h $newown $file`;
334 # if the distribution is HP-UX then the modifications should
336 if(&GetDistro =~ "^HP-UX"){
339 # making ownership change revert-able
340 &B_revert_log("$chown -h $oldown $file\n");
362 # the file/directory group to the pre-Bastille state.
372 sub B_chgrp($$) {
392 if ( -e $file ) {
397 # if the distribution is HP-UX then the modifications should
399 if(&GetDistro =~ "^HP-UX"){
423 sub B_chgrp_link($$) {
435 &B_log("ACTION","chgrp -h $newgown \"$original_file\";\n");
436 if ( -e $file ) {
438 # do not follow link with option -h
439 `$chgrp -h $newgown $file`;
442 # if the distribution is HP-UX then the modifications should
444 if(&GetDistro =~ "^HP-UX"){
447 # making ownership change revert-able
448 &B_revert_log("$chgrp" . " -h $oldgown $file\n");
472 sub B_userdel($) {
476 if (&GetDistro =~ /^HP-UX/) {
479 # Not yet suported on HP-UX, where we'd need to support
508 # Next find out what groups the user is in, so we can call
514 my @groups = ();
523 # Parse the line -- first field is group, last is users in group.
532 push @groups,$group;
540 # Now remove the user from each of those groups.
541 foreach my $group (@groups) {
551 # We should delete the user's group as well, if it's a single-user group.
569 sub B_groupdel($) {
593 # ":\s*$user\s*," --> ":"
594 # ",\s*$user" -> ""
598 sub B:remove_user_from_group($$) {
676 sub B_check_owner_group ($$$){
679 if (-e $fileName) {
709 sub B_is_unowned_file($) {
722 sub B_is_ungrouped_file($){
748 sub B_check_permissions ($$){
753 if (-e $fileName) {
796 # this sub routine test whether the $user has the specified previlige to $file
799 sub B_permission_test($$$){
802 if (-e $file ) {
873 sub B_find_homes(){
876 my @lines = `$logins -ox`;
901 sub B_is_executable($)
906 if (-x $name) {
915 # This routine reports on whether a file is Set-UID and owned by root.
923 sub B_is_suid($)
930 if (-u $name) #Checks existence and suid
952 sub B_is_sgid($)
959 if (-g $name) #checks existence and sgid
976 sub B_get_user_list()
993 # This routine outputs a list of groups on the system.
997 sub B_get_group_list()
999 my @groups;
1002 #Get the groups
1005 push (@groups,$1);
1008 return @groups;
1025 sub B:remove_suid($) {
1034 if(-e $file){
1041 my $new_perm = ((($old_perm_raw/512) % 8 ) - 4) .