diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:09:58 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-02-10 02:40:16 +0000 |
commit | b63620615d5c8af09e350608233f69191ad6c275 (patch) | |
tree | 6123216785c35d73925aaec0d3c2e3f366edc2b9 /auth-rhosts.c | |
parent | efe70e315cfcc70e765ebd070e83528a6be6c125 (diff) |
Allow harmless group-writability
Allow secure files (~/.ssh/config, ~/.ssh/authorized_keys, etc.) to be
group-writable, provided that the group in question contains only the file's
owner. Rejected upstream for IMO incorrect reasons (e.g. a misunderstanding
about the contents of gr->gr_mem). Given that per-user groups and umask 002
are the default setup in Debian (for good reasons - this makes operating in
setgid directories with other groups much easier), we need to permit this by
default.
Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1060
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314347
Last-Update: 2013-09-14
Patch-Name: user-group-modes.patch
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); |