|
Lines 654-670
PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags
Link Here
|
| 654 |
opts.ignore_root = 1; |
654 |
opts.ignore_root = 1; |
| 655 |
} |
655 |
} |
| 656 |
|
656 |
|
| 657 |
/* Ignoring root is probably best but the admin can allow it */ |
|
|
| 658 |
if (!strcmp(user_name, "root")) { |
| 659 |
if (opts.ignore_root) { |
| 660 |
info("Ignoring root user"); |
| 661 |
return PAM_IGNORE; |
| 662 |
} else { |
| 663 |
/* This administrator is crazy */ |
| 664 |
info("Danger!!! This is a connection attempt by root and ignore_root=0 is set! Hope for the best!"); |
| 665 |
} |
| 666 |
} |
| 667 |
|
| 668 |
/* Calculate buffer size for getpwnam_r */ |
657 |
/* Calculate buffer size for getpwnam_r */ |
| 669 |
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); |
658 |
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); |
| 670 |
if (bufsize == -1) |
659 |
if (bufsize == -1) |
|
Lines 684-689
PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags
Link Here
|
| 684 |
return PAM_SESSION_ERR; |
673 |
return PAM_SESSION_ERR; |
| 685 |
} |
674 |
} |
| 686 |
|
675 |
|
|
|
676 |
/* Ignoring root is probably best but the admin can allow it */ |
| 677 |
if (pwd.pw_uid == 0) { |
| 678 |
if (opts.ignore_root) { |
| 679 |
info("Ignoring root user"); |
| 680 |
return PAM_IGNORE; |
| 681 |
} else { |
| 682 |
/* This administrator is crazy */ |
| 683 |
info("Danger!!! This is a connection attempt by root (user id 0) and ignore_root=0 is set! Hope for the best!"); |
| 684 |
} |
| 685 |
} |
| 686 |
|
| 687 |
/* Check if there are any steps on the node from any user. A failure here |
687 |
/* Check if there are any steps on the node from any user. A failure here |
| 688 |
* likely means failures everywhere so exit on failure or if no local jobs |
688 |
* likely means failures everywhere so exit on failure or if no local jobs |
| 689 |
* exist. */ |
689 |
* exist. */ |
| 690 |
- |
|
|