diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.361 2008/06/14 15:49:48 dtucker Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.362 2008/06/14 17:07:11 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1245,6 +1245,7 @@ main(int ac, char **av) | |||
1245 | int remote_port; | 1245 | int remote_port; |
1246 | char *line, *p, *cp; | 1246 | char *line, *p, *cp; |
1247 | int config_s[2] = { -1 , -1 }; | 1247 | int config_s[2] = { -1 , -1 }; |
1248 | mode_t new_umask; | ||
1248 | Key *key; | 1249 | Key *key; |
1249 | Authctxt *authctxt; | 1250 | Authctxt *authctxt; |
1250 | 1251 | ||
@@ -1610,6 +1611,10 @@ main(int ac, char **av) | |||
1610 | rexec_argv[rexec_argc + 1] = NULL; | 1611 | rexec_argv[rexec_argc + 1] = NULL; |
1611 | } | 1612 | } |
1612 | 1613 | ||
1614 | /* Ensure that umask disallows at least group and world write */ | ||
1615 | new_umask = umask(0077) | 0022; | ||
1616 | (void) umask(new_umask); | ||
1617 | |||
1613 | /* Initialize the log (it is reinitialized below in case we forked). */ | 1618 | /* Initialize the log (it is reinitialized below in case we forked). */ |
1614 | if (debug_flag && (!inetd_flag || rexeced_flag)) | 1619 | if (debug_flag && (!inetd_flag || rexeced_flag)) |
1615 | log_stderr = 1; | 1620 | log_stderr = 1; |