version 1.49, 2018/07/09 21:35:50 |
version 1.50, 2019/06/28 13:35:04 |
|
|
* are no system-wide files. |
* are no system-wide files. |
*/ |
*/ |
if (!rhosts_files[rhosts_file_index] && |
if (!rhosts_files[rhosts_file_index] && |
stat(_PATH_RHOSTS_EQUIV, &st) < 0 && |
stat(_PATH_RHOSTS_EQUIV, &st) == -1 && |
stat(_PATH_SSH_HOSTS_EQUIV, &st) < 0) { |
stat(_PATH_SSH_HOSTS_EQUIV, &st) == -1) { |
debug3("%s: no hosts access files exist", __func__); |
debug3("%s: no hosts access files exist", __func__); |
return 0; |
return 0; |
} |
} |
|
|
* Check that the home directory is owned by root or the user, and is |
* Check that the home directory is owned by root or the user, and is |
* not group or world writable. |
* not group or world writable. |
*/ |
*/ |
if (stat(pw->pw_dir, &st) < 0) { |
if (stat(pw->pw_dir, &st) == -1) { |
logit("Rhosts authentication refused for %.100s: " |
logit("Rhosts authentication refused for %.100s: " |
"no home directory %.200s", pw->pw_name, pw->pw_dir); |
"no home directory %.200s", pw->pw_name, pw->pw_dir); |
auth_debug_add("Rhosts authentication refused for %.100s: " |
auth_debug_add("Rhosts authentication refused for %.100s: " |
|
|
/* Check users .rhosts or .shosts. */ |
/* Check users .rhosts or .shosts. */ |
snprintf(buf, sizeof buf, "%.500s/%.100s", |
snprintf(buf, sizeof buf, "%.500s/%.100s", |
pw->pw_dir, rhosts_files[rhosts_file_index]); |
pw->pw_dir, rhosts_files[rhosts_file_index]); |
if (stat(buf, &st) < 0) |
if (stat(buf, &st) == -1) |
continue; |
continue; |
|
|
/* |
/* |