version 1.16, 2001/02/04 15:32:22 |
version 1.17, 2001/02/12 16:16:23 |
|
|
} |
} |
|
|
/* |
/* |
* Check if the user is logging in as root and root logins are disallowed. |
* Check whether root logins are disallowed. |
* Note that root login is _allways_ allowed for forced commands. |
|
*/ |
*/ |
int |
int |
auth_root_allowed(void) |
auth_root_allowed(char *method) |
{ |
{ |
if (options.permit_root_login) |
switch (options.permit_root_login) { |
|
case PERMIT_YES: |
return 1; |
return 1; |
if (forced_command) { |
break; |
log("Root login accepted for forced command."); |
case PERMIT_NO_PASSWD: |
return 1; |
if (strcmp(method, "password") != 0) |
} else { |
return 1; |
log("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr()); |
break; |
return 0; |
case PERMIT_FORCED_ONLY: |
|
if (forced_command) { |
|
log("Root login accepted for forced command."); |
|
return 1; |
|
} |
|
break; |
} |
} |
|
log("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr()); |
|
return 0; |
} |
} |