diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:09:58 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-08-07 12:18:43 +0100 |
commit | 563974a78e937c4844e1198b5f6d79b8b2b5c600 (patch) | |
tree | ab2b821031f9b3d4dac7123b677dd6e8a93ac4d3 /auth-rhosts.c | |
parent | 173d65e72989cba82502604da3f1336766c0cf0f (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 0ef344712..c17c13cc1 100644 --- a/auth-rhosts.c +++ b/auth-rhosts.c | |||
@@ -273,8 +273,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
273 | return 0; | 273 | return 0; |
274 | } | 274 | } |
275 | if (options.strict_modes && | 275 | if (options.strict_modes && |
276 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 276 | !secure_permissions(&st, pw->pw_uid)) { |
277 | (st.st_mode & 022) != 0)) { | ||
278 | logit("Rhosts authentication refused for %.100s: " | 277 | logit("Rhosts authentication refused for %.100s: " |
279 | "bad ownership or modes for home directory.", pw->pw_name); | 278 | "bad ownership or modes for home directory.", pw->pw_name); |
280 | auth_debug_add("Rhosts authentication refused for %.100s: " | 279 | auth_debug_add("Rhosts authentication refused for %.100s: " |
@@ -300,8 +299,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
300 | * allowing access to their account by anyone. | 299 | * allowing access to their account by anyone. |
301 | */ | 300 | */ |
302 | if (options.strict_modes && | 301 | if (options.strict_modes && |
303 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 302 | !secure_permissions(&st, pw->pw_uid)) { |
304 | (st.st_mode & 022) != 0)) { | ||
305 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", | 303 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", |
306 | pw->pw_name, buf); | 304 | pw->pw_name, buf); |
307 | auth_debug_add("Bad file modes for %.200s", buf); | 305 | auth_debug_add("Bad file modes for %.200s", buf); |