diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-02-03 05:05:56 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-02-03 16:07:27 +1100 |
commit | c924b2ef941028a1f31e6e94f54dfeeeef462a4e (patch) | |
tree | e7d4f32f985b799b2a591460e80b69020f5108fb | |
parent | 523db8540b720c4d21ab0ff6f928476c70c38aab (diff) |
upstream commit
allow form-feed characters at EOL; bz#2431 ok dtucker@
Upstream-ID: 1f453afaba6da2ae69d6afdf1ae79a917552f1a2
-rw-r--r-- | readconf.c | 6 | ||||
-rw-r--r-- | servconf.c | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/readconf.c b/readconf.c index 72b4a637c..6c934406e 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.266 2017/01/30 00:38:50 djm Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.267 2017/02/03 05:05:56 djm 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 |
@@ -842,11 +842,11 @@ process_config_line_depth(Options *options, struct passwd *pw, const char *host, | |||
842 | activep = &cmdline; | 842 | activep = &cmdline; |
843 | } | 843 | } |
844 | 844 | ||
845 | /* Strip trailing whitespace */ | 845 | /* Strip trailing whitespace. Allow \f (form feed) at EOL only */ |
846 | if ((len = strlen(line)) == 0) | 846 | if ((len = strlen(line)) == 0) |
847 | return 0; | 847 | return 0; |
848 | for (len--; len > 0; len--) { | 848 | for (len--; len > 0; len--) { |
849 | if (strchr(WHITESPACE, line[len]) == NULL) | 849 | if (strchr(WHITESPACE "\f", line[len]) == NULL) |
850 | break; | 850 | break; |
851 | line[len] = '\0'; | 851 | line[len] = '\0'; |
852 | } | 852 | } |
diff --git a/servconf.c b/servconf.c index c9105a592..1880b8cfd 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | /* $OpenBSD: servconf.c,v 1.302 2017/01/06 03:45:41 djm Exp $ */ | 2 | /* $OpenBSD: servconf.c,v 1.303 2017/02/03 05:05:56 djm Exp $ */ |
3 | /* | 3 | /* |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
5 | * All rights reserved | 5 | * All rights reserved |
@@ -966,6 +966,15 @@ process_server_config_line(ServerOptions *options, char *line, | |||
966 | long long val64; | 966 | long long val64; |
967 | const struct multistate *multistate_ptr; | 967 | const struct multistate *multistate_ptr; |
968 | 968 | ||
969 | /* Strip trailing whitespace. Allow \f (form feed) at EOL only */ | ||
970 | if ((len = strlen(line)) == 0) | ||
971 | return 0; | ||
972 | for (len--; len > 0; len--) { | ||
973 | if (strchr(WHITESPACE "\f", line[len]) == NULL) | ||
974 | break; | ||
975 | line[len] = '\0'; | ||
976 | } | ||
977 | |||
969 | cp = line; | 978 | cp = line; |
970 | if ((arg = strdelim(&cp)) == NULL) | 979 | if ((arg = strdelim(&cp)) == NULL) |
971 | return 0; | 980 | return 0; |