diff options
author | Colin Watson <cjwatson@debian.org> | 2010-05-22 22:43:47 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2010-05-22 22:43:47 +0100 |
commit | d61e316833eb7d05b0b5c937bfce8ee0f19dc7cb (patch) | |
tree | 5a2e2057bd64ca0825d5edf13e55128a2fb7cadb /auth-rhosts.c | |
parent | ec9f6c25d67f48277fe2ed56fa7773c7f6cf3580 (diff) |
Allow ~/.ssh/authorized_keys and other secure files to be
group-writable, provided that the group in question contains only the
file's owner; this extends a patch previously applied to ~/.ssh/config
(closes: #581919).
Diffstat (limited to 'auth-rhosts.c')
-rw-r--r-- | auth-rhosts.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/auth-rhosts.c b/auth-rhosts.c index 06ae7f0b9..f20278797 100644 --- a/auth-rhosts.c +++ b/auth-rhosts.c | |||
@@ -256,8 +256,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | if (options.strict_modes && | 258 | if (options.strict_modes && |
259 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 259 | !secure_permissions(&st, pw->pw_uid)) { |
260 | (st.st_mode & 022) != 0)) { | ||
261 | logit("Rhosts authentication refused for %.100s: " | 260 | logit("Rhosts authentication refused for %.100s: " |
262 | "bad ownership or modes for home directory.", pw->pw_name); | 261 | "bad ownership or modes for home directory.", pw->pw_name); |
263 | auth_debug_add("Rhosts authentication refused for %.100s: " | 262 | auth_debug_add("Rhosts authentication refused for %.100s: " |
@@ -283,8 +282,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
283 | * allowing access to their account by anyone. | 282 | * allowing access to their account by anyone. |
284 | */ | 283 | */ |
285 | if (options.strict_modes && | 284 | if (options.strict_modes && |
286 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 285 | !secure_permissions(&st, pw->pw_uid)) { |
287 | (st.st_mode & 022) != 0)) { | ||
288 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", | 286 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", |
289 | pw->pw_name, buf); | 287 | pw->pw_name, buf); |
290 | auth_debug_add("Bad file modes for %.200s", buf); | 288 | auth_debug_add("Bad file modes for %.200s", buf); |