OpenCoverage

readconf.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssh/src/readconf.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/* $OpenBSD: readconf.c,v 1.298 2018/09/20 03:30:44 djm Exp $ */-
2/*-
3 * Author: Tatu Ylonen <ylo@cs.hut.fi>-
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland-
5 * All rights reserved-
6 * Functions for reading the configuration files.-
7 *-
8 * As far as I am concerned, the code I have written for this software-
9 * can be used freely for any purpose. Any derived versions of this-
10 * software must be clearly marked as such, and if the derived work is-
11 * incompatible with the protocol description in the RFC file, it must be-
12 * called by a name other than "ssh" or "Secure Shell".-
13 */-
14-
15#include "includes.h"-
16-
17#include <sys/types.h>-
18#include <sys/stat.h>-
19#include <sys/socket.h>-
20#include <sys/wait.h>-
21#include <sys/un.h>-
22-
23#include <netinet/in.h>-
24#include <netinet/in_systm.h>-
25#include <netinet/ip.h>-
26#include <arpa/inet.h>-
27-
28#include <ctype.h>-
29#include <errno.h>-
30#include <fcntl.h>-
31#include <limits.h>-
32#include <netdb.h>-
33#ifdef HAVE_PATHS_H-
34# include <paths.h>-
35#endif-
36#include <pwd.h>-
37#include <signal.h>-
38#include <stdarg.h>-
39#include <stdio.h>-
40#include <string.h>-
41#include <unistd.h>-
42#ifdef USE_SYSTEM_GLOB-
43# include <glob.h>-
44#else-
45# include "openbsd-compat/glob.h"-
46#endif-
47#ifdef HAVE_UTIL_H-
48#include <util.h>-
49#endif-
50#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS)-
51# include <vis.h>-
52#endif-
53-
54#include "xmalloc.h"-
55#include "ssh.h"-
56#include "ssherr.h"-
57#include "compat.h"-
58#include "cipher.h"-
59#include "pathnames.h"-
60#include "log.h"-
61#include "sshkey.h"-
62#include "misc.h"-
63#include "readconf.h"-
64#include "match.h"-
65#include "kex.h"-
66#include "mac.h"-
67#include "uidswap.h"-
68#include "myproposal.h"-
69#include "digest.h"-
70-
71/* Format of the configuration file:-
72-
73 # Configuration data is parsed as follows:-
74 # 1. command line options-
75 # 2. user-specific file-
76 # 3. system-wide file-
77 # Any configuration value is only changed the first time it is set.-
78 # Thus, host-specific definitions should be at the beginning of the-
79 # configuration file, and defaults at the end.-
80-
81 # Host-specific declarations. These may override anything above. A single-
82 # host may match multiple declarations; these are processed in the order-
83 # that they are given in.-
84-
85 Host *.ngs.fi ngs.fi-
86 User foo-
87-
88 Host fake.com-
89 HostName another.host.name.real.org-
90 User blaah-
91 Port 34289-
92 ForwardX11 no-
93 ForwardAgent no-
94-
95 Host books.com-
96 RemoteForward 9999 shadows.cs.hut.fi:9999-
97 Ciphers 3des-cbc-
98-
99 Host fascist.blob.com-
100 Port 23123-
101 User tylonen-
102 PasswordAuthentication no-
103-
104 Host puukko.hut.fi-
105 User t35124p-
106 ProxyCommand ssh-proxy %h %p-
107-
108 Host *.fr-
109 PublicKeyAuthentication no-
110-
111 Host *.su-
112 Ciphers aes128-ctr-
113 PasswordAuthentication no-
114-
115 Host vpn.fake.com-
116 Tunnel yes-
117 TunnelDevice 3-
118-
119 # Defaults for various options-
120 Host *-
121 ForwardAgent no-
122 ForwardX11 no-
123 PasswordAuthentication yes-
124 RSAAuthentication yes-
125 RhostsRSAAuthentication yes-
126 StrictHostKeyChecking yes-
127 TcpKeepAlive no-
128 IdentityFile ~/.ssh/identity-
129 Port 22-
130 EscapeChar ~-
131-
132*/-
133-
134static int read_config_file_depth(const char *filename, struct passwd *pw,-
135 const char *host, const char *original_host, Options *options,-
136 int flags, int *activep, int depth);-
137static int process_config_line_depth(Options *options, struct passwd *pw,-
138 const char *host, const char *original_host, char *line,-
139 const char *filename, int linenum, int *activep, int flags, int depth);-
140-
141/* Keyword tokens. */-
142-
143typedef enum {-
144 oBadOption,-
145 oHost, oMatch, oInclude,-
146 oForwardAgent, oForwardX11, oForwardX11Trusted, oForwardX11Timeout,-
147 oGatewayPorts, oExitOnForwardFailure,-
148 oPasswordAuthentication, oRSAAuthentication,-
149 oChallengeResponseAuthentication, oXAuthLocation,-
150 oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,-
151 oCertificateFile, oAddKeysToAgent, oIdentityAgent,-
152 oUser, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,-
153 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,-
154 oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,-
155 oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts,-
156 oUsePrivilegedPort, oLogFacility, oLogLevel, oCiphers, oMacs,-
157 oPubkeyAuthentication,-
158 oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,-
159 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,-
160 oHostKeyAlgorithms, oBindAddress, oBindInterface, oPKCS11Provider,-
161 oClearAllForwardings, oNoHostAuthenticationForLocalhost,-
162 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,-
163 oAddressFamily, oGssAuthentication, oGssDelegateCreds,-
164 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,-
165 oSendEnv, oSetEnv, oControlPath, oControlMaster, oControlPersist,-
166 oHashKnownHosts,-
167 oTunnel, oTunnelDevice,-
168 oLocalCommand, oPermitLocalCommand, oRemoteCommand,-
169 oVisualHostKey,-
170 oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass,-
171 oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots,-
172 oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs,-
173 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys,-
174 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes,-
175 oPubkeyAcceptedKeyTypes, oCASignatureAlgorithms, oProxyJump,-
176 oIgnore, oIgnoredUnknownOption, oDeprecated, oUnsupported-
177} OpCodes;-
178-
179/* Textual representations of the tokens. */-
180-
181static struct {-
182 const char *name;-
183 OpCodes opcode;-
184} keywords[] = {-
185 /* Deprecated options */-
186 { "protocol", oIgnore }, /* NB. silently ignored */-
187 { "cipher", oDeprecated },-
188 { "fallbacktorsh", oDeprecated },-
189 { "globalknownhostsfile2", oDeprecated },-
190 { "rhostsauthentication", oDeprecated },-
191 { "userknownhostsfile2", oDeprecated },-
192 { "useroaming", oDeprecated },-
193 { "usersh", oDeprecated },-
194 { "useprivilegedport", oDeprecated },-
195-
196 /* Unsupported options */-
197 { "afstokenpassing", oUnsupported },-
198 { "kerberosauthentication", oUnsupported },-
199 { "kerberostgtpassing", oUnsupported },-
200-
201 /* Sometimes-unsupported options */-
202#if defined(GSSAPI)-
203 { "gssapiauthentication", oGssAuthentication },-
204 { "gssapidelegatecredentials", oGssDelegateCreds },-
205# else-
206 { "gssapiauthentication", oUnsupported },-
207 { "gssapidelegatecredentials", oUnsupported },-
208#endif-
209#ifdef ENABLE_PKCS11-
210 { "smartcarddevice", oPKCS11Provider },-
211 { "pkcs11provider", oPKCS11Provider },-
212# else-
213 { "smartcarddevice", oUnsupported },-
214 { "pkcs11provider", oUnsupported },-
215#endif-
216 { "rsaauthentication", oUnsupported },-
217 { "rhostsrsaauthentication", oUnsupported },-
218 { "compressionlevel", oUnsupported },-
219-
220 { "forwardagent", oForwardAgent },-
221 { "forwardx11", oForwardX11 },-
222 { "forwardx11trusted", oForwardX11Trusted },-
223 { "forwardx11timeout", oForwardX11Timeout },-
224 { "exitonforwardfailure", oExitOnForwardFailure },-
225 { "xauthlocation", oXAuthLocation },-
226 { "gatewayports", oGatewayPorts },-
227 { "passwordauthentication", oPasswordAuthentication },-
228 { "kbdinteractiveauthentication", oKbdInteractiveAuthentication },-
229 { "kbdinteractivedevices", oKbdInteractiveDevices },-
230 { "pubkeyauthentication", oPubkeyAuthentication },-
231 { "dsaauthentication", oPubkeyAuthentication }, /* alias */-
232 { "hostbasedauthentication", oHostbasedAuthentication },-
233 { "challengeresponseauthentication", oChallengeResponseAuthentication },-
234 { "skeyauthentication", oUnsupported },-
235 { "tisauthentication", oChallengeResponseAuthentication }, /* alias */-
236 { "identityfile", oIdentityFile },-
237 { "identityfile2", oIdentityFile }, /* obsolete */-
238 { "identitiesonly", oIdentitiesOnly },-
239 { "certificatefile", oCertificateFile },-
240 { "addkeystoagent", oAddKeysToAgent },-
241 { "identityagent", oIdentityAgent },-
242 { "hostname", oHostName },-
243 { "hostkeyalias", oHostKeyAlias },-
244 { "proxycommand", oProxyCommand },-
245 { "port", oPort },-
246 { "ciphers", oCiphers },-
247 { "macs", oMacs },-
248 { "remoteforward", oRemoteForward },-
249 { "localforward", oLocalForward },-
250 { "user", oUser },-
251 { "host", oHost },-
252 { "match", oMatch },-
253 { "escapechar", oEscapeChar },-
254 { "globalknownhostsfile", oGlobalKnownHostsFile },-
255 { "userknownhostsfile", oUserKnownHostsFile },-
256 { "connectionattempts", oConnectionAttempts },-
257 { "batchmode", oBatchMode },-
258 { "checkhostip", oCheckHostIP },-
259 { "stricthostkeychecking", oStrictHostKeyChecking },-
260 { "compression", oCompression },-
261 { "tcpkeepalive", oTCPKeepAlive },-
262 { "keepalive", oTCPKeepAlive }, /* obsolete */-
263 { "numberofpasswordprompts", oNumberOfPasswordPrompts },-
264 { "syslogfacility", oLogFacility },-
265 { "loglevel", oLogLevel },-
266 { "dynamicforward", oDynamicForward },-
267 { "preferredauthentications", oPreferredAuthentications },-
268 { "hostkeyalgorithms", oHostKeyAlgorithms },-
269 { "casignaturealgorithms", oCASignatureAlgorithms },-
270 { "bindaddress", oBindAddress },-
271 { "bindinterface", oBindInterface },-
272 { "clearallforwardings", oClearAllForwardings },-
273 { "enablesshkeysign", oEnableSSHKeysign },-
274 { "verifyhostkeydns", oVerifyHostKeyDNS },-
275 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },-
276 { "rekeylimit", oRekeyLimit },-
277 { "connecttimeout", oConnectTimeout },-
278 { "addressfamily", oAddressFamily },-
279 { "serveraliveinterval", oServerAliveInterval },-
280 { "serveralivecountmax", oServerAliveCountMax },-
281 { "sendenv", oSendEnv },-
282 { "setenv", oSetEnv },-
283 { "controlpath", oControlPath },-
284 { "controlmaster", oControlMaster },-
285 { "controlpersist", oControlPersist },-
286 { "hashknownhosts", oHashKnownHosts },-
287 { "include", oInclude },-
288 { "tunnel", oTunnel },-
289 { "tunneldevice", oTunnelDevice },-
290 { "localcommand", oLocalCommand },-
291 { "permitlocalcommand", oPermitLocalCommand },-
292 { "remotecommand", oRemoteCommand },-
293 { "visualhostkey", oVisualHostKey },-
294 { "kexalgorithms", oKexAlgorithms },-
295 { "ipqos", oIPQoS },-
296 { "requesttty", oRequestTTY },-
297 { "proxyusefdpass", oProxyUseFdpass },-
298 { "canonicaldomains", oCanonicalDomains },-
299 { "canonicalizefallbacklocal", oCanonicalizeFallbackLocal },-
300 { "canonicalizehostname", oCanonicalizeHostname },-
301 { "canonicalizemaxdots", oCanonicalizeMaxDots },-
302 { "canonicalizepermittedcnames", oCanonicalizePermittedCNAMEs },-
303 { "streamlocalbindmask", oStreamLocalBindMask },-
304 { "streamlocalbindunlink", oStreamLocalBindUnlink },-
305 { "revokedhostkeys", oRevokedHostKeys },-
306 { "fingerprinthash", oFingerprintHash },-
307 { "updatehostkeys", oUpdateHostkeys },-
308 { "hostbasedkeytypes", oHostbasedKeyTypes },-
309 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes },-
310 { "ignoreunknown", oIgnoreUnknown },-
311 { "proxyjump", oProxyJump },-
312-
313 { NULL, oBadOption }-
314};-
315-
316/*-
317 * Adds a local TCP/IP port forward to options. Never returns if there is an-
318 * error.-
319 */-
320-
321void-
322add_local_forward(Options *options, const struct Forward *newfwd)-
323{-
324 struct Forward *fwd;-
325 int i;-
326-
327 /* Don't add duplicates */-
328 for (i = 0; i < options->num_local_forwards; i++) {
i < options->n...local_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
0
329 if (forward_equals(newfwd, options->local_forwards + i))
forward_equals..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
0
330 return;
never executed: return;
0
331 }
never executed: end of block
0
332 options->local_forwards = xreallocarray(options->local_forwards,-
333 options->num_local_forwards + 1,-
334 sizeof(*options->local_forwards));-
335 fwd = &options->local_forwards[options->num_local_forwards++];-
336-
337 fwd->listen_host = newfwd->listen_host;-
338 fwd->listen_port = newfwd->listen_port;-
339 fwd->listen_path = newfwd->listen_path;-
340 fwd->connect_host = newfwd->connect_host;-
341 fwd->connect_port = newfwd->connect_port;-
342 fwd->connect_path = newfwd->connect_path;-
343}
never executed: end of block
0
344-
345/*-
346 * Adds a remote TCP/IP port forward to options. Never returns if there is-
347 * an error.-
348 */-
349-
350void-
351add_remote_forward(Options *options, const struct Forward *newfwd)-
352{-
353 struct Forward *fwd;-
354 int i;-
355-
356 /* Don't add duplicates */-
357 for (i = 0; i < options->num_remote_forwards; i++) {
i < options->n...emote_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
0
358 if (forward_equals(newfwd, options->remote_forwards + i))
forward_equals..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
0
359 return;
never executed: return;
0
360 }
never executed: end of block
0
361 options->remote_forwards = xreallocarray(options->remote_forwards,-
362 options->num_remote_forwards + 1,-
363 sizeof(*options->remote_forwards));-
364 fwd = &options->remote_forwards[options->num_remote_forwards++];-
365-
366 fwd->listen_host = newfwd->listen_host;-
367 fwd->listen_port = newfwd->listen_port;-
368 fwd->listen_path = newfwd->listen_path;-
369 fwd->connect_host = newfwd->connect_host;-
370 fwd->connect_port = newfwd->connect_port;-
371 fwd->connect_path = newfwd->connect_path;-
372 fwd->handle = newfwd->handle;-
373 fwd->allocated_port = 0;-
374}
never executed: end of block
0
375-
376static void-
377clear_forwardings(Options *options)-
378{-
379 int i;-
380-
381 for (i = 0; i < options->num_local_forwards; i++) {
i < options->n...local_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
0
382 free(options->local_forwards[i].listen_host);-
383 free(options->local_forwards[i].listen_path);-
384 free(options->local_forwards[i].connect_host);-
385 free(options->local_forwards[i].connect_path);-
386 }
never executed: end of block
0
387 if (options->num_local_forwards > 0) {
options->num_l...l_forwards > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
388 free(options->local_forwards);-
389 options->local_forwards = NULL;-
390 }
never executed: end of block
0
391 options->num_local_forwards = 0;-
392 for (i = 0; i < options->num_remote_forwards; i++) {
i < options->n...emote_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
0
393 free(options->remote_forwards[i].listen_host);-
394 free(options->remote_forwards[i].listen_path);-
395 free(options->remote_forwards[i].connect_host);-
396 free(options->remote_forwards[i].connect_path);-
397 }
never executed: end of block
0
398 if (options->num_remote_forwards > 0) {
options->num_r...e_forwards > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
399 free(options->remote_forwards);-
400 options->remote_forwards = NULL;-
401 }
never executed: end of block
0
402 options->num_remote_forwards = 0;-
403 options->tun_open = SSH_TUNMODE_NO;-
404}
never executed: end of block
0
405-
406void-
407add_certificate_file(Options *options, const char *path, int userprovided)-
408{-
409 int i;-
410-
411 if (options->num_certificate_files >= SSH_MAX_CERTIFICATE_FILES)
options->num_c...e_files >= 100Description
TRUEnever evaluated
FALSEnever evaluated
0
412 fatal("Too many certificate files specified (max %d)",
never executed: fatal("Too many certificate files specified (max %d)", 100);
0
413 SSH_MAX_CERTIFICATE_FILES);
never executed: fatal("Too many certificate files specified (max %d)", 100);
0
414-
415 /* Avoid registering duplicates */-
416 for (i = 0; i < options->num_certificate_files; i++) {
i < options->n...tificate_filesDescription
TRUEnever evaluated
FALSEnever evaluated
0
417 if (options->certificate_file_userprovided[i] == userprovided &&
options->certi...= userprovidedDescription
TRUEnever evaluated
FALSEnever evaluated
0
418 strcmp(options->certificate_files[i], path) == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( options->certificate_files[i] ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( path ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
419 debug2("%s: ignoring duplicate key %s", __func__, path);-
420 return;
never executed: return;
0
421 }-
422 }
never executed: end of block
0
423-
424 options->certificate_file_userprovided[options->num_certificate_files] =-
425 userprovided;-
426 options->certificate_files[options->num_certificate_files++] =-
427 xstrdup(path);-
428}
never executed: end of block
0
429-
430void-
431add_identity_file(Options *options, const char *dir, const char *filename,-
432 int userprovided)-
433{-
434 char *path;-
435 int i;-
436-
437 if (options->num_identity_files >= SSH_MAX_IDENTITY_FILES)
options->num_i...y_files >= 100Description
TRUEnever evaluated
FALSEnever evaluated
0
438 fatal("Too many identity files specified (max %d)",
never executed: fatal("Too many identity files specified (max %d)", 100);
0
439 SSH_MAX_IDENTITY_FILES);
never executed: fatal("Too many identity files specified (max %d)", 100);
0
440-
441 if (dir == NULL) /* no dir, filename is absolute */
dir == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
442 path = xstrdup(filename);
never executed: path = xstrdup(filename);
0
443 else if (xasprintf(&path, "%s%s", dir, filename) >= PATH_MAX)
xasprintf(&pat...ename) >= 4096Description
TRUEnever evaluated
FALSEnever evaluated
0
444 fatal("Identity file path %s too long", path);
never executed: fatal("Identity file path %s too long", path);
0
445-
446 /* Avoid registering duplicates */-
447 for (i = 0; i < options->num_identity_files; i++) {
i < options->n...identity_filesDescription
TRUEnever evaluated
FALSEnever evaluated
0
448 if (options->identity_file_userprovided[i] == userprovided &&
options->ident...= userprovidedDescription
TRUEnever evaluated
FALSEnever evaluated
0
449 strcmp(options->identity_files[i], path) == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( options->identity_files[i] ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( path ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
450 debug2("%s: ignoring duplicate key %s", __func__, path);-
451 free(path);-
452 return;
never executed: return;
0
453 }-
454 }
never executed: end of block
0
455-
456 options->identity_file_userprovided[options->num_identity_files] =-
457 userprovided;-
458 options->identity_files[options->num_identity_files++] = path;-
459}
never executed: end of block
0
460-
461int-
462default_ssh_port(void)-
463{-
464 static int port;-
465 struct servent *sp;-
466-
467 if (port == 0) {
port == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
468 sp = getservbyname(SSH_SERVICE_NAME, "tcp");-
469 port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT;
never executed: __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8)));
never executed: __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc");
__builtin_constant_p (__x)Description
TRUEnever evaluated
FALSEnever evaluated
spDescription
TRUEnever evaluated
FALSEnever evaluated
0
470 }
never executed: end of block
0
471 return port;
never executed: return port;
0
472}-
473-
474/*-
475 * Execute a command in a shell.-
476 * Return its exit status or -1 on abnormal exit.-
477 */-
478static int-
479execute_in_shell(const char *cmd)-
480{-
481 char *shell;-
482 pid_t pid;-
483 int devnull, status;-
484-
485 if ((shell = getenv("SHELL")) == NULL)
(shell = geten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
486 shell = _PATH_BSHELL;
never executed: shell = "/bin/sh" ;
0
487-
488 /* Need this to redirect subprocess stdin/out */-
489 if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1)
(devnull = ope... , 02 )) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
490 fatal("open(/dev/null): %s", strerror(errno));
never executed: fatal("open(/dev/null): %s", strerror( (*__errno_location ()) ));
0
491-
492 debug("Executing command: '%.500s'", cmd);-
493-
494 /* Fork and execute the command. */-
495 if ((pid = fork()) == 0) {
(pid = fork()) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
496 char *argv[4];-
497-
498 /* Redirect child stdin and stdout. Leave stderr */-
499 if (dup2(devnull, STDIN_FILENO) == -1)
dup2(devnull, 0 ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
500 fatal("dup2: %s", strerror(errno));
never executed: fatal("dup2: %s", strerror( (*__errno_location ()) ));
0
501 if (dup2(devnull, STDOUT_FILENO) == -1)
dup2(devnull, 1 ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
502 fatal("dup2: %s", strerror(errno));
never executed: fatal("dup2: %s", strerror( (*__errno_location ()) ));
0
503 if (devnull > STDERR_FILENO)
devnull > 2Description
TRUEnever evaluated
FALSEnever evaluated
0
504 close(devnull);
never executed: close(devnull);
0
505 closefrom(STDERR_FILENO + 1);-
506-
507 argv[0] = shell;-
508 argv[1] = "-c";-
509 argv[2] = xstrdup(cmd);-
510 argv[3] = NULL;-
511-
512 execv(argv[0], argv);-
513 error("Unable to execute '%.100s': %s", cmd, strerror(errno));-
514 /* Die with signal to make this error apparent to parent. */-
515 signal(SIGTERM, SIG_DFL);-
516 kill(getpid(), SIGTERM);-
517 _exit(1);-
518 }
never executed: end of block
0
519 /* Parent. */-
520 if (pid < 0)
pid < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
521 fatal("%s: fork: %.100s", __func__, strerror(errno));
never executed: fatal("%s: fork: %.100s", __func__, strerror( (*__errno_location ()) ));
0
522-
523 close(devnull);-
524-
525 while (waitpid(pid, &status, 0) == -1) {
waitpid(pid, &status, 0) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
526 if (errno != EINTR && errno != EAGAIN)
(*__errno_location ()) != 4Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) != 11Description
TRUEnever evaluated
FALSEnever evaluated
0
527 fatal("%s: waitpid: %s", __func__, strerror(errno));
never executed: fatal("%s: waitpid: %s", __func__, strerror( (*__errno_location ()) ));
0
528 }
never executed: end of block
0
529 if (!WIFEXITED(status)) {
! ((( status ) & 0x7f) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
530 error("command '%.100s' exited abnormally", cmd);-
531 return -1;
never executed: return -1;
0
532 }-
533 debug3("command returned status %d", WEXITSTATUS(status));-
534 return WEXITSTATUS(status);
never executed: return ((( status ) & 0xff00) >> 8) ;
0
535}-
536-
537/*-
538 * Parse and execute a Match directive.-
539 */-
540static int-
541match_cfg_line(Options *options, char **condition, struct passwd *pw,-
542 const char *host_arg, const char *original_host, int post_canon,-
543 const char *filename, int linenum)-
544{-
545 char *arg, *oattrib, *attrib, *cmd, *cp = *condition, *host, *criteria;-
546 const char *ruser;-
547 int r, port, this_result, result = 1, attributes = 0, negate;-
548 char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];-
549 char uidstr[32];-
550-
551 /*-
552 * Configuration is likely to be incomplete at this point so we-
553 * must be prepared to use default values.-
554 */-
555 port = options->port <= 0 ? default_ssh_port() : options->port;
options->port <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
556 ruser = options->user == NULL ? pw->pw_name : options->user;
options->user == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
557 if (post_canon) {
post_canonDescription
TRUEnever evaluated
FALSEnever evaluated
0
558 host = xstrdup(options->hostname);-
559 } else if (options->hostname != NULL) {
never executed: end of block
options->hostn...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
560 /* NB. Please keep in sync with ssh.c:main() */-
561 host = percent_expand(options->hostname,-
562 "h", host_arg, (char *)NULL);-
563 } else {
never executed: end of block
0
564 host = xstrdup(host_arg);-
565 }
never executed: end of block
0
566-
567 debug2("checking match for '%s' host %s originally %s",-
568 cp, host, original_host);-
569 while ((oattrib = attrib = strdelim(&cp)) && *attrib != '\0') {
(oattrib = att...strdelim(&cp))Description
TRUEnever evaluated
FALSEnever evaluated
*attrib != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
570 criteria = NULL;-
571 this_result = 1;-
572 if ((negate = attrib[0] == '!'))
(negate = attrib[0] == '!')Description
TRUEnever evaluated
FALSEnever evaluated
0
573 attrib++;
never executed: attrib++;
0
574 /* criteria "all" and "canonical" have no argument */-
575 if (strcasecmp(attrib, "all") == 0) {
strcasecmp(attrib, "all") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
576 if (attributes > 1 ||
attributes > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
577 ((arg = strdelim(&cp)) != NULL && *arg != '\0')) {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
578 error("%.200s line %d: '%s' cannot be combined "-
579 "with other Match attributes",-
580 filename, linenum, oattrib);-
581 result = -1;-
582 goto out;
never executed: goto out;
0
583 }-
584 if (result)
resultDescription
TRUEnever evaluated
FALSEnever evaluated
0
585 result = negate ? 0 : 1;
never executed: result = negate ? 0 : 1;
negateDescription
TRUEnever evaluated
FALSEnever evaluated
0
586 goto out;
never executed: goto out;
0
587 }-
588 attributes++;-
589 if (strcasecmp(attrib, "canonical") == 0) {
strcasecmp(att...nonical") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
590 r = !!post_canon; /* force bitmask member to boolean */-
591 if (r == (negate ? 1 : 0))
r == (negate ? 1 : 0)Description
TRUEnever evaluated
FALSEnever evaluated
negateDescription
TRUEnever evaluated
FALSEnever evaluated
0
592 this_result = result = 0;
never executed: this_result = result = 0;
0
593 debug3("%.200s line %d: %smatched '%s'",-
594 filename, linenum,-
595 this_result ? "" : "not ", oattrib);-
596 continue;
never executed: continue;
0
597 }-
598 /* All other criteria require an argument */-
599 if ((arg = strdelim(&cp)) == NULL || *arg == '\0') {
(arg = strdeli...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
600 error("Missing Match criteria for %s", attrib);-
601 result = -1;-
602 goto out;
never executed: goto out;
0
603 }-
604 if (strcasecmp(attrib, "host") == 0) {
strcasecmp(att..., "host") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
605 criteria = xstrdup(host);-
606 r = match_hostname(host, arg) == 1;-
607 if (r == (negate ? 1 : 0))
r == (negate ? 1 : 0)Description
TRUEnever evaluated
FALSEnever evaluated
negateDescription
TRUEnever evaluated
FALSEnever evaluated
0
608 this_result = result = 0;
never executed: this_result = result = 0;
0
609 } else if (strcasecmp(attrib, "originalhost") == 0) {
never executed: end of block
strcasecmp(att...nalhost") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
610 criteria = xstrdup(original_host);-
611 r = match_hostname(original_host, arg) == 1;-
612 if (r == (negate ? 1 : 0))
r == (negate ? 1 : 0)Description
TRUEnever evaluated
FALSEnever evaluated
negateDescription
TRUEnever evaluated
FALSEnever evaluated
0
613 this_result = result = 0;
never executed: this_result = result = 0;
0
614 } else if (strcasecmp(attrib, "user") == 0) {
never executed: end of block
strcasecmp(att..., "user") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
615 criteria = xstrdup(ruser);-
616 r = match_pattern_list(ruser, arg, 0) == 1;-
617 if (r == (negate ? 1 : 0))
r == (negate ? 1 : 0)Description
TRUEnever evaluated
FALSEnever evaluated
negateDescription
TRUEnever evaluated
FALSEnever evaluated
0
618 this_result = result = 0;
never executed: this_result = result = 0;
0
619 } else if (strcasecmp(attrib, "localuser") == 0) {
never executed: end of block
strcasecmp(att...caluser") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
620 criteria = xstrdup(pw->pw_name);-
621 r = match_pattern_list(pw->pw_name, arg, 0) == 1;-
622 if (r == (negate ? 1 : 0))
r == (negate ? 1 : 0)Description
TRUEnever evaluated
FALSEnever evaluated
negateDescription
TRUEnever evaluated
FALSEnever evaluated
0
623 this_result = result = 0;
never executed: this_result = result = 0;
0
624 } else if (strcasecmp(attrib, "exec") == 0) {
never executed: end of block
strcasecmp(att..., "exec") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
625 if (gethostname(thishost, sizeof(thishost)) == -1)
gethostname(th...ishost)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
626 fatal("gethostname: %s", strerror(errno));
never executed: fatal("gethostname: %s", strerror( (*__errno_location ()) ));
0
627 strlcpy(shorthost, thishost, sizeof(shorthost));-
628 shorthost[strcspn(thishost, ".")] = '\0';-
629 snprintf(portstr, sizeof(portstr), "%d", port);-
630 snprintf(uidstr, sizeof(uidstr), "%llu",-
631 (unsigned long long)pw->pw_uid);-
632-
633 cmd = percent_expand(arg,-
634 "L", shorthost,-
635 "d", pw->pw_dir,-
636 "h", host,-
637 "l", thishost,-
638 "n", original_host,-
639 "p", portstr,-
640 "r", ruser,-
641 "u", pw->pw_name,-
642 "i", uidstr,-
643 (char *)NULL);-
644 if (result != 1) {
result != 1Description
TRUEnever evaluated
FALSEnever evaluated
0
645 /* skip execution if prior predicate failed */-
646 debug3("%.200s line %d: skipped exec "-
647 "\"%.100s\"", filename, linenum, cmd);-
648 free(cmd);-
649 continue;
never executed: continue;
0
650 }-
651 r = execute_in_shell(cmd);-
652 if (r == -1) {
r == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
653 fatal("%.200s line %d: match exec "-
654 "'%.100s' error", filename,-
655 linenum, cmd);-
656 }
never executed: end of block
0
657 criteria = xstrdup(cmd);-
658 free(cmd);-
659 /* Force exit status to boolean */-
660 r = r == 0;-
661 if (r == (negate ? 1 : 0))
r == (negate ? 1 : 0)Description
TRUEnever evaluated
FALSEnever evaluated
negateDescription
TRUEnever evaluated
FALSEnever evaluated
0
662 this_result = result = 0;
never executed: this_result = result = 0;
0
663 } else {
never executed: end of block
0
664 error("Unsupported Match attribute %s", attrib);-
665 result = -1;-
666 goto out;
never executed: goto out;
0
667 }-
668 debug3("%.200s line %d: %smatched '%s \"%.100s\"' ",-
669 filename, linenum, this_result ? "": "not ",-
670 oattrib, criteria);-
671 free(criteria);-
672 }
never executed: end of block
0
673 if (attributes == 0) {
attributes == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
674 error("One or more attributes required for Match");-
675 result = -1;-
676 goto out;
never executed: goto out;
0
677 }-
678 out:
code before this statement never executed: out:
0
679 if (result != -1)
result != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
680 debug2("match %sfound", result ? "" : "not ");
never executed: debug2("match %sfound", result ? "" : "not ");
0
681 *condition = cp;-
682 free(host);-
683 return result;
never executed: return result;
0
684}-
685-
686/* Remove environment variable by pattern */-
687static void-
688rm_env(Options *options, const char *arg, const char *filename, int linenum)-
689{-
690 int i, j;-
691 char *cp;-
692-
693 /* Remove an environment variable */-
694 for (i = 0; i < options->num_send_env; ) {
i < options->num_send_envDescription
TRUEnever evaluated
FALSEnever evaluated
0
695 cp = xstrdup(options->send_env[i]);-
696 if (!match_pattern(cp, arg + 1)) {
!match_pattern(cp, arg + 1)Description
TRUEnever evaluated
FALSEnever evaluated
0
697 free(cp);-
698 i++;-
699 continue;
never executed: continue;
0
700 }-
701 debug3("%s line %d: removing environment %s",-
702 filename, linenum, cp);-
703 free(cp);-
704 free(options->send_env[i]);-
705 options->send_env[i] = NULL;-
706 for (j = i; j < options->num_send_env - 1; j++) {
j < options->num_send_env - 1Description
TRUEnever evaluated
FALSEnever evaluated
0
707 options->send_env[j] = options->send_env[j + 1];-
708 options->send_env[j + 1] = NULL;-
709 }
never executed: end of block
0
710 options->num_send_env--;-
711 /* NB. don't increment i */-
712 }
never executed: end of block
0
713}
never executed: end of block
0
714-
715/*-
716 * Returns the number of the token pointed to by cp or oBadOption.-
717 */-
718static OpCodes-
719parse_token(const char *cp, const char *filename, int linenum,-
720 const char *ignored_unknown)-
721{-
722 int i;-
723-
724 for (i = 0; keywords[i].name; i++)
keywords[i].nameDescription
TRUEnever evaluated
FALSEnever evaluated
0
725 if (strcmp(cp, keywords[i].name) == 0)
never executed: __result = (((const unsigned char *) (const char *) ( cp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( keywords[i].name ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
726 return keywords[i].opcode;
never executed: return keywords[i].opcode;
0
727 if (ignored_unknown != NULL &&
ignored_unknown != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
728 match_pattern_list(cp, ignored_unknown, 1) == 1)
match_pattern_...known, 1) == 1Description
TRUEnever evaluated
FALSEnever evaluated
0
729 return oIgnoredUnknownOption;
never executed: return oIgnoredUnknownOption;
0
730 error("%s: line %d: Bad configuration option: %s",-
731 filename, linenum, cp);-
732 return oBadOption;
never executed: return oBadOption;
0
733}-
734-
735/* Multistate option parsing */-
736struct multistate {-
737 char *key;-
738 int value;-
739};-
740static const struct multistate multistate_flag[] = {-
741 { "true", 1 },-
742 { "false", 0 },-
743 { "yes", 1 },-
744 { "no", 0 },-
745 { NULL, -1 }-
746};-
747static const struct multistate multistate_yesnoask[] = {-
748 { "true", 1 },-
749 { "false", 0 },-
750 { "yes", 1 },-
751 { "no", 0 },-
752 { "ask", 2 },-
753 { NULL, -1 }-
754};-
755static const struct multistate multistate_strict_hostkey[] = {-
756 { "true", SSH_STRICT_HOSTKEY_YES },-
757 { "false", SSH_STRICT_HOSTKEY_OFF },-
758 { "yes", SSH_STRICT_HOSTKEY_YES },-
759 { "no", SSH_STRICT_HOSTKEY_OFF },-
760 { "ask", SSH_STRICT_HOSTKEY_ASK },-
761 { "off", SSH_STRICT_HOSTKEY_OFF },-
762 { "accept-new", SSH_STRICT_HOSTKEY_NEW },-
763 { NULL, -1 }-
764};-
765static const struct multistate multistate_yesnoaskconfirm[] = {-
766 { "true", 1 },-
767 { "false", 0 },-
768 { "yes", 1 },-
769 { "no", 0 },-
770 { "ask", 2 },-
771 { "confirm", 3 },-
772 { NULL, -1 }-
773};-
774static const struct multistate multistate_addressfamily[] = {-
775 { "inet", AF_INET },-
776 { "inet6", AF_INET6 },-
777 { "any", AF_UNSPEC },-
778 { NULL, -1 }-
779};-
780static const struct multistate multistate_controlmaster[] = {-
781 { "true", SSHCTL_MASTER_YES },-
782 { "yes", SSHCTL_MASTER_YES },-
783 { "false", SSHCTL_MASTER_NO },-
784 { "no", SSHCTL_MASTER_NO },-
785 { "auto", SSHCTL_MASTER_AUTO },-
786 { "ask", SSHCTL_MASTER_ASK },-
787 { "autoask", SSHCTL_MASTER_AUTO_ASK },-
788 { NULL, -1 }-
789};-
790static const struct multistate multistate_tunnel[] = {-
791 { "ethernet", SSH_TUNMODE_ETHERNET },-
792 { "point-to-point", SSH_TUNMODE_POINTOPOINT },-
793 { "true", SSH_TUNMODE_DEFAULT },-
794 { "yes", SSH_TUNMODE_DEFAULT },-
795 { "false", SSH_TUNMODE_NO },-
796 { "no", SSH_TUNMODE_NO },-
797 { NULL, -1 }-
798};-
799static const struct multistate multistate_requesttty[] = {-
800 { "true", REQUEST_TTY_YES },-
801 { "yes", REQUEST_TTY_YES },-
802 { "false", REQUEST_TTY_NO },-
803 { "no", REQUEST_TTY_NO },-
804 { "force", REQUEST_TTY_FORCE },-
805 { "auto", REQUEST_TTY_AUTO },-
806 { NULL, -1 }-
807};-
808static const struct multistate multistate_canonicalizehostname[] = {-
809 { "true", SSH_CANONICALISE_YES },-
810 { "false", SSH_CANONICALISE_NO },-
811 { "yes", SSH_CANONICALISE_YES },-
812 { "no", SSH_CANONICALISE_NO },-
813 { "always", SSH_CANONICALISE_ALWAYS },-
814 { NULL, -1 }-
815};-
816-
817/*-
818 * Processes a single option line as used in the configuration files. This-
819 * only sets those values that have not already been set.-
820 */-
821int-
822process_config_line(Options *options, struct passwd *pw, const char *host,-
823 const char *original_host, char *line, const char *filename,-
824 int linenum, int *activep, int flags)-
825{-
826 return process_config_line_depth(options, pw, host, original_host,
never executed: return process_config_line_depth(options, pw, host, original_host, line, filename, linenum, activep, flags, 0);
0
827 line, filename, linenum, activep, flags, 0);
never executed: return process_config_line_depth(options, pw, host, original_host, line, filename, linenum, activep, flags, 0);
0
828}-
829-
830#define WHITESPACE " \t\r\n"-
831static int-
832process_config_line_depth(Options *options, struct passwd *pw, const char *host,-
833 const char *original_host, char *line, const char *filename,-
834 int linenum, int *activep, int flags, int depth)-
835{-
836 char *s, **charptr, *endofnumber, *keyword, *arg, *arg2;-
837 char **cpptr, fwdarg[256];-
838 u_int i, *uintptr, max_entries = 0;-
839 int r, oactive, negated, opcode, *intptr, value, value2, cmdline = 0;-
840 int remotefwd, dynamicfwd;-
841 LogLevel *log_level_ptr;-
842 SyslogFacility *log_facility_ptr;-
843 long long val64;-
844 size_t len;-
845 struct Forward fwd;-
846 const struct multistate *multistate_ptr;-
847 struct allowed_cname *cname;-
848 glob_t gl;-
849 const char *errstr;-
850-
851 if (activep == NULL) { /* We are processing a command line directive */
activep == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
852 cmdline = 1;-
853 activep = &cmdline;-
854 }
never executed: end of block
0
855-
856 /* Strip trailing whitespace. Allow \f (form feed) at EOL only */-
857 if ((len = strlen(line)) == 0)
(len = strlen(line)) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
858 return 0;
never executed: return 0;
0
859 for (len--; len > 0; len--) {
len > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
860 if (strchr(WHITESPACE "\f", line[len]) == NULL)
(__extension__...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_cons... ( line[len] )Description
TRUEnever evaluated
FALSEnever evaluated
!__builtin_con...\t\r\n" "\f" )Description
TRUEnever evaluated
FALSEnever evaluated
( line[len] ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
861 break;
never executed: break;
0
862 line[len] = '\0';-
863 }
never executed: end of block
0
864-
865 s = line;-
866 /* Get the keyword. (Each line is supposed to begin with a keyword). */-
867 if ((keyword = strdelim(&s)) == NULL)
(keyword = str...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
868 return 0;
never executed: return 0;
0
869 /* Ignore leading whitespace. */-
870 if (*keyword == '\0')
*keyword == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
871 keyword = strdelim(&s);
never executed: keyword = strdelim(&s);
0
872 if (keyword == NULL || !*keyword || *keyword == '\n' || *keyword == '#')
keyword == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
!*keywordDescription
TRUEnever evaluated
FALSEnever evaluated
*keyword == '\n'Description
TRUEnever evaluated
FALSEnever evaluated
*keyword == '#'Description
TRUEnever evaluated
FALSEnever evaluated
0
873 return 0;
never executed: return 0;
0
874 /* Match lowercase keyword */-
875 lowercase(keyword);-
876-
877 opcode = parse_token(keyword, filename, linenum,-
878 options->ignored_unknown);-
879-
880 switch (opcode) {-
881 case oBadOption:
never executed: case oBadOption:
0
882 /* don't panic, but count bad options */-
883 return -1;
never executed: return -1;
0
884 case oIgnore:
never executed: case oIgnore:
0
885 return 0;
never executed: return 0;
0
886 case oIgnoredUnknownOption:
never executed: case oIgnoredUnknownOption:
0
887 debug("%s line %d: Ignored unknown option \"%s\"",-
888 filename, linenum, keyword);-
889 return 0;
never executed: return 0;
0
890 case oConnectTimeout:
never executed: case oConnectTimeout:
0
891 intptr = &options->connection_timeout;-
892parse_time:
code before this statement never executed: parse_time:
0
893 arg = strdelim(&s);-
894 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
895 fatal("%s line %d: missing time value.",
never executed: fatal("%s line %d: missing time value.", filename, linenum);
0
896 filename, linenum);
never executed: fatal("%s line %d: missing time value.", filename, linenum);
0
897 if (strcmp(arg, "none") == 0)
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "none" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
898 value = -1;
never executed: value = -1;
0
899 else if ((value = convtime(arg)) == -1)
(value = convtime(arg)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
900 fatal("%s line %d: invalid time value.",
never executed: fatal("%s line %d: invalid time value.", filename, linenum);
0
901 filename, linenum);
never executed: fatal("%s line %d: invalid time value.", filename, linenum);
0
902 if (*activep && *intptr == -1)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*intptr == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
903 *intptr = value;
never executed: *intptr = value;
0
904 break;
never executed: break;
0
905-
906 case oForwardAgent:
never executed: case oForwardAgent:
0
907 intptr = &options->forward_agent;-
908 parse_flag:
code before this statement never executed: parse_flag:
0
909 multistate_ptr = multistate_flag;-
910 parse_multistate:
code before this statement never executed: parse_multistate:
0
911 arg = strdelim(&s);-
912 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
913 fatal("%s line %d: missing argument.",
never executed: fatal("%s line %d: missing argument.", filename, linenum);
0
914 filename, linenum);
never executed: fatal("%s line %d: missing argument.", filename, linenum);
0
915 value = -1;-
916 for (i = 0; multistate_ptr[i].key != NULL; i++) {
multistate_ptr...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
917 if (strcasecmp(arg, multistate_ptr[i].key) == 0) {
strcasecmp(arg...r[i].key) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
918 value = multistate_ptr[i].value;-
919 break;
never executed: break;
0
920 }-
921 }
never executed: end of block
0
922 if (value == -1)
value == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
923 fatal("%s line %d: unsupported option \"%s\".",
never executed: fatal("%s line %d: unsupported option \"%s\".", filename, linenum, arg);
0
924 filename, linenum, arg);
never executed: fatal("%s line %d: unsupported option \"%s\".", filename, linenum, arg);
0
925 if (*activep && *intptr == -1)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*intptr == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
926 *intptr = value;
never executed: *intptr = value;
0
927 break;
never executed: break;
0
928-
929 case oForwardX11:
never executed: case oForwardX11:
0
930 intptr = &options->forward_x11;-
931 goto parse_flag;
never executed: goto parse_flag;
0
932-
933 case oForwardX11Trusted:
never executed: case oForwardX11Trusted:
0
934 intptr = &options->forward_x11_trusted;-
935 goto parse_flag;
never executed: goto parse_flag;
0
936-
937 case oForwardX11Timeout:
never executed: case oForwardX11Timeout:
0
938 intptr = &options->forward_x11_timeout;-
939 goto parse_time;
never executed: goto parse_time;
0
940-
941 case oGatewayPorts:
never executed: case oGatewayPorts:
0
942 intptr = &options->fwd_opts.gateway_ports;-
943 goto parse_flag;
never executed: goto parse_flag;
0
944-
945 case oExitOnForwardFailure:
never executed: case oExitOnForwardFailure:
0
946 intptr = &options->exit_on_forward_failure;-
947 goto parse_flag;
never executed: goto parse_flag;
0
948-
949 case oPasswordAuthentication:
never executed: case oPasswordAuthentication:
0
950 intptr = &options->password_authentication;-
951 goto parse_flag;
never executed: goto parse_flag;
0
952-
953 case oKbdInteractiveAuthentication:
never executed: case oKbdInteractiveAuthentication:
0
954 intptr = &options->kbd_interactive_authentication;-
955 goto parse_flag;
never executed: goto parse_flag;
0
956-
957 case oKbdInteractiveDevices:
never executed: case oKbdInteractiveDevices:
0
958 charptr = &options->kbd_interactive_devices;-
959 goto parse_string;
never executed: goto parse_string;
0
960-
961 case oPubkeyAuthentication:
never executed: case oPubkeyAuthentication:
0
962 intptr = &options->pubkey_authentication;-
963 goto parse_flag;
never executed: goto parse_flag;
0
964-
965 case oHostbasedAuthentication:
never executed: case oHostbasedAuthentication:
0
966 intptr = &options->hostbased_authentication;-
967 goto parse_flag;
never executed: goto parse_flag;
0
968-
969 case oChallengeResponseAuthentication:
never executed: case oChallengeResponseAuthentication:
0
970 intptr = &options->challenge_response_authentication;-
971 goto parse_flag;
never executed: goto parse_flag;
0
972-
973 case oGssAuthentication:
never executed: case oGssAuthentication:
0
974 intptr = &options->gss_authentication;-
975 goto parse_flag;
never executed: goto parse_flag;
0
976-
977 case oGssDelegateCreds:
never executed: case oGssDelegateCreds:
0
978 intptr = &options->gss_deleg_creds;-
979 goto parse_flag;
never executed: goto parse_flag;
0
980-
981 case oBatchMode:
never executed: case oBatchMode:
0
982 intptr = &options->batch_mode;-
983 goto parse_flag;
never executed: goto parse_flag;
0
984-
985 case oCheckHostIP:
never executed: case oCheckHostIP:
0
986 intptr = &options->check_host_ip;-
987 goto parse_flag;
never executed: goto parse_flag;
0
988-
989 case oVerifyHostKeyDNS:
never executed: case oVerifyHostKeyDNS:
0
990 intptr = &options->verify_host_key_dns;-
991 multistate_ptr = multistate_yesnoask;-
992 goto parse_multistate;
never executed: goto parse_multistate;
0
993-
994 case oStrictHostKeyChecking:
never executed: case oStrictHostKeyChecking:
0
995 intptr = &options->strict_host_key_checking;-
996 multistate_ptr = multistate_strict_hostkey;-
997 goto parse_multistate;
never executed: goto parse_multistate;
0
998-
999 case oCompression:
never executed: case oCompression:
0
1000 intptr = &options->compression;-
1001 goto parse_flag;
never executed: goto parse_flag;
0
1002-
1003 case oTCPKeepAlive:
never executed: case oTCPKeepAlive:
0
1004 intptr = &options->tcp_keep_alive;-
1005 goto parse_flag;
never executed: goto parse_flag;
0
1006-
1007 case oNoHostAuthenticationForLocalhost:
never executed: case oNoHostAuthenticationForLocalhost:
0
1008 intptr = &options->no_host_authentication_for_localhost;-
1009 goto parse_flag;
never executed: goto parse_flag;
0
1010-
1011 case oNumberOfPasswordPrompts:
never executed: case oNumberOfPasswordPrompts:
0
1012 intptr = &options->number_of_password_prompts;-
1013 goto parse_int;
never executed: goto parse_int;
0
1014-
1015 case oRekeyLimit:
never executed: case oRekeyLimit:
0
1016 arg = strdelim(&s);-
1017 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1018 fatal("%.200s line %d: Missing argument.", filename,
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1019 linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1020 if (strcmp(arg, "default") == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "default" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1021 val64 = 0;-
1022 } else {
never executed: end of block
0
1023 if (scan_scaled(arg, &val64) == -1)
scan_scaled(arg, &val64) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1024 fatal("%.200s line %d: Bad number '%s': %s",
never executed: fatal("%.200s line %d: Bad number '%s': %s", filename, linenum, arg, strerror( (*__errno_location ()) ));
0
1025 filename, linenum, arg, strerror(errno));
never executed: fatal("%.200s line %d: Bad number '%s': %s", filename, linenum, arg, strerror( (*__errno_location ()) ));
0
1026 if (val64 != 0 && val64 < 16)
val64 != 0Description
TRUEnever evaluated
FALSEnever evaluated
val64 < 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1027 fatal("%.200s line %d: RekeyLimit too small",
never executed: fatal("%.200s line %d: RekeyLimit too small", filename, linenum);
0
1028 filename, linenum);
never executed: fatal("%.200s line %d: RekeyLimit too small", filename, linenum);
0
1029 }
never executed: end of block
0
1030 if (*activep && options->rekey_limit == -1)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
options->rekey_limit == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1031 options->rekey_limit = val64;
never executed: options->rekey_limit = val64;
0
1032 if (s != NULL) { /* optional rekey interval present */
s != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1033 if (strcmp(s, "none") == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( s ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "none" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1034 (void)strdelim(&s); /* discard */-
1035 break;
never executed: break;
0
1036 }-
1037 intptr = &options->rekey_interval;-
1038 goto parse_time;
never executed: goto parse_time;
0
1039 }-
1040 break;
never executed: break;
0
1041-
1042 case oIdentityFile:
never executed: case oIdentityFile:
0
1043 arg = strdelim(&s);-
1044 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1045 fatal("%.200s line %d: Missing argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1046 if (*activep) {
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1047 intptr = &options->num_identity_files;-
1048 if (*intptr >= SSH_MAX_IDENTITY_FILES)
*intptr >= 100Description
TRUEnever evaluated
FALSEnever evaluated
0
1049 fatal("%.200s line %d: Too many identity files specified (max %d).",
never executed: fatal("%.200s line %d: Too many identity files specified (max %d).", filename, linenum, 100);
0
1050 filename, linenum, SSH_MAX_IDENTITY_FILES);
never executed: fatal("%.200s line %d: Too many identity files specified (max %d).", filename, linenum, 100);
0
1051 add_identity_file(options, NULL,-
1052 arg, flags & SSHCONF_USERCONF);-
1053 }
never executed: end of block
0
1054 break;
never executed: break;
0
1055-
1056 case oCertificateFile:
never executed: case oCertificateFile:
0
1057 arg = strdelim(&s);-
1058 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1059 fatal("%.200s line %d: Missing argument.",
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1060 filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1061 if (*activep) {
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1062 intptr = &options->num_certificate_files;-
1063 if (*intptr >= SSH_MAX_CERTIFICATE_FILES) {
*intptr >= 100Description
TRUEnever evaluated
FALSEnever evaluated
0
1064 fatal("%.200s line %d: Too many certificate "-
1065 "files specified (max %d).",-
1066 filename, linenum,-
1067 SSH_MAX_CERTIFICATE_FILES);-
1068 }
never executed: end of block
0
1069 add_certificate_file(options, arg,-
1070 flags & SSHCONF_USERCONF);-
1071 }
never executed: end of block
0
1072 break;
never executed: break;
0
1073-
1074 case oXAuthLocation:
never executed: case oXAuthLocation:
0
1075 charptr=&options->xauth_location;-
1076 goto parse_string;
never executed: goto parse_string;
0
1077-
1078 case oUser:
never executed: case oUser:
0
1079 charptr = &options->user;-
1080parse_string:
code before this statement never executed: parse_string:
0
1081 arg = strdelim(&s);-
1082 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1083 fatal("%.200s line %d: Missing argument.",
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1084 filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1085 if (*activep && *charptr == NULL)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*charptr == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1086 *charptr = xstrdup(arg);
never executed: *charptr = xstrdup(arg);
0
1087 break;
never executed: break;
0
1088-
1089 case oGlobalKnownHostsFile:
never executed: case oGlobalKnownHostsFile:
0
1090 cpptr = (char **)&options->system_hostfiles;-
1091 uintptr = &options->num_system_hostfiles;-
1092 max_entries = SSH_MAX_HOSTS_FILES;-
1093parse_char_array:
code before this statement never executed: parse_char_array:
0
1094 if (*activep && *uintptr == 0) {
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*uintptr == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1095 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1096 if ((*uintptr) >= max_entries)
(*uintptr) >= max_entriesDescription
TRUEnever evaluated
FALSEnever evaluated
0
1097 fatal("%s line %d: "
never executed: fatal("%s line %d: " "too many authorized keys files.", filename, linenum);
0
1098 "too many authorized keys files.",
never executed: fatal("%s line %d: " "too many authorized keys files.", filename, linenum);
0
1099 filename, linenum);
never executed: fatal("%s line %d: " "too many authorized keys files.", filename, linenum);
0
1100 cpptr[(*uintptr)++] = xstrdup(arg);-
1101 }
never executed: end of block
0
1102 }
never executed: end of block
0
1103 return 0;
never executed: return 0;
0
1104-
1105 case oUserKnownHostsFile:
never executed: case oUserKnownHostsFile:
0
1106 cpptr = (char **)&options->user_hostfiles;-
1107 uintptr = &options->num_user_hostfiles;-
1108 max_entries = SSH_MAX_HOSTS_FILES;-
1109 goto parse_char_array;
never executed: goto parse_char_array;
0
1110-
1111 case oHostName:
never executed: case oHostName:
0
1112 charptr = &options->hostname;-
1113 goto parse_string;
never executed: goto parse_string;
0
1114-
1115 case oHostKeyAlias:
never executed: case oHostKeyAlias:
0
1116 charptr = &options->host_key_alias;-
1117 goto parse_string;
never executed: goto parse_string;
0
1118-
1119 case oPreferredAuthentications:
never executed: case oPreferredAuthentications:
0
1120 charptr = &options->preferred_authentications;-
1121 goto parse_string;
never executed: goto parse_string;
0
1122-
1123 case oBindAddress:
never executed: case oBindAddress:
0
1124 charptr = &options->bind_address;-
1125 goto parse_string;
never executed: goto parse_string;
0
1126-
1127 case oBindInterface:
never executed: case oBindInterface:
0
1128 charptr = &options->bind_interface;-
1129 goto parse_string;
never executed: goto parse_string;
0
1130-
1131 case oPKCS11Provider:
never executed: case oPKCS11Provider:
0
1132 charptr = &options->pkcs11_provider;-
1133 goto parse_string;
never executed: goto parse_string;
0
1134-
1135 case oProxyCommand:
never executed: case oProxyCommand:
0
1136 charptr = &options->proxy_command;-
1137 /* Ignore ProxyCommand if ProxyJump already specified */-
1138 if (options->jump_host != NULL)
options->jump_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1139 charptr = &options->jump_host; /* Skip below */
never executed: charptr = &options->jump_host;
0
1140parse_command:
code before this statement never executed: parse_command:
0
1141 if (s == NULL)
s == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1142 fatal("%.200s line %d: Missing argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1143 len = strspn(s, WHITESPACE "=");-
1144 if (*activep && *charptr == NULL)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*charptr == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1145 *charptr = xstrdup(s + len);
never executed: *charptr = xstrdup(s + len);
0
1146 return 0;
never executed: return 0;
0
1147-
1148 case oProxyJump:
never executed: case oProxyJump:
0
1149 if (s == NULL) {
s == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1150 fatal("%.200s line %d: Missing argument.",-
1151 filename, linenum);-
1152 }
never executed: end of block
0
1153 len = strspn(s, WHITESPACE "=");-
1154 if (parse_jump(s + len, options, *activep) == -1) {
parse_jump(s +...activep) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1155 fatal("%.200s line %d: Invalid ProxyJump \"%s\"",-
1156 filename, linenum, s + len);-
1157 }
never executed: end of block
0
1158 return 0;
never executed: return 0;
0
1159-
1160 case oPort:
never executed: case oPort:
0
1161 intptr = &options->port;-
1162parse_int:
code before this statement never executed: parse_int:
0
1163 arg = strdelim(&s);-
1164 if ((errstr = atoi_err(arg, &value)) != NULL)
(errstr = atoi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1165 fatal("%s line %d: integer value %s.",
never executed: fatal("%s line %d: integer value %s.", filename, linenum, errstr);
0
1166 filename, linenum, errstr);
never executed: fatal("%s line %d: integer value %s.", filename, linenum, errstr);
0
1167 if (*activep && *intptr == -1)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*intptr == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1168 *intptr = value;
never executed: *intptr = value;
0
1169 break;
never executed: break;
0
1170-
1171 case oConnectionAttempts:
never executed: case oConnectionAttempts:
0
1172 intptr = &options->connection_attempts;-
1173 goto parse_int;
never executed: goto parse_int;
0
1174-
1175 case oCiphers:
never executed: case oCiphers:
0
1176 arg = strdelim(&s);-
1177 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1178 fatal("%.200s line %d: Missing argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1179 if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg))
*arg != '-'Description
TRUEnever evaluated
FALSEnever evaluated
!ciphers_valid...arg + 1 : arg)Description
TRUEnever evaluated
FALSEnever evaluated
0
1180 fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",
never executed: fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1181 filename, linenum, arg ? arg : "<NONE>");
never executed: fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1182 if (*activep && options->ciphers == NULL)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
options->ciphe...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1183 options->ciphers = xstrdup(arg);
never executed: options->ciphers = xstrdup(arg);
0
1184 break;
never executed: break;
0
1185-
1186 case oMacs:
never executed: case oMacs:
0
1187 arg = strdelim(&s);-
1188 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1189 fatal("%.200s line %d: Missing argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1190 if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg))
*arg != '-'Description
TRUEnever evaluated
FALSEnever evaluated
!mac_valid(*ar...arg + 1 : arg)Description
TRUEnever evaluated
FALSEnever evaluated
0
1191 fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.",
never executed: fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1192 filename, linenum, arg ? arg : "<NONE>");
never executed: fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1193 if (*activep && options->macs == NULL)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
options->macs == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1194 options->macs = xstrdup(arg);
never executed: options->macs = xstrdup(arg);
0
1195 break;
never executed: break;
0
1196-
1197 case oKexAlgorithms:
never executed: case oKexAlgorithms:
0
1198 arg = strdelim(&s);-
1199 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1200 fatal("%.200s line %d: Missing argument.",
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1201 filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1202 if (*arg != '-' &&
*arg != '-'Description
TRUEnever evaluated
FALSEnever evaluated
0
1203 !kex_names_valid(*arg == '+' ? arg + 1 : arg))
!kex_names_val...arg + 1 : arg)Description
TRUEnever evaluated
FALSEnever evaluated
0
1204 fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.",
never executed: fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1205 filename, linenum, arg ? arg : "<NONE>");
never executed: fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1206 if (*activep && options->kex_algorithms == NULL)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
options->kex_a...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1207 options->kex_algorithms = xstrdup(arg);
never executed: options->kex_algorithms = xstrdup(arg);
0
1208 break;
never executed: break;
0
1209-
1210 case oHostKeyAlgorithms:
never executed: case oHostKeyAlgorithms:
0
1211 charptr = &options->hostkeyalgorithms;-
1212parse_keytypes:
code before this statement never executed: parse_keytypes:
0
1213 arg = strdelim(&s);-
1214 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1215 fatal("%.200s line %d: Missing argument.",
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1216 filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1217 if (*arg != '-' &&
*arg != '-'Description
TRUEnever evaluated
FALSEnever evaluated
0
1218 !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1))
!sshkey_names_... + 1 : arg, 1)Description
TRUEnever evaluated
FALSEnever evaluated
0
1219 fatal("%s line %d: Bad key types '%s'.",
never executed: fatal("%s line %d: Bad key types '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1220 filename, linenum, arg ? arg : "<NONE>");
never executed: fatal("%s line %d: Bad key types '%s'.", filename, linenum, arg ? arg : "<NONE>");
0
1221 if (*activep && *charptr == NULL)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*charptr == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1222 *charptr = xstrdup(arg);
never executed: *charptr = xstrdup(arg);
0
1223 break;
never executed: break;
0
1224-
1225 case oCASignatureAlgorithms:
never executed: case oCASignatureAlgorithms:
0
1226 charptr = &options->ca_sign_algorithms;-
1227 goto parse_keytypes;
never executed: goto parse_keytypes;
0
1228-
1229 case oLogLevel:
never executed: case oLogLevel:
0
1230 log_level_ptr = &options->log_level;-
1231 arg = strdelim(&s);-
1232 value = log_level_number(arg);-
1233 if (value == SYSLOG_LEVEL_NOT_SET)
value == SYSLOG_LEVEL_NOT_SETDescription
TRUEnever evaluated
FALSEnever evaluated
0
1234 fatal("%.200s line %d: unsupported log level '%s'",
never executed: fatal("%.200s line %d: unsupported log level '%s'", filename, linenum, arg ? arg : "<NONE>");
0
1235 filename, linenum, arg ? arg : "<NONE>");
never executed: fatal("%.200s line %d: unsupported log level '%s'", filename, linenum, arg ? arg : "<NONE>");
0
1236 if (*activep && *log_level_ptr == SYSLOG_LEVEL_NOT_SET)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*log_level_ptr..._LEVEL_NOT_SETDescription
TRUEnever evaluated
FALSEnever evaluated
0
1237 *log_level_ptr = (LogLevel) value;
never executed: *log_level_ptr = (LogLevel) value;
0
1238 break;
never executed: break;
0
1239-
1240 case oLogFacility:
never executed: case oLogFacility:
0
1241 log_facility_ptr = &options->log_facility;-
1242 arg = strdelim(&s);-
1243 value = log_facility_number(arg);-
1244 if (value == SYSLOG_FACILITY_NOT_SET)
value == SYSLO...CILITY_NOT_SETDescription
TRUEnever evaluated
FALSEnever evaluated
0
1245 fatal("%.200s line %d: unsupported log facility '%s'",
never executed: fatal("%.200s line %d: unsupported log facility '%s'", filename, linenum, arg ? arg : "<NONE>");
0
1246 filename, linenum, arg ? arg : "<NONE>");
never executed: fatal("%.200s line %d: unsupported log facility '%s'", filename, linenum, arg ? arg : "<NONE>");
0
1247 if (*log_facility_ptr == -1)
*log_facility_ptr == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1248 *log_facility_ptr = (SyslogFacility) value;
never executed: *log_facility_ptr = (SyslogFacility) value;
0
1249 break;
never executed: break;
0
1250-
1251 case oLocalForward:
never executed: case oLocalForward:
0
1252 case oRemoteForward:
never executed: case oRemoteForward:
0
1253 case oDynamicForward:
never executed: case oDynamicForward:
0
1254 arg = strdelim(&s);-
1255 if (arg == NULL || *arg == '\0')
arg == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1256 fatal("%.200s line %d: Missing port argument.",
never executed: fatal("%.200s line %d: Missing port argument.", filename, linenum);
0
1257 filename, linenum);
never executed: fatal("%.200s line %d: Missing port argument.", filename, linenum);
0
1258-
1259 remotefwd = (opcode == oRemoteForward);-
1260 dynamicfwd = (opcode == oDynamicForward);-
1261-
1262 if (!dynamicfwd) {
!dynamicfwdDescription
TRUEnever evaluated
FALSEnever evaluated
0
1263 arg2 = strdelim(&s);-
1264 if (arg2 == NULL || *arg2 == '\0') {
arg2 == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg2 == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1265 if (remotefwd)
remotefwdDescription
TRUEnever evaluated
FALSEnever evaluated
0
1266 dynamicfwd = 1;
never executed: dynamicfwd = 1;
0
1267 else-
1268 fatal("%.200s line %d: Missing target "
never executed: fatal("%.200s line %d: Missing target " "argument.", filename, linenum);
0
1269 "argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing target " "argument.", filename, linenum);
0
1270 } else {-
1271 /* construct a string for parse_forward */-
1272 snprintf(fwdarg, sizeof(fwdarg), "%s:%s", arg,-
1273 arg2);-
1274 }
never executed: end of block
0
1275 }-
1276 if (dynamicfwd)
dynamicfwdDescription
TRUEnever evaluated
FALSEnever evaluated
0
1277 strlcpy(fwdarg, arg, sizeof(fwdarg));
never executed: strlcpy(fwdarg, arg, sizeof(fwdarg));
0
1278-
1279 if (parse_forward(&fwd, fwdarg, dynamicfwd, remotefwd) == 0)
parse_forward(...emotefwd) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1280 fatal("%.200s line %d: Bad forwarding specification.",
never executed: fatal("%.200s line %d: Bad forwarding specification.", filename, linenum);
0
1281 filename, linenum);
never executed: fatal("%.200s line %d: Bad forwarding specification.", filename, linenum);
0
1282-
1283 if (*activep) {
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1284 if (remotefwd) {
remotefwdDescription
TRUEnever evaluated
FALSEnever evaluated
0
1285 add_remote_forward(options, &fwd);-
1286 } else {
never executed: end of block
0
1287 add_local_forward(options, &fwd);-
1288 }
never executed: end of block
0
1289 }-
1290 break;
never executed: break;
0
1291-
1292 case oClearAllForwardings:
never executed: case oClearAllForwardings:
0
1293 intptr = &options->clear_forwardings;-
1294 goto parse_flag;
never executed: goto parse_flag;
0
1295-
1296 case oHost:
never executed: case oHost:
0
1297 if (cmdline)
cmdlineDescription
TRUEnever evaluated
FALSEnever evaluated
0
1298 fatal("Host directive not supported as a command-line "
never executed: fatal("Host directive not supported as a command-line " "option");
0
1299 "option");
never executed: fatal("Host directive not supported as a command-line " "option");
0
1300 *activep = 0;-
1301 arg2 = NULL;-
1302 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1303 if ((flags & SSHCONF_NEVERMATCH) != 0)
(flags & 8) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1304 break;
never executed: break;
0
1305 negated = *arg == '!';-
1306 if (negated)
negatedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1307 arg++;
never executed: arg++;
0
1308 if (match_pattern(host, arg)) {
match_pattern(host, arg)Description
TRUEnever evaluated
FALSEnever evaluated
0
1309 if (negated) {
negatedDescription
TRUEnever evaluated
FALSEnever evaluated
0
1310 debug("%.200s line %d: Skipping Host "-
1311 "block because of negated match "-
1312 "for %.100s", filename, linenum,-
1313 arg);-
1314 *activep = 0;-
1315 break;
never executed: break;
0
1316 }-
1317 if (!*activep)
!*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1318 arg2 = arg; /* logged below */
never executed: arg2 = arg;
0
1319 *activep = 1;-
1320 }
never executed: end of block
0
1321 }
never executed: end of block
0
1322 if (*activep)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1323 debug("%.200s line %d: Applying options for %.100s",
never executed: debug("%.200s line %d: Applying options for %.100s", filename, linenum, arg2);
0
1324 filename, linenum, arg2);
never executed: debug("%.200s line %d: Applying options for %.100s", filename, linenum, arg2);
0
1325 /* Avoid garbage check below, as strdelim is done. */-
1326 return 0;
never executed: return 0;
0
1327-
1328 case oMatch:
never executed: case oMatch:
0
1329 if (cmdline)
cmdlineDescription
TRUEnever evaluated
FALSEnever evaluated
0
1330 fatal("Host directive not supported as a command-line "
never executed: fatal("Host directive not supported as a command-line " "option");
0
1331 "option");
never executed: fatal("Host directive not supported as a command-line " "option");
0
1332 value = match_cfg_line(options, &s, pw, host, original_host,-
1333 flags & SSHCONF_POSTCANON, filename, linenum);-
1334 if (value < 0)
value < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1335 fatal("%.200s line %d: Bad Match condition", filename,
never executed: fatal("%.200s line %d: Bad Match condition", filename, linenum);
0
1336 linenum);
never executed: fatal("%.200s line %d: Bad Match condition", filename, linenum);
0
1337 *activep = (flags & SSHCONF_NEVERMATCH) ? 0 : value;
(flags & 8)Description
TRUEnever evaluated
FALSEnever evaluated
0
1338 break;
never executed: break;
0
1339-
1340 case oEscapeChar:
never executed: case oEscapeChar:
0
1341 intptr = &options->escape_char;-
1342 arg = strdelim(&s);-
1343 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1344 fatal("%.200s line %d: Missing argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1345 if (strcmp(arg, "none") == 0)
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "none" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1346 value = SSH_ESCAPECHAR_NONE;
never executed: value = -2;
0
1347 else if (arg[1] == '\0')
arg[1] == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1348 value = (u_char) arg[0];
never executed: value = (u_char) arg[0];
0
1349 else if (arg[0] == '^' && arg[2] == 0 &&
arg[0] == '^'Description
TRUEnever evaluated
FALSEnever evaluated
arg[2] == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1350 (u_char) arg[1] >= 64 && (u_char) arg[1] < 128)
(u_char) arg[1] >= 64Description
TRUEnever evaluated
FALSEnever evaluated
(u_char) arg[1] < 128Description
TRUEnever evaluated
FALSEnever evaluated
0
1351 value = (u_char) arg[1] & 31;
never executed: value = (u_char) arg[1] & 31;
0
1352 else {-
1353 fatal("%.200s line %d: Bad escape character.",-
1354 filename, linenum);-
1355 /* NOTREACHED */-
1356 value = 0; /* Avoid compiler warning. */-
1357 }
never executed: end of block
0
1358 if (*activep && *intptr == -1)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*intptr == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1359 *intptr = value;
never executed: *intptr = value;
0
1360 break;
never executed: break;
0
1361-
1362 case oAddressFamily:
never executed: case oAddressFamily:
0
1363 intptr = &options->address_family;-
1364 multistate_ptr = multistate_addressfamily;-
1365 goto parse_multistate;
never executed: goto parse_multistate;
0
1366-
1367 case oEnableSSHKeysign:
never executed: case oEnableSSHKeysign:
0
1368 intptr = &options->enable_ssh_keysign;-
1369 goto parse_flag;
never executed: goto parse_flag;
0
1370-
1371 case oIdentitiesOnly:
never executed: case oIdentitiesOnly:
0
1372 intptr = &options->identities_only;-
1373 goto parse_flag;
never executed: goto parse_flag;
0
1374-
1375 case oServerAliveInterval:
never executed: case oServerAliveInterval:
0
1376 intptr = &options->server_alive_interval;-
1377 goto parse_time;
never executed: goto parse_time;
0
1378-
1379 case oServerAliveCountMax:
never executed: case oServerAliveCountMax:
0
1380 intptr = &options->server_alive_count_max;-
1381 goto parse_int;
never executed: goto parse_int;
0
1382-
1383 case oSendEnv:
never executed: case oSendEnv:
0
1384 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1385 if (strchr(arg, '=') != NULL)
(__extension__...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( '=' )Description
TRUEnever evaluated
FALSEnever evaluated
!__builtin_constant_p ( arg )Description
TRUEnever evaluated
FALSEnever evaluated
( '=' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1386 fatal("%s line %d: Invalid environment name.",
never executed: fatal("%s line %d: Invalid environment name.", filename, linenum);
0
1387 filename, linenum);
never executed: fatal("%s line %d: Invalid environment name.", filename, linenum);
0
1388 if (!*activep)
!*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1389 continue;
never executed: continue;
0
1390 if (*arg == '-') {
*arg == '-'Description
TRUEnever evaluated
FALSEnever evaluated
0
1391 /* Removing an env var */-
1392 rm_env(options, arg, filename, linenum);-
1393 continue;
never executed: continue;
0
1394 } else {-
1395 /* Adding an env var */-
1396 if (options->num_send_env >= INT_MAX)
options->num_s... >= 0x7fffffffDescription
TRUEnever evaluated
FALSEnever evaluated
0
1397 fatal("%s line %d: too many send env.",
never executed: fatal("%s line %d: too many send env.", filename, linenum);
0
1398 filename, linenum);
never executed: fatal("%s line %d: too many send env.", filename, linenum);
0
1399 options->send_env = xrecallocarray(-
1400 options->send_env, options->num_send_env,-
1401 options->num_send_env + 1,-
1402 sizeof(*options->send_env));-
1403 options->send_env[options->num_send_env++] =-
1404 xstrdup(arg);-
1405 }
never executed: end of block
0
1406 }-
1407 break;
never executed: break;
0
1408-
1409 case oSetEnv:
never executed: case oSetEnv:
0
1410 value = options->num_setenv;-
1411 while ((arg = strdelimw(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1412 if (strchr(arg, '=') == NULL)
(__extension__...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( '=' )Description
TRUEnever evaluated
FALSEnever evaluated
!__builtin_constant_p ( arg )Description
TRUEnever evaluated
FALSEnever evaluated
( '=' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1413 fatal("%s line %d: Invalid SetEnv.",
never executed: fatal("%s line %d: Invalid SetEnv.", filename, linenum);
0
1414 filename, linenum);
never executed: fatal("%s line %d: Invalid SetEnv.", filename, linenum);
0
1415 if (!*activep || value != 0)
!*activepDescription
TRUEnever evaluated
FALSEnever evaluated
value != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1416 continue;
never executed: continue;
0
1417 /* Adding a setenv var */-
1418 if (options->num_setenv >= INT_MAX)
options->num_s... >= 0x7fffffffDescription
TRUEnever evaluated
FALSEnever evaluated
0
1419 fatal("%s line %d: too many SetEnv.",
never executed: fatal("%s line %d: too many SetEnv.", filename, linenum);
0
1420 filename, linenum);
never executed: fatal("%s line %d: too many SetEnv.", filename, linenum);
0
1421 options->setenv = xrecallocarray(-
1422 options->setenv, options->num_setenv,-
1423 options->num_setenv + 1, sizeof(*options->setenv));-
1424 options->setenv[options->num_setenv++] = xstrdup(arg);-
1425 }
never executed: end of block
0
1426 break;
never executed: break;
0
1427-
1428 case oControlPath:
never executed: case oControlPath:
0
1429 charptr = &options->control_path;-
1430 goto parse_string;
never executed: goto parse_string;
0
1431-
1432 case oControlMaster:
never executed: case oControlMaster:
0
1433 intptr = &options->control_master;-
1434 multistate_ptr = multistate_controlmaster;-
1435 goto parse_multistate;
never executed: goto parse_multistate;
0
1436-
1437 case oControlPersist:
never executed: case oControlPersist:
0
1438 /* no/false/yes/true, or a time spec */-
1439 intptr = &options->control_persist;-
1440 arg = strdelim(&s);-
1441 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1442 fatal("%.200s line %d: Missing ControlPersist"
never executed: fatal("%.200s line %d: Missing ControlPersist" " argument.", filename, linenum);
0
1443 " argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing ControlPersist" " argument.", filename, linenum);
0
1444 value = 0;-
1445 value2 = 0; /* timeout */-
1446 if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0)
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "no" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "false" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1447 value = 0;
never executed: value = 0;
0
1448 else if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "yes" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "true" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1449 value = 1;
never executed: value = 1;
0
1450 else if ((value2 = convtime(arg)) >= 0)
(value2 = convtime(arg)) >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1451 value = 1;
never executed: value = 1;
0
1452 else-
1453 fatal("%.200s line %d: Bad ControlPersist argument.",
never executed: fatal("%.200s line %d: Bad ControlPersist argument.", filename, linenum);
0
1454 filename, linenum);
never executed: fatal("%.200s line %d: Bad ControlPersist argument.", filename, linenum);
0
1455 if (*activep && *intptr == -1) {
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*intptr == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1456 *intptr = value;-
1457 options->control_persist_timeout = value2;-
1458 }
never executed: end of block
0
1459 break;
never executed: break;
0
1460-
1461 case oHashKnownHosts:
never executed: case oHashKnownHosts:
0
1462 intptr = &options->hash_known_hosts;-
1463 goto parse_flag;
never executed: goto parse_flag;
0
1464-
1465 case oTunnel:
never executed: case oTunnel:
0
1466 intptr = &options->tun_open;-
1467 multistate_ptr = multistate_tunnel;-
1468 goto parse_multistate;
never executed: goto parse_multistate;
0
1469-
1470 case oTunnelDevice:
never executed: case oTunnelDevice:
0
1471 arg = strdelim(&s);-
1472 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1473 fatal("%.200s line %d: Missing argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1474 value = a2tun(arg, &value2);-
1475 if (value == SSH_TUNID_ERR)
value == (0x7fffffff - 1)Description
TRUEnever evaluated
FALSEnever evaluated
0
1476 fatal("%.200s line %d: Bad tun device.", filename, linenum);
never executed: fatal("%.200s line %d: Bad tun device.", filename, linenum);
0
1477 if (*activep) {
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1478 options->tun_local = value;-
1479 options->tun_remote = value2;-
1480 }
never executed: end of block
0
1481 break;
never executed: break;
0
1482-
1483 case oLocalCommand:
never executed: case oLocalCommand:
0
1484 charptr = &options->local_command;-
1485 goto parse_command;
never executed: goto parse_command;
0
1486-
1487 case oPermitLocalCommand:
never executed: case oPermitLocalCommand:
0
1488 intptr = &options->permit_local_command;-
1489 goto parse_flag;
never executed: goto parse_flag;
0
1490-
1491 case oRemoteCommand:
never executed: case oRemoteCommand:
0
1492 charptr = &options->remote_command;-
1493 goto parse_command;
never executed: goto parse_command;
0
1494-
1495 case oVisualHostKey:
never executed: case oVisualHostKey:
0
1496 intptr = &options->visual_host_key;-
1497 goto parse_flag;
never executed: goto parse_flag;
0
1498-
1499 case oInclude:
never executed: case oInclude:
0
1500 if (cmdline)
cmdlineDescription
TRUEnever evaluated
FALSEnever evaluated
0
1501 fatal("Include directive not supported as a "
never executed: fatal("Include directive not supported as a " "command-line option");
0
1502 "command-line option");
never executed: fatal("Include directive not supported as a " "command-line option");
0
1503 value = 0;-
1504 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1505 /*-
1506 * Ensure all paths are anchored. User configuration-
1507 * files may begin with '~/' but system configurations-
1508 * must not. If the path is relative, then treat it-
1509 * as living in ~/.ssh for user configurations or-
1510 * /etc/ssh for system ones.-
1511 */-
1512 if (*arg == '~' && (flags & SSHCONF_USERCONF) == 0)
*arg == '~'Description
TRUEnever evaluated
FALSEnever evaluated
(flags & 2) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1513 fatal("%.200s line %d: bad include path %s.",
never executed: fatal("%.200s line %d: bad include path %s.", filename, linenum, arg);
0
1514 filename, linenum, arg);
never executed: fatal("%.200s line %d: bad include path %s.", filename, linenum, arg);
0
1515 if (*arg != '/' && *arg != '~') {
*arg != '/'Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '~'Description
TRUEnever evaluated
FALSEnever evaluated
0
1516 xasprintf(&arg2, "%s/%s",-
1517 (flags & SSHCONF_USERCONF) ?-
1518 "~/" _PATH_SSH_USER_DIR : SSHDIR, arg);-
1519 } else
never executed: end of block
0
1520 arg2 = xstrdup(arg);
never executed: arg2 = xstrdup(arg);
0
1521 memset(&gl, 0, sizeof(gl));-
1522 r = glob(arg2, GLOB_TILDE, NULL, &gl);-
1523 if (r == GLOB_NOMATCH) {
r == (-3)Description
TRUEnever evaluated
FALSEnever evaluated
0
1524 debug("%.200s line %d: include %s matched no "-
1525 "files",filename, linenum, arg2);-
1526 free(arg2);-
1527 continue;
never executed: continue;
0
1528 } else if (r != 0 || gl.gl_pathc < 0)
r != 0Description
TRUEnever evaluated
FALSEnever evaluated
gl.gl_pathc < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1529 fatal("%.200s line %d: glob failed for %s.",
never executed: fatal("%.200s line %d: glob failed for %s.", filename, linenum, arg2);
0
1530 filename, linenum, arg2);
never executed: fatal("%.200s line %d: glob failed for %s.", filename, linenum, arg2);
0
1531 free(arg2);-
1532 oactive = *activep;-
1533 for (i = 0; i < (u_int)gl.gl_pathc; i++) {
i < (u_int)gl.gl_pathcDescription
TRUEnever evaluated
FALSEnever evaluated
0
1534 debug3("%.200s line %d: Including file %s "-
1535 "depth %d%s", filename, linenum,-
1536 gl.gl_pathv[i], depth,-
1537 oactive ? "" : " (parse only)");-
1538 r = read_config_file_depth(gl.gl_pathv[i],-
1539 pw, host, original_host, options,-
1540 flags | SSHCONF_CHECKPERM |-
1541 (oactive ? 0 : SSHCONF_NEVERMATCH),-
1542 activep, depth + 1);-
1543 if (r != 1 && errno != ENOENT) {
r != 1Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) != 2Description
TRUEnever evaluated
FALSEnever evaluated
0
1544 fatal("Can't open user config file "-
1545 "%.100s: %.100s", gl.gl_pathv[i],-
1546 strerror(errno));-
1547 }
never executed: end of block
0
1548 /*-
1549 * don't let Match in includes clobber the-
1550 * containing file's Match state.-
1551 */-
1552 *activep = oactive;-
1553 if (r != 1)
r != 1Description
TRUEnever evaluated
FALSEnever evaluated
0
1554 value = -1;
never executed: value = -1;
0
1555 }
never executed: end of block
0
1556 globfree(&gl);-
1557 }
never executed: end of block
0
1558 if (value != 0)
value != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1559 return value;
never executed: return value;
0
1560 break;
never executed: break;
0
1561-
1562 case oIPQoS:
never executed: case oIPQoS:
0
1563 arg = strdelim(&s);-
1564 if ((value = parse_ipqos(arg)) == -1)
(value = parse...os(arg)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1565 fatal("%s line %d: Bad IPQoS value: %s",
never executed: fatal("%s line %d: Bad IPQoS value: %s", filename, linenum, arg);
0
1566 filename, linenum, arg);
never executed: fatal("%s line %d: Bad IPQoS value: %s", filename, linenum, arg);
0
1567 arg = strdelim(&s);-
1568 if (arg == NULL)
arg == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1569 value2 = value;
never executed: value2 = value;
0
1570 else if ((value2 = parse_ipqos(arg)) == -1)
(value2 = pars...os(arg)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1571 fatal("%s line %d: Bad IPQoS value: %s",
never executed: fatal("%s line %d: Bad IPQoS value: %s", filename, linenum, arg);
0
1572 filename, linenum, arg);
never executed: fatal("%s line %d: Bad IPQoS value: %s", filename, linenum, arg);
0
1573 if (*activep) {
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
0
1574 options->ip_qos_interactive = value;-
1575 options->ip_qos_bulk = value2;-
1576 }
never executed: end of block
0
1577 break;
never executed: break;
0
1578-
1579 case oRequestTTY:
never executed: case oRequestTTY:
0
1580 intptr = &options->request_tty;-
1581 multistate_ptr = multistate_requesttty;-
1582 goto parse_multistate;
never executed: goto parse_multistate;
0
1583-
1584 case oIgnoreUnknown:
never executed: case oIgnoreUnknown:
0
1585 charptr = &options->ignored_unknown;-
1586 goto parse_string;
never executed: goto parse_string;
0
1587-
1588 case oProxyUseFdpass:
never executed: case oProxyUseFdpass:
0
1589 intptr = &options->proxy_use_fdpass;-
1590 goto parse_flag;
never executed: goto parse_flag;
0
1591-
1592 case oCanonicalDomains:
never executed: case oCanonicalDomains:
0
1593 value = options->num_canonical_domains != 0;-
1594 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1595 if (!valid_domain(arg, 1, &errstr)) {
!valid_domain(arg, 1, &errstr)Description
TRUEnever evaluated
FALSEnever evaluated
0
1596 fatal("%s line %d: %s", filename, linenum,-
1597 errstr);-
1598 }
never executed: end of block
0
1599 if (!*activep || value)
!*activepDescription
TRUEnever evaluated
FALSEnever evaluated
valueDescription
TRUEnever evaluated
FALSEnever evaluated
0
1600 continue;
never executed: continue;
0
1601 if (options->num_canonical_domains >= MAX_CANON_DOMAINS)
options->num_c..._domains >= 32Description
TRUEnever evaluated
FALSEnever evaluated
0
1602 fatal("%s line %d: too many hostname suffixes.",
never executed: fatal("%s line %d: too many hostname suffixes.", filename, linenum);
0
1603 filename, linenum);
never executed: fatal("%s line %d: too many hostname suffixes.", filename, linenum);
0
1604 options->canonical_domains[-
1605 options->num_canonical_domains++] = xstrdup(arg);-
1606 }
never executed: end of block
0
1607 break;
never executed: break;
0
1608-
1609 case oCanonicalizePermittedCNAMEs:
never executed: case oCanonicalizePermittedCNAMEs:
0
1610 value = options->num_permitted_cnames != 0;-
1611 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1612 /* Either '*' for everything or 'list:list' */-
1613 if (strcmp(arg, "*") == 0)
never executed: __result = (((const unsigned char *) (const char *) ( arg ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "*" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1614 arg2 = arg;
never executed: arg2 = arg;
0
1615 else {-
1616 lowercase(arg);-
1617 if ((arg2 = strchr(arg, ':')) == NULL ||
(arg2 = (__ext...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( ':' )Description
TRUEnever evaluated
FALSEnever evaluated
!__builtin_constant_p ( arg )Description
TRUEnever evaluated
FALSEnever evaluated
( ':' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1618 arg2[1] == '\0') {
arg2[1] == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1619 fatal("%s line %d: "-
1620 "Invalid permitted CNAME \"%s\"",-
1621 filename, linenum, arg);-
1622 }
never executed: end of block
0
1623 *arg2 = '\0';-
1624 arg2++;-
1625 }
never executed: end of block
0
1626 if (!*activep || value)
!*activepDescription
TRUEnever evaluated
FALSEnever evaluated
valueDescription
TRUEnever evaluated
FALSEnever evaluated
0
1627 continue;
never executed: continue;
0
1628 if (options->num_permitted_cnames >= MAX_CANON_DOMAINS)
options->num_p...d_cnames >= 32Description
TRUEnever evaluated
FALSEnever evaluated
0
1629 fatal("%s line %d: too many permitted CNAMEs.",
never executed: fatal("%s line %d: too many permitted CNAMEs.", filename, linenum);
0
1630 filename, linenum);
never executed: fatal("%s line %d: too many permitted CNAMEs.", filename, linenum);
0
1631 cname = options->permitted_cnames +-
1632 options->num_permitted_cnames++;-
1633 cname->source_list = xstrdup(arg);-
1634 cname->target_list = xstrdup(arg2);-
1635 }
never executed: end of block
0
1636 break;
never executed: break;
0
1637-
1638 case oCanonicalizeHostname:
never executed: case oCanonicalizeHostname:
0
1639 intptr = &options->canonicalize_hostname;-
1640 multistate_ptr = multistate_canonicalizehostname;-
1641 goto parse_multistate;
never executed: goto parse_multistate;
0
1642-
1643 case oCanonicalizeMaxDots:
never executed: case oCanonicalizeMaxDots:
0
1644 intptr = &options->canonicalize_max_dots;-
1645 goto parse_int;
never executed: goto parse_int;
0
1646-
1647 case oCanonicalizeFallbackLocal:
never executed: case oCanonicalizeFallbackLocal:
0
1648 intptr = &options->canonicalize_fallback_local;-
1649 goto parse_flag;
never executed: goto parse_flag;
0
1650-
1651 case oStreamLocalBindMask:
never executed: case oStreamLocalBindMask:
0
1652 arg = strdelim(&s);-
1653 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1654 fatal("%.200s line %d: Missing StreamLocalBindMask argument.", filename, linenum);
never executed: fatal("%.200s line %d: Missing StreamLocalBindMask argument.", filename, linenum);
0
1655 /* Parse mode in octal format */-
1656 value = strtol(arg, &endofnumber, 8);-
1657 if (arg == endofnumber || value < 0 || value > 0777)
arg == endofnumberDescription
TRUEnever evaluated
FALSEnever evaluated
value < 0Description
TRUEnever evaluated
FALSEnever evaluated
value > 0777Description
TRUEnever evaluated
FALSEnever evaluated
0
1658 fatal("%.200s line %d: Bad mask.", filename, linenum);
never executed: fatal("%.200s line %d: Bad mask.", filename, linenum);
0
1659 options->fwd_opts.streamlocal_bind_mask = (mode_t)value;-
1660 break;
never executed: break;
0
1661-
1662 case oStreamLocalBindUnlink:
never executed: case oStreamLocalBindUnlink:
0
1663 intptr = &options->fwd_opts.streamlocal_bind_unlink;-
1664 goto parse_flag;
never executed: goto parse_flag;
0
1665-
1666 case oRevokedHostKeys:
never executed: case oRevokedHostKeys:
0
1667 charptr = &options->revoked_host_keys;-
1668 goto parse_string;
never executed: goto parse_string;
0
1669-
1670 case oFingerprintHash:
never executed: case oFingerprintHash:
0
1671 intptr = &options->fingerprint_hash;-
1672 arg = strdelim(&s);-
1673 if (!arg || *arg == '\0')
!argDescription
TRUEnever evaluated
FALSEnever evaluated
*arg == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1674 fatal("%.200s line %d: Missing argument.",
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1675 filename, linenum);
never executed: fatal("%.200s line %d: Missing argument.", filename, linenum);
0
1676 if ((value = ssh_digest_alg_by_name(arg)) == -1)
(value = ssh_d...me(arg)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1677 fatal("%.200s line %d: Invalid hash algorithm \"%s\".",
never executed: fatal("%.200s line %d: Invalid hash algorithm \"%s\".", filename, linenum, arg);
0
1678 filename, linenum, arg);
never executed: fatal("%.200s line %d: Invalid hash algorithm \"%s\".", filename, linenum, arg);
0
1679 if (*activep && *intptr == -1)
*activepDescription
TRUEnever evaluated
FALSEnever evaluated
*intptr == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1680 *intptr = value;
never executed: *intptr = value;
0
1681 break;
never executed: break;
0
1682-
1683 case oUpdateHostkeys:
never executed: case oUpdateHostkeys:
0
1684 intptr = &options->update_hostkeys;-
1685 multistate_ptr = multistate_yesnoask;-
1686 goto parse_multistate;
never executed: goto parse_multistate;
0
1687-
1688 case oHostbasedKeyTypes:
never executed: case oHostbasedKeyTypes:
0
1689 charptr = &options->hostbased_key_types;-
1690 goto parse_keytypes;
never executed: goto parse_keytypes;
0
1691-
1692 case oPubkeyAcceptedKeyTypes:
never executed: case oPubkeyAcceptedKeyTypes:
0
1693 charptr = &options->pubkey_key_types;-
1694 goto parse_keytypes;
never executed: goto parse_keytypes;
0
1695-
1696 case oAddKeysToAgent:
never executed: case oAddKeysToAgent:
0
1697 intptr = &options->add_keys_to_agent;-
1698 multistate_ptr = multistate_yesnoaskconfirm;-
1699 goto parse_multistate;
never executed: goto parse_multistate;
0
1700-
1701 case oIdentityAgent:
never executed: case oIdentityAgent:
0
1702 charptr = &options->identity_agent;-
1703 goto parse_string;
never executed: goto parse_string;
0
1704-
1705 case oDeprecated:
never executed: case oDeprecated:
0
1706 debug("%s line %d: Deprecated option \"%s\"",-
1707 filename, linenum, keyword);-
1708 return 0;
never executed: return 0;
0
1709-
1710 case oUnsupported:
never executed: case oUnsupported:
0
1711 error("%s line %d: Unsupported option \"%s\"",-
1712 filename, linenum, keyword);-
1713 return 0;
never executed: return 0;
0
1714-
1715 default:
never executed: default:
0
1716 fatal("%s: Unimplemented opcode %d", __func__, opcode);-
1717 }
never executed: end of block
0
1718-
1719 /* Check that there is no garbage at end of line. */-
1720 if ((arg = strdelim(&s)) != NULL && *arg != '\0') {
(arg = strdeli...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*arg != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1721 fatal("%.200s line %d: garbage at end of line; \"%.200s\".",-
1722 filename, linenum, arg);-
1723 }
never executed: end of block
0
1724 return 0;
never executed: return 0;
0
1725}-
1726-
1727/*-
1728 * Reads the config file and modifies the options accordingly. Options-
1729 * should already be initialized before this call. This never returns if-
1730 * there is an error. If the file does not exist, this returns 0.-
1731 */-
1732int-
1733read_config_file(const char *filename, struct passwd *pw, const char *host,-
1734 const char *original_host, Options *options, int flags)-
1735{-
1736 int active = 1;-
1737-
1738 return read_config_file_depth(filename, pw, host, original_host,
never executed: return read_config_file_depth(filename, pw, host, original_host, options, flags, &active, 0);
0
1739 options, flags, &active, 0);
never executed: return read_config_file_depth(filename, pw, host, original_host, options, flags, &active, 0);
0
1740}-
1741-
1742#define READCONF_MAX_DEPTH 16-
1743static int-
1744read_config_file_depth(const char *filename, struct passwd *pw,-
1745 const char *host, const char *original_host, Options *options,-
1746 int flags, int *activep, int depth)-
1747{-
1748 FILE *f;-
1749 char *line = NULL;-
1750 size_t linesize = 0;-
1751 int linenum;-
1752 int bad_options = 0;-
1753-
1754 if (depth < 0 || depth > READCONF_MAX_DEPTH)
depth < 0Description
TRUEnever evaluated
FALSEnever evaluated
depth > 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1755 fatal("Too many recursive configuration includes");
never executed: fatal("Too many recursive configuration includes");
0
1756-
1757 if ((f = fopen(filename, "r")) == NULL)
(f = fopen(fil...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1758 return 0;
never executed: return 0;
0
1759-
1760 if (flags & SSHCONF_CHECKPERM) {
flags & 1Description
TRUEnever evaluated
FALSEnever evaluated
0
1761 struct stat sb;-
1762-
1763 if (fstat(fileno(f), &sb) == -1)
fstat(fileno(f), &sb) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1764 fatal("fstat %s: %s", filename, strerror(errno));
never executed: fatal("fstat %s: %s", filename, strerror( (*__errno_location ()) ));
0
1765 if (((sb.st_uid != 0 && sb.st_uid != getuid()) ||
sb.st_uid != 0Description
TRUEnever evaluated
FALSEnever evaluated
sb.st_uid != getuid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1766 (sb.st_mode & 022) != 0))
(sb.st_mode & 022) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1767 fatal("Bad owner or permissions on %s", filename);
never executed: fatal("Bad owner or permissions on %s", filename);
0
1768 }
never executed: end of block
0
1769-
1770 debug("Reading configuration data %.200s", filename);-
1771-
1772 /*-
1773 * Mark that we are now processing the options. This flag is turned-
1774 * on/off by Host specifications.-
1775 */-
1776 linenum = 0;-
1777 while (getline(&line, &linesize, f) != -1) {
getline(&line,...size, f) != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1778 /* Update line number counter. */-
1779 linenum++;-
1780 if (process_config_line_depth(options, pw, host, original_host,
process_config...s, depth) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1781 line, filename, linenum, activep, flags, depth) != 0)
process_config...s, depth) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1782 bad_options++;
never executed: bad_options++;
0
1783 }
never executed: end of block
0
1784 free(line);-
1785 fclose(f);-
1786 if (bad_options > 0)
bad_options > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1787 fatal("%s: terminating, %d bad configuration options",
never executed: fatal("%s: terminating, %d bad configuration options", filename, bad_options);
0
1788 filename, bad_options);
never executed: fatal("%s: terminating, %d bad configuration options", filename, bad_options);
0
1789 return 1;
never executed: return 1;
0
1790}-
1791-
1792/* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */-
1793int-
1794option_clear_or_none(const char *o)-
1795{-
1796 return o == NULL || strcasecmp(o, "none") == 0;
never executed: return o == ((void *)0) || strcasecmp(o, "none") == 0;
o == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
strcasecmp(o, "none") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1797}-
1798-
1799/*-
1800 * Initializes options to special values that indicate that they have not yet-
1801 * been set. Read_config_file will only set options with this value. Options-
1802 * are processed in the following order: command line, user config file,-
1803 * system config file. Last, fill_default_options is called.-
1804 */-
1805-
1806void-
1807initialize_options(Options * options)-
1808{-
1809 memset(options, 'X', sizeof(*options));-
1810 options->forward_agent = -1;-
1811 options->forward_x11 = -1;-
1812 options->forward_x11_trusted = -1;-
1813 options->forward_x11_timeout = -1;-
1814 options->stdio_forward_host = NULL;-
1815 options->stdio_forward_port = 0;-
1816 options->clear_forwardings = -1;-
1817 options->exit_on_forward_failure = -1;-
1818 options->xauth_location = NULL;-
1819 options->fwd_opts.gateway_ports = -1;-
1820 options->fwd_opts.streamlocal_bind_mask = (mode_t)-1;-
1821 options->fwd_opts.streamlocal_bind_unlink = -1;-
1822 options->pubkey_authentication = -1;-
1823 options->challenge_response_authentication = -1;-
1824 options->gss_authentication = -1;-
1825 options->gss_deleg_creds = -1;-
1826 options->password_authentication = -1;-
1827 options->kbd_interactive_authentication = -1;-
1828 options->kbd_interactive_devices = NULL;-
1829 options->hostbased_authentication = -1;-
1830 options->batch_mode = -1;-
1831 options->check_host_ip = -1;-
1832 options->strict_host_key_checking = -1;-
1833 options->compression = -1;-
1834 options->tcp_keep_alive = -1;-
1835 options->port = -1;-
1836 options->address_family = -1;-
1837 options->connection_attempts = -1;-
1838 options->connection_timeout = -1;-
1839 options->number_of_password_prompts = -1;-
1840 options->ciphers = NULL;-
1841 options->macs = NULL;-
1842 options->kex_algorithms = NULL;-
1843 options->hostkeyalgorithms = NULL;-
1844 options->ca_sign_algorithms = NULL;-
1845 options->num_identity_files = 0;-
1846 options->num_certificate_files = 0;-
1847 options->hostname = NULL;-
1848 options->host_key_alias = NULL;-
1849 options->proxy_command = NULL;-
1850 options->jump_user = NULL;-
1851 options->jump_host = NULL;-
1852 options->jump_port = -1;-
1853 options->jump_extra = NULL;-
1854 options->user = NULL;-
1855 options->escape_char = -1;-
1856 options->num_system_hostfiles = 0;-
1857 options->num_user_hostfiles = 0;-
1858 options->local_forwards = NULL;-
1859 options->num_local_forwards = 0;-
1860 options->remote_forwards = NULL;-
1861 options->num_remote_forwards = 0;-
1862 options->log_facility = SYSLOG_FACILITY_NOT_SET;-
1863 options->log_level = SYSLOG_LEVEL_NOT_SET;-
1864 options->preferred_authentications = NULL;-
1865 options->bind_address = NULL;-
1866 options->bind_interface = NULL;-
1867 options->pkcs11_provider = NULL;-
1868 options->enable_ssh_keysign = - 1;-
1869 options->no_host_authentication_for_localhost = - 1;-
1870 options->identities_only = - 1;-
1871 options->rekey_limit = - 1;-
1872 options->rekey_interval = -1;-
1873 options->verify_host_key_dns = -1;-
1874 options->server_alive_interval = -1;-
1875 options->server_alive_count_max = -1;-
1876 options->send_env = NULL;-
1877 options->num_send_env = 0;-
1878 options->setenv = NULL;-
1879 options->num_setenv = 0;-
1880 options->control_path = NULL;-
1881 options->control_master = -1;-
1882 options->control_persist = -1;-
1883 options->control_persist_timeout = 0;-
1884 options->hash_known_hosts = -1;-
1885 options->tun_open = -1;-
1886 options->tun_local = -1;-
1887 options->tun_remote = -1;-
1888 options->local_command = NULL;-
1889 options->permit_local_command = -1;-
1890 options->remote_command = NULL;-
1891 options->add_keys_to_agent = -1;-
1892 options->identity_agent = NULL;-
1893 options->visual_host_key = -1;-
1894 options->ip_qos_interactive = -1;-
1895 options->ip_qos_bulk = -1;-
1896 options->request_tty = -1;-
1897 options->proxy_use_fdpass = -1;-
1898 options->ignored_unknown = NULL;-
1899 options->num_canonical_domains = 0;-
1900 options->num_permitted_cnames = 0;-
1901 options->canonicalize_max_dots = -1;-
1902 options->canonicalize_fallback_local = -1;-
1903 options->canonicalize_hostname = -1;-
1904 options->revoked_host_keys = NULL;-
1905 options->fingerprint_hash = -1;-
1906 options->update_hostkeys = -1;-
1907 options->hostbased_key_types = NULL;-
1908 options->pubkey_key_types = NULL;-
1909}
never executed: end of block
0
1910-
1911/*-
1912 * A petite version of fill_default_options() that just fills the options-
1913 * needed for hostname canonicalization to proceed.-
1914 */-
1915void-
1916fill_default_options_for_canonicalization(Options *options)-
1917{-
1918 if (options->canonicalize_max_dots == -1)
options->canon...max_dots == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1919 options->canonicalize_max_dots = 1;
never executed: options->canonicalize_max_dots = 1;
0
1920 if (options->canonicalize_fallback_local == -1)
options->canon...ck_local == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1921 options->canonicalize_fallback_local = 1;
never executed: options->canonicalize_fallback_local = 1;
0
1922 if (options->canonicalize_hostname == -1)
options->canon...hostname == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1923 options->canonicalize_hostname = SSH_CANONICALISE_NO;
never executed: options->canonicalize_hostname = 0;
0
1924}
never executed: end of block
0
1925-
1926/*-
1927 * Called after processing other sources of option data, this fills those-
1928 * options for which no value has been specified with their default values.-
1929 */-
1930void-
1931fill_default_options(Options * options)-
1932{-
1933 char *all_cipher, *all_mac, *all_kex, *all_key, *all_sig;-
1934 int r;-
1935-
1936 if (options->forward_agent == -1)
options->forward_agent == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1937 options->forward_agent = 0;
never executed: options->forward_agent = 0;
0
1938 if (options->forward_x11 == -1)
options->forward_x11 == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1939 options->forward_x11 = 0;
never executed: options->forward_x11 = 0;
0
1940 if (options->forward_x11_trusted == -1)
options->forwa..._trusted == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1941 options->forward_x11_trusted = 0;
never executed: options->forward_x11_trusted = 0;
0
1942 if (options->forward_x11_timeout == -1)
options->forwa..._timeout == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1943 options->forward_x11_timeout = 1200;
never executed: options->forward_x11_timeout = 1200;
0
1944 /*-
1945 * stdio forwarding (-W) changes the default for these but we defer-
1946 * setting the values so they can be overridden.-
1947 */-
1948 if (options->exit_on_forward_failure == -1)
options->exit_..._failure == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1949 options->exit_on_forward_failure =
never executed: options->exit_on_forward_failure = options->stdio_forward_host != ((void *)0) ? 1 : 0;
0
1950 options->stdio_forward_host != NULL ? 1 : 0;
never executed: options->exit_on_forward_failure = options->stdio_forward_host != ((void *)0) ? 1 : 0;
options->stdio...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1951 if (options->clear_forwardings == -1)
options->clear...wardings == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1952 options->clear_forwardings =
never executed: options->clear_forwardings = options->stdio_forward_host != ((void *)0) ? 1 : 0;
0
1953 options->stdio_forward_host != NULL ? 1 : 0;
never executed: options->clear_forwardings = options->stdio_forward_host != ((void *)0) ? 1 : 0;
options->stdio...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1954 if (options->clear_forwardings == 1)
options->clear...rwardings == 1Description
TRUEnever evaluated
FALSEnever evaluated
0
1955 clear_forwardings(options);
never executed: clear_forwardings(options);
0
1956-
1957 if (options->xauth_location == NULL)
options->xauth...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1958 options->xauth_location = _PATH_XAUTH;
never executed: options->xauth_location = "/usr/bin/xauth";
0
1959 if (options->fwd_opts.gateway_ports == -1)
options->fwd_o...ay_ports == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1960 options->fwd_opts.gateway_ports = 0;
never executed: options->fwd_opts.gateway_ports = 0;
0
1961 if (options->fwd_opts.streamlocal_bind_mask == (mode_t)-1)
options->fwd_o... == (mode_t)-1Description
TRUEnever evaluated
FALSEnever evaluated
0
1962 options->fwd_opts.streamlocal_bind_mask = 0177;
never executed: options->fwd_opts.streamlocal_bind_mask = 0177;
0
1963 if (options->fwd_opts.streamlocal_bind_unlink == -1)
options->fwd_o...d_unlink == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1964 options->fwd_opts.streamlocal_bind_unlink = 0;
never executed: options->fwd_opts.streamlocal_bind_unlink = 0;
0
1965 if (options->pubkey_authentication == -1)
options->pubke...tication == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1966 options->pubkey_authentication = 1;
never executed: options->pubkey_authentication = 1;
0
1967 if (options->challenge_response_authentication == -1)
options->chall...tication == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1968 options->challenge_response_authentication = 1;
never executed: options->challenge_response_authentication = 1;
0
1969 if (options->gss_authentication == -1)
options->gss_a...tication == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1970 options->gss_authentication = 0;
never executed: options->gss_authentication = 0;
0
1971 if (options->gss_deleg_creds == -1)
options->gss_deleg_creds == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1972 options->gss_deleg_creds = 0;
never executed: options->gss_deleg_creds = 0;
0
1973 if (options->password_authentication == -1)
options->passw...tication == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1974 options->password_authentication = 1;
never executed: options->password_authentication = 1;
0
1975 if (options->kbd_interactive_authentication == -1)
options->kbd_i...tication == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1976 options->kbd_interactive_authentication = 1;
never executed: options->kbd_interactive_authentication = 1;
0
1977 if (options->hostbased_authentication == -1)
options->hostb...tication == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1978 options->hostbased_authentication = 0;
never executed: options->hostbased_authentication = 0;
0
1979 if (options->batch_mode == -1)
options->batch_mode == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1980 options->batch_mode = 0;
never executed: options->batch_mode = 0;
0
1981 if (options->check_host_ip == -1)
options->check_host_ip == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1982 options->check_host_ip = 1;
never executed: options->check_host_ip = 1;
0
1983 if (options->strict_host_key_checking == -1)
options->stric...checking == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1984 options->strict_host_key_checking = SSH_STRICT_HOSTKEY_ASK;
never executed: options->strict_host_key_checking = 3;
0
1985 if (options->compression == -1)
options->compression == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1986 options->compression = 0;
never executed: options->compression = 0;
0
1987 if (options->tcp_keep_alive == -1)
options->tcp_keep_alive == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1988 options->tcp_keep_alive = 1;
never executed: options->tcp_keep_alive = 1;
0
1989 if (options->port == -1)
options->port == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1990 options->port = 0; /* Filled in ssh_connect. */
never executed: options->port = 0;
0
1991 if (options->address_family == -1)
options->address_family == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1992 options->address_family = AF_UNSPEC;
never executed: options->address_family = 0 ;
0
1993 if (options->connection_attempts == -1)
options->conne...attempts == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1994 options->connection_attempts = 1;
never executed: options->connection_attempts = 1;
0
1995 if (options->number_of_password_prompts == -1)
options->numbe..._prompts == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1996 options->number_of_password_prompts = 3;
never executed: options->number_of_password_prompts = 3;
0
1997 /* options->hostkeyalgorithms, default set in myproposals.h */-
1998 if (options->add_keys_to_agent == -1)
options->add_k...to_agent == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1999 options->add_keys_to_agent = 0;
never executed: options->add_keys_to_agent = 0;
0
2000 if (options->num_identity_files == 0) {
options->num_i...ity_files == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2001 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_RSA, 0);-
2002 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_DSA, 0);-
2003#ifdef OPENSSL_HAS_ECC-
2004 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_ECDSA, 0);-
2005#endif-
2006 add_identity_file(options, "~/",-
2007 _PATH_SSH_CLIENT_ID_ED25519, 0);-
2008 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_XMSS, 0);-
2009 }
never executed: end of block
0
2010 if (options->escape_char == -1)
options->escape_char == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2011 options->escape_char = '~';
never executed: options->escape_char = '~';
0
2012 if (options->num_system_hostfiles == 0) {
options->num_s...hostfiles == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2013 options->system_hostfiles[options->num_system_hostfiles++] =-
2014 xstrdup(_PATH_SSH_SYSTEM_HOSTFILE);-
2015 options->system_hostfiles[options->num_system_hostfiles++] =-
2016 xstrdup(_PATH_SSH_SYSTEM_HOSTFILE2);-
2017 }
never executed: end of block
0
2018 if (options->num_user_hostfiles == 0) {
options->num_u...hostfiles == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2019 options->user_hostfiles[options->num_user_hostfiles++] =-
2020 xstrdup(_PATH_SSH_USER_HOSTFILE);-
2021 options->user_hostfiles[options->num_user_hostfiles++] =-
2022 xstrdup(_PATH_SSH_USER_HOSTFILE2);-
2023 }
never executed: end of block
0
2024 if (options->log_level == SYSLOG_LEVEL_NOT_SET)
options->log_l..._LEVEL_NOT_SETDescription
TRUEnever evaluated
FALSEnever evaluated
0
2025 options->log_level = SYSLOG_LEVEL_INFO;
never executed: options->log_level = SYSLOG_LEVEL_INFO;
0
2026 if (options->log_facility == SYSLOG_FACILITY_NOT_SET)
options->log_f...CILITY_NOT_SETDescription
TRUEnever evaluated
FALSEnever evaluated
0
2027 options->log_facility = SYSLOG_FACILITY_USER;
never executed: options->log_facility = SYSLOG_FACILITY_USER;
0
2028 if (options->no_host_authentication_for_localhost == - 1)
options->no_ho...calhost == - 1Description
TRUEnever evaluated
FALSEnever evaluated
0
2029 options->no_host_authentication_for_localhost = 0;
never executed: options->no_host_authentication_for_localhost = 0;
0
2030 if (options->identities_only == -1)
options->identities_only == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2031 options->identities_only = 0;
never executed: options->identities_only = 0;
0
2032 if (options->enable_ssh_keysign == -1)
options->enabl..._keysign == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2033 options->enable_ssh_keysign = 0;
never executed: options->enable_ssh_keysign = 0;
0
2034 if (options->rekey_limit == -1)
options->rekey_limit == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2035 options->rekey_limit = 0;
never executed: options->rekey_limit = 0;
0
2036 if (options->rekey_interval == -1)
options->rekey_interval == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2037 options->rekey_interval = 0;
never executed: options->rekey_interval = 0;
0
2038 if (options->verify_host_key_dns == -1)
options->verif..._key_dns == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2039 options->verify_host_key_dns = 0;
never executed: options->verify_host_key_dns = 0;
0
2040 if (options->server_alive_interval == -1)
options->serve...interval == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2041 options->server_alive_interval = 0;
never executed: options->server_alive_interval = 0;
0
2042 if (options->server_alive_count_max == -1)
options->serve...ount_max == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2043 options->server_alive_count_max = 3;
never executed: options->server_alive_count_max = 3;
0
2044 if (options->control_master == -1)
options->control_master == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2045 options->control_master = 0;
never executed: options->control_master = 0;
0
2046 if (options->control_persist == -1) {
options->control_persist == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2047 options->control_persist = 0;-
2048 options->control_persist_timeout = 0;-
2049 }
never executed: end of block
0
2050 if (options->hash_known_hosts == -1)
options->hash_...wn_hosts == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2051 options->hash_known_hosts = 0;
never executed: options->hash_known_hosts = 0;
0
2052 if (options->tun_open == -1)
options->tun_open == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2053 options->tun_open = SSH_TUNMODE_NO;
never executed: options->tun_open = 0x00;
0
2054 if (options->tun_local == -1)
options->tun_local == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2055 options->tun_local = SSH_TUNID_ANY;
never executed: options->tun_local = 0x7fffffff;
0
2056 if (options->tun_remote == -1)
options->tun_remote == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2057 options->tun_remote = SSH_TUNID_ANY;
never executed: options->tun_remote = 0x7fffffff;
0
2058 if (options->permit_local_command == -1)
options->permi..._command == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2059 options->permit_local_command = 0;
never executed: options->permit_local_command = 0;
0
2060 if (options->visual_host_key == -1)
options->visual_host_key == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2061 options->visual_host_key = 0;
never executed: options->visual_host_key = 0;
0
2062 if (options->ip_qos_interactive == -1)
options->ip_qo...eractive == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2063 options->ip_qos_interactive = IPTOS_DSCP_AF21;
never executed: options->ip_qos_interactive = 0x48 ;
0
2064 if (options->ip_qos_bulk == -1)
options->ip_qos_bulk == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2065 options->ip_qos_bulk = IPTOS_DSCP_CS1;
never executed: options->ip_qos_bulk = 0x20;
0
2066 if (options->request_tty == -1)
options->request_tty == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2067 options->request_tty = REQUEST_TTY_AUTO;
never executed: options->request_tty = 0;
0
2068 if (options->proxy_use_fdpass == -1)
options->proxy...e_fdpass == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2069 options->proxy_use_fdpass = 0;
never executed: options->proxy_use_fdpass = 0;
0
2070 if (options->canonicalize_max_dots == -1)
options->canon...max_dots == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2071 options->canonicalize_max_dots = 1;
never executed: options->canonicalize_max_dots = 1;
0
2072 if (options->canonicalize_fallback_local == -1)
options->canon...ck_local == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2073 options->canonicalize_fallback_local = 1;
never executed: options->canonicalize_fallback_local = 1;
0
2074 if (options->canonicalize_hostname == -1)
options->canon...hostname == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2075 options->canonicalize_hostname = SSH_CANONICALISE_NO;
never executed: options->canonicalize_hostname = 0;
0
2076 if (options->fingerprint_hash == -1)
options->finge...int_hash == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2077 options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
never executed: options->fingerprint_hash = 2;
0
2078 if (options->update_hostkeys == -1)
options->update_hostkeys == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2079 options->update_hostkeys = 0;
never executed: options->update_hostkeys = 0;
0
2080-
2081 /* Expand KEX name lists */-
2082 all_cipher = cipher_alg_list(',', 0);-
2083 all_mac = mac_alg_list(',');-
2084 all_kex = kex_alg_list(',');-
2085 all_key = sshkey_alg_list(0, 0, 1, ',');-
2086 all_sig = sshkey_alg_list(0, 1, 1, ',');-
2087#define ASSEMBLE(what, defaults, all) \-
2088 do { \-
2089 if ((r = kex_assemble_names(&options->what, \-
2090 defaults, all)) != 0) \-
2091 fatal("%s: %s: %s", __func__, #what, ssh_err(r)); \-
2092 } while (0)-
2093 ASSEMBLE(ciphers, KEX_SERVER_ENCRYPT, all_cipher);
never executed: fatal("%s: %s: %s", __func__, "ciphers", ssh_err(r));
(r = kex_assem..._cipher)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2094 ASSEMBLE(macs, KEX_SERVER_MAC, all_mac);
never executed: fatal("%s: %s: %s", __func__, "macs", ssh_err(r));
(r = kex_assem...all_mac)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2095 ASSEMBLE(kex_algorithms, KEX_SERVER_KEX, all_kex);
never executed: fatal("%s: %s: %s", __func__, "kex_algorithms", ssh_err(r));
(r = kex_assem...all_kex)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2096 ASSEMBLE(hostbased_key_types, KEX_DEFAULT_PK_ALG, all_key);
never executed: fatal("%s: %s: %s", __func__, "hostbased_key_types", ssh_err(r));
(r = kex_assem...all_key)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2097 ASSEMBLE(pubkey_key_types, KEX_DEFAULT_PK_ALG, all_key);
never executed: fatal("%s: %s: %s", __func__, "pubkey_key_types", ssh_err(r));
(r = kex_assem...all_key)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2098 ASSEMBLE(ca_sign_algorithms, SSH_ALLOWED_CA_SIGALGS, all_sig);
never executed: fatal("%s: %s: %s", __func__, "ca_sign_algorithms", ssh_err(r));
(r = kex_assem...all_sig)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2099#undef ASSEMBLE-
2100 free(all_cipher);-
2101 free(all_mac);-
2102 free(all_kex);-
2103 free(all_key);-
2104 free(all_sig);-
2105-
2106#define CLEAR_ON_NONE(v) \-
2107 do { \-
2108 if (option_clear_or_none(v)) { \-
2109 free(v); \-
2110 v = NULL; \-
2111 } \-
2112 } while(0)-
2113 CLEAR_ON_NONE(options->local_command);
never executed: end of block
option_clear_o...local_command)Description
TRUEnever evaluated
FALSEnever evaluated
0
2114 CLEAR_ON_NONE(options->remote_command);
never executed: end of block
option_clear_o...emote_command)Description
TRUEnever evaluated
FALSEnever evaluated
0
2115 CLEAR_ON_NONE(options->proxy_command);
never executed: end of block
option_clear_o...proxy_command)Description
TRUEnever evaluated
FALSEnever evaluated
0
2116 CLEAR_ON_NONE(options->control_path);
never executed: end of block
option_clear_o...>control_path)Description
TRUEnever evaluated
FALSEnever evaluated
0
2117 CLEAR_ON_NONE(options->revoked_host_keys);
never executed: end of block
option_clear_o...ked_host_keys)Description
TRUEnever evaluated
FALSEnever evaluated
0
2118 if (options->jump_host != NULL &&
options->jump_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2119 strcmp(options->jump_host, "none") == 0 &&
never executed: __result = (((const unsigned char *) (const char *) ( options->jump_host ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "none" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2120 options->jump_port == 0 && options->jump_user == NULL) {
options->jump_port == 0Description
TRUEnever evaluated
FALSEnever evaluated
options->jump_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2121 free(options->jump_host);-
2122 options->jump_host = NULL;-
2123 }
never executed: end of block
0
2124 /* options->identity_agent distinguishes NULL from 'none' */-
2125 /* options->user will be set in the main program if appropriate */-
2126 /* options->hostname will be set in the main program if appropriate */-
2127 /* options->host_key_alias should not be set by default */-
2128 /* options->preferred_authentications will be set in ssh */-
2129}
never executed: end of block
0
2130-
2131struct fwdarg {-
2132 char *arg;-
2133 int ispath;-
2134};-
2135-
2136/*-
2137 * parse_fwd_field-
2138 * parses the next field in a port forwarding specification.-
2139 * sets fwd to the parsed field and advances p past the colon-
2140 * or sets it to NULL at end of string.-
2141 * returns 0 on success, else non-zero.-
2142 */-
2143static int-
2144parse_fwd_field(char **p, struct fwdarg *fwd)-
2145{-
2146 char *ep, *cp = *p;-
2147 int ispath = 0;-
2148-
2149 if (*cp == '\0') {
*cp == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2150 *p = NULL;-
2151 return -1; /* end of string */
never executed: return -1;
0
2152 }-
2153-
2154 /*-
2155 * A field escaped with square brackets is used literally.-
2156 * XXX - allow ']' to be escaped via backslash?-
2157 */-
2158 if (*cp == '[') {
*cp == '['Description
TRUEnever evaluated
FALSEnever evaluated
0
2159 /* find matching ']' */-
2160 for (ep = cp + 1; *ep != ']' && *ep != '\0'; ep++) {
*ep != ']'Description
TRUEnever evaluated
FALSEnever evaluated
*ep != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2161 if (*ep == '/')
*ep == '/'Description
TRUEnever evaluated
FALSEnever evaluated
0
2162 ispath = 1;
never executed: ispath = 1;
0
2163 }
never executed: end of block
0
2164 /* no matching ']' or not at end of field. */-
2165 if (ep[0] != ']' || (ep[1] != ':' && ep[1] != '\0'))
ep[0] != ']'Description
TRUEnever evaluated
FALSEnever evaluated
ep[1] != ':'Description
TRUEnever evaluated
FALSEnever evaluated
ep[1] != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2166 return -1;
never executed: return -1;
0
2167 /* NUL terminate the field and advance p past the colon */-
2168 *ep++ = '\0';-
2169 if (*ep != '\0')
*ep != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2170 *ep++ = '\0';
never executed: *ep++ = '\0';
0
2171 fwd->arg = cp + 1;-
2172 fwd->ispath = ispath;-
2173 *p = ep;-
2174 return 0;
never executed: return 0;
0
2175 }-
2176-
2177 for (cp = *p; *cp != '\0'; cp++) {
*cp != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2178 switch (*cp) {-
2179 case '\\':
never executed: case '\\':
0
2180 memmove(cp, cp + 1, strlen(cp + 1) + 1);-
2181 if (*cp == '\0')
*cp == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2182 return -1;
never executed: return -1;
0
2183 break;
never executed: break;
0
2184 case '/':
never executed: case '/':
0
2185 ispath = 1;-
2186 break;
never executed: break;
0
2187 case ':':
never executed: case ':':
0
2188 *cp++ = '\0';-
2189 goto done;
never executed: goto done;
0
2190 }-
2191 }
never executed: end of block
0
2192done:
code before this statement never executed: done:
0
2193 fwd->arg = *p;-
2194 fwd->ispath = ispath;-
2195 *p = cp;-
2196 return 0;
never executed: return 0;
0
2197}-
2198-
2199/*-
2200 * parse_forward-
2201 * parses a string containing a port forwarding specification of the form:-
2202 * dynamicfwd == 0-
2203 * [listenhost:]listenport|listenpath:connecthost:connectport|connectpath-
2204 * listenpath:connectpath-
2205 * dynamicfwd == 1-
2206 * [listenhost:]listenport-
2207 * returns number of arguments parsed or zero on error-
2208 */-
2209int-
2210parse_forward(struct Forward *fwd, const char *fwdspec, int dynamicfwd, int remotefwd)-
2211{-
2212 struct fwdarg fwdargs[4];-
2213 char *p, *cp;-
2214 int i;-
2215-
2216 memset(fwd, 0, sizeof(*fwd));-
2217 memset(fwdargs, 0, sizeof(fwdargs));-
2218-
2219 cp = p = xstrdup(fwdspec);-
2220-
2221 /* skip leading spaces */-
2222 while (isspace((u_char)*cp))
((*__ctype_b_l...int) _ISspace)Description
TRUEnever evaluated
FALSEnever evaluated
0
2223 cp++;
never executed: cp++;
0
2224-
2225 for (i = 0; i < 4; ++i) {
i < 4Description
TRUEnever evaluated
FALSEnever evaluated
0
2226 if (parse_fwd_field(&cp, &fwdargs[i]) != 0)
parse_fwd_fiel...dargs[i]) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2227 break;
never executed: break;
0
2228 }
never executed: end of block
0
2229-
2230 /* Check for trailing garbage */-
2231 if (cp != NULL && *cp != '\0') {
cp != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
*cp != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2232 i = 0; /* failure */-
2233 }
never executed: end of block
0
2234-
2235 switch (i) {-
2236 case 1:
never executed: case 1:
0
2237 if (fwdargs[0].ispath) {
fwdargs[0].ispathDescription
TRUEnever evaluated
FALSEnever evaluated
0
2238 fwd->listen_path = xstrdup(fwdargs[0].arg);-
2239 fwd->listen_port = PORT_STREAMLOCAL;-
2240 } else {
never executed: end of block
0
2241 fwd->listen_host = NULL;-
2242 fwd->listen_port = a2port(fwdargs[0].arg);-
2243 }
never executed: end of block
0
2244 fwd->connect_host = xstrdup("socks");-
2245 break;
never executed: break;
0
2246-
2247 case 2:
never executed: case 2:
0
2248 if (fwdargs[0].ispath && fwdargs[1].ispath) {
fwdargs[0].ispathDescription
TRUEnever evaluated
FALSEnever evaluated
fwdargs[1].ispathDescription
TRUEnever evaluated
FALSEnever evaluated
0
2249 fwd->listen_path = xstrdup(fwdargs[0].arg);-
2250 fwd->listen_port = PORT_STREAMLOCAL;-
2251 fwd->connect_path = xstrdup(fwdargs[1].arg);-
2252 fwd->connect_port = PORT_STREAMLOCAL;-
2253 } else if (fwdargs[1].ispath) {
never executed: end of block
fwdargs[1].ispathDescription
TRUEnever evaluated
FALSEnever evaluated
0
2254 fwd->listen_host = NULL;-
2255 fwd->listen_port = a2port(fwdargs[0].arg);-
2256 fwd->connect_path = xstrdup(fwdargs[1].arg);-
2257 fwd->connect_port = PORT_STREAMLOCAL;-
2258 } else {
never executed: end of block
0
2259 fwd->listen_host = xstrdup(fwdargs[0].arg);-
2260 fwd->listen_port = a2port(fwdargs[1].arg);-
2261 fwd->connect_host = xstrdup("socks");-
2262 }
never executed: end of block
0
2263 break;
never executed: break;
0
2264-
2265 case 3:
never executed: case 3:
0
2266 if (fwdargs[0].ispath) {
fwdargs[0].ispathDescription
TRUEnever evaluated
FALSEnever evaluated
0
2267 fwd->listen_path = xstrdup(fwdargs[0].arg);-
2268 fwd->listen_port = PORT_STREAMLOCAL;-
2269 fwd->connect_host = xstrdup(fwdargs[1].arg);-
2270 fwd->connect_port = a2port(fwdargs[2].arg);-
2271 } else if (fwdargs[2].ispath) {
never executed: end of block
fwdargs[2].ispathDescription
TRUEnever evaluated
FALSEnever evaluated
0
2272 fwd->listen_host = xstrdup(fwdargs[0].arg);-
2273 fwd->listen_port = a2port(fwdargs[1].arg);-
2274 fwd->connect_path = xstrdup(fwdargs[2].arg);-
2275 fwd->connect_port = PORT_STREAMLOCAL;-
2276 } else {
never executed: end of block
0
2277 fwd->listen_host = NULL;-
2278 fwd->listen_port = a2port(fwdargs[0].arg);-
2279 fwd->connect_host = xstrdup(fwdargs[1].arg);-
2280 fwd->connect_port = a2port(fwdargs[2].arg);-
2281 }
never executed: end of block
0
2282 break;
never executed: break;
0
2283-
2284 case 4:
never executed: case 4:
0
2285 fwd->listen_host = xstrdup(fwdargs[0].arg);-
2286 fwd->listen_port = a2port(fwdargs[1].arg);-
2287 fwd->connect_host = xstrdup(fwdargs[2].arg);-
2288 fwd->connect_port = a2port(fwdargs[3].arg);-
2289 break;
never executed: break;
0
2290 default:
never executed: default:
0
2291 i = 0; /* failure */-
2292 }
never executed: end of block
0
2293-
2294 free(p);-
2295-
2296 if (dynamicfwd) {
dynamicfwdDescription
TRUEnever evaluated
FALSEnever evaluated
0
2297 if (!(i == 1 || i == 2))
i == 1Description
TRUEnever evaluated
FALSEnever evaluated
i == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
2298 goto fail_free;
never executed: goto fail_free;
0
2299 } else {
never executed: end of block
0
2300 if (!(i == 3 || i == 4)) {
i == 3Description
TRUEnever evaluated
FALSEnever evaluated
i == 4Description
TRUEnever evaluated
FALSEnever evaluated
0
2301 if (fwd->connect_path == NULL &&
fwd->connect_p...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2302 fwd->listen_path == NULL)
fwd->listen_pa...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2303 goto fail_free;
never executed: goto fail_free;
0
2304 }
never executed: end of block
0
2305 if (fwd->connect_port <= 0 && fwd->connect_path == NULL)
fwd->connect_port <= 0Description
TRUEnever evaluated
FALSEnever evaluated
fwd->connect_p...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2306 goto fail_free;
never executed: goto fail_free;
0
2307 }
never executed: end of block
0
2308-
2309 if ((fwd->listen_port < 0 && fwd->listen_path == NULL) ||
fwd->listen_port < 0Description
TRUEnever evaluated
FALSEnever evaluated
fwd->listen_pa...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2310 (!remotefwd && fwd->listen_port == 0))
!remotefwdDescription
TRUEnever evaluated
FALSEnever evaluated
fwd->listen_port == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2311 goto fail_free;
never executed: goto fail_free;
0
2312 if (fwd->connect_host != NULL &&
fwd->connect_h...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2313 strlen(fwd->connect_host) >= NI_MAXHOST)
strlen(fwd->co..._host) >= 1025Description
TRUEnever evaluated
FALSEnever evaluated
0
2314 goto fail_free;
never executed: goto fail_free;
0
2315 /* XXX - if connecting to a remote socket, max sun len may not match this host */-
2316 if (fwd->connect_path != NULL &&
fwd->connect_p...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2317 strlen(fwd->connect_path) >= PATH_MAX_SUN)
strlen(fwd->co...)0)->sun_path)Description
TRUEnever evaluated
FALSEnever evaluated
0
2318 goto fail_free;
never executed: goto fail_free;
0
2319 if (fwd->listen_host != NULL &&
fwd->listen_ho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2320 strlen(fwd->listen_host) >= NI_MAXHOST)
strlen(fwd->li..._host) >= 1025Description
TRUEnever evaluated
FALSEnever evaluated
0
2321 goto fail_free;
never executed: goto fail_free;
0
2322 if (fwd->listen_path != NULL &&
fwd->listen_pa...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2323 strlen(fwd->listen_path) >= PATH_MAX_SUN)
strlen(fwd->li...)0)->sun_path)Description
TRUEnever evaluated
FALSEnever evaluated
0
2324 goto fail_free;
never executed: goto fail_free;
0
2325-
2326 return (i);
never executed: return (i);
0
2327-
2328 fail_free:-
2329 free(fwd->connect_host);-
2330 fwd->connect_host = NULL;-
2331 free(fwd->connect_path);-
2332 fwd->connect_path = NULL;-
2333 free(fwd->listen_host);-
2334 fwd->listen_host = NULL;-
2335 free(fwd->listen_path);-
2336 fwd->listen_path = NULL;-
2337 return (0);
never executed: return (0);
0
2338}-
2339-
2340int-
2341parse_jump(const char *s, Options *o, int active)-
2342{-
2343 char *orig, *sdup, *cp;-
2344 char *host = NULL, *user = NULL;-
2345 int ret = -1, port = -1, first;-
2346-
2347 active &= o->proxy_command == NULL && o->jump_host == NULL;
o->proxy_comma...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
o->jump_host == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2348-
2349 orig = sdup = xstrdup(s);-
2350 first = active;-
2351 do {-
2352 if (strcasecmp(s, "none") == 0)
strcasecmp(s, "none") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2353 break;
never executed: break;
0
2354 if ((cp = strrchr(sdup, ',')) == NULL)
(cp = strrchr(...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2355 cp = sdup; /* last */
never executed: cp = sdup;
0
2356 else-
2357 *cp++ = '\0';
never executed: *cp++ = '\0';
0
2358-
2359 if (first) {
firstDescription
TRUEnever evaluated
FALSEnever evaluated
0
2360 /* First argument and configuration is active */-
2361 if (parse_ssh_uri(cp, &user, &host, &port) == -1 ||
parse_ssh_uri(..., &port) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2362 parse_user_host_port(cp, &user, &host, &port) != 0)
parse_user_hos...t, &port) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2363 goto out;
never executed: goto out;
0
2364 } else {
never executed: end of block
0
2365 /* Subsequent argument or inactive configuration */-
2366 if (parse_ssh_uri(cp, NULL, NULL, NULL) == -1 ||
parse_ssh_uri(...d *)0) ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2367 parse_user_host_port(cp, NULL, NULL, NULL) != 0)
parse_user_hos...id *)0) ) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2368 goto out;
never executed: goto out;
0
2369 }
never executed: end of block
0
2370 first = 0; /* only check syntax for subsequent hosts */-
2371 } while (cp != sdup);
never executed: end of block
cp != sdupDescription
TRUEnever evaluated
FALSEnever evaluated
0
2372 /* success */-
2373 if (active) {
activeDescription
TRUEnever evaluated
FALSEnever evaluated
0
2374 if (strcasecmp(s, "none") == 0) {
strcasecmp(s, "none") == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2375 o->jump_host = xstrdup("none");-
2376 o->jump_port = 0;-
2377 } else {
never executed: end of block
0
2378 o->jump_user = user;-
2379 o->jump_host = host;-
2380 o->jump_port = port;-
2381 o->proxy_command = xstrdup("none");-
2382 user = host = NULL;-
2383 if ((cp = strrchr(s, ',')) != NULL && cp != s) {
(cp = strrchr(...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
cp != sDescription
TRUEnever evaluated
FALSEnever evaluated
0
2384 o->jump_extra = xstrdup(s);-
2385 o->jump_extra[cp - s] = '\0';-
2386 }
never executed: end of block
0
2387 }
never executed: end of block
0
2388 }-
2389 ret = 0;-
2390 out:
code before this statement never executed: out:
0
2391 free(orig);-
2392 free(user);-
2393 free(host);-
2394 return ret;
never executed: return ret;
0
2395}-
2396-
2397int-
2398parse_ssh_uri(const char *uri, char **userp, char **hostp, int *portp)-
2399{-
2400 char *path;-
2401 int r;-
2402-
2403 r = parse_uri("ssh", uri, userp, hostp, portp, &path);-
2404 if (r == 0 && path != NULL)
r == 0Description
TRUEnever evaluated
FALSEnever evaluated
path != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2405 r = -1; /* path not allowed */
never executed: r = -1;
0
2406 return r;
never executed: return r;
0
2407}-
2408-
2409/* XXX the following is a near-vebatim copy from servconf.c; refactor */-
2410static const char *-
2411fmt_multistate_int(int val, const struct multistate *m)-
2412{-
2413 u_int i;-
2414-
2415 for (i = 0; m[i].key != NULL; i++) {
m[i].key != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2416 if (m[i].value == val)
m[i].value == valDescription
TRUEnever evaluated
FALSEnever evaluated
0
2417 return m[i].key;
never executed: return m[i].key;
0
2418 }
never executed: end of block
0
2419 return "UNKNOWN";
never executed: return "UNKNOWN";
0
2420}-
2421-
2422static const char *-
2423fmt_intarg(OpCodes code, int val)-
2424{-
2425 if (val == -1)
val == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2426 return "unset";
never executed: return "unset";
0
2427 switch (code) {-
2428 case oAddressFamily:
never executed: case oAddressFamily:
0
2429 return fmt_multistate_int(val, multistate_addressfamily);
never executed: return fmt_multistate_int(val, multistate_addressfamily);
0
2430 case oVerifyHostKeyDNS:
never executed: case oVerifyHostKeyDNS:
0
2431 case oUpdateHostkeys:
never executed: case oUpdateHostkeys:
0
2432 return fmt_multistate_int(val, multistate_yesnoask);
never executed: return fmt_multistate_int(val, multistate_yesnoask);
0
2433 case oStrictHostKeyChecking:
never executed: case oStrictHostKeyChecking:
0
2434 return fmt_multistate_int(val, multistate_strict_hostkey);
never executed: return fmt_multistate_int(val, multistate_strict_hostkey);
0
2435 case oControlMaster:
never executed: case oControlMaster:
0
2436 return fmt_multistate_int(val, multistate_controlmaster);
never executed: return fmt_multistate_int(val, multistate_controlmaster);
0
2437 case oTunnel:
never executed: case oTunnel:
0
2438 return fmt_multistate_int(val, multistate_tunnel);
never executed: return fmt_multistate_int(val, multistate_tunnel);
0
2439 case oRequestTTY:
never executed: case oRequestTTY:
0
2440 return fmt_multistate_int(val, multistate_requesttty);
never executed: return fmt_multistate_int(val, multistate_requesttty);
0
2441 case oCanonicalizeHostname:
never executed: case oCanonicalizeHostname:
0
2442 return fmt_multistate_int(val, multistate_canonicalizehostname);
never executed: return fmt_multistate_int(val, multistate_canonicalizehostname);
0
2443 case oAddKeysToAgent:
never executed: case oAddKeysToAgent:
0
2444 return fmt_multistate_int(val, multistate_yesnoaskconfirm);
never executed: return fmt_multistate_int(val, multistate_yesnoaskconfirm);
0
2445 case oFingerprintHash:
never executed: case oFingerprintHash:
0
2446 return ssh_digest_alg_name(val);
never executed: return ssh_digest_alg_name(val);
0
2447 default:
never executed: default:
0
2448 switch (val) {-
2449 case 0:
never executed: case 0:
0
2450 return "no";
never executed: return "no";
0
2451 case 1:
never executed: case 1:
0
2452 return "yes";
never executed: return "yes";
0
2453 default:
never executed: default:
0
2454 return "UNKNOWN";
never executed: return "UNKNOWN";
0
2455 }-
2456 }-
2457}-
2458-
2459static const char *-
2460lookup_opcode_name(OpCodes code)-
2461{-
2462 u_int i;-
2463-
2464 for (i = 0; keywords[i].name != NULL; i++)
keywords[i].na...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2465 if (keywords[i].opcode == code)
keywords[i].opcode == codeDescription
TRUEnever evaluated
FALSEnever evaluated
0
2466 return(keywords[i].name);
never executed: return(keywords[i].name);
0
2467 return "UNKNOWN";
never executed: return "UNKNOWN";
0
2468}-
2469-
2470static void-
2471dump_cfg_int(OpCodes code, int val)-
2472{-
2473 printf("%s %d\n", lookup_opcode_name(code), val);-
2474}
never executed: end of block
0
2475-
2476static void-
2477dump_cfg_fmtint(OpCodes code, int val)-
2478{-
2479 printf("%s %s\n", lookup_opcode_name(code), fmt_intarg(code, val));-
2480}
never executed: end of block
0
2481-
2482static void-
2483dump_cfg_string(OpCodes code, const char *val)-
2484{-
2485 if (val == NULL)
val == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2486 return;
never executed: return;
0
2487 printf("%s %s\n", lookup_opcode_name(code), val);-
2488}
never executed: end of block
0
2489-
2490static void-
2491dump_cfg_strarray(OpCodes code, u_int count, char **vals)-
2492{-
2493 u_int i;-
2494-
2495 for (i = 0; i < count; i++)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
2496 printf("%s %s\n", lookup_opcode_name(code), vals[i]);
never executed: printf("%s %s\n", lookup_opcode_name(code), vals[i]);
0
2497}
never executed: end of block
0
2498-
2499static void-
2500dump_cfg_strarray_oneline(OpCodes code, u_int count, char **vals)-
2501{-
2502 u_int i;-
2503-
2504 printf("%s", lookup_opcode_name(code));-
2505 for (i = 0; i < count; i++)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
2506 printf(" %s", vals[i]);
never executed: printf(" %s", vals[i]);
0
2507 printf("\n");-
2508}
never executed: end of block
0
2509-
2510static void-
2511dump_cfg_forwards(OpCodes code, u_int count, const struct Forward *fwds)-
2512{-
2513 const struct Forward *fwd;-
2514 u_int i;-
2515-
2516 /* oDynamicForward */-
2517 for (i = 0; i < count; i++) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
2518 fwd = &fwds[i];-
2519 if (code == oDynamicForward && fwd->connect_host != NULL &&
code == oDynamicForwardDescription
TRUEnever evaluated
FALSEnever evaluated
fwd->connect_h...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2520 strcmp(fwd->connect_host, "socks") != 0)
never executed: __result = (((const unsigned char *) (const char *) ( fwd->connect_host ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "socks" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) != 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2521 continue;
never executed: continue;
0
2522 if (code == oLocalForward && fwd->connect_host != NULL &&
code == oLocalForwardDescription
TRUEnever evaluated
FALSEnever evaluated
fwd->connect_h...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2523 strcmp(fwd->connect_host, "socks") == 0)
never executed: __result = (((const unsigned char *) (const char *) ( fwd->connect_host ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "socks" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2524 continue;
never executed: continue;
0
2525 printf("%s", lookup_opcode_name(code));-
2526 if (fwd->listen_port == PORT_STREAMLOCAL)
fwd->listen_port == -2Description
TRUEnever evaluated
FALSEnever evaluated
0
2527 printf(" %s", fwd->listen_path);
never executed: printf(" %s", fwd->listen_path);
0
2528 else if (fwd->listen_host == NULL)
fwd->listen_ho...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2529 printf(" %d", fwd->listen_port);
never executed: printf(" %d", fwd->listen_port);
0
2530 else {-
2531 printf(" [%s]:%d",-
2532 fwd->listen_host, fwd->listen_port);-
2533 }
never executed: end of block
0
2534 if (code != oDynamicForward) {
code != oDynamicForwardDescription
TRUEnever evaluated
FALSEnever evaluated
0
2535 if (fwd->connect_port == PORT_STREAMLOCAL)
fwd->connect_port == -2Description
TRUEnever evaluated
FALSEnever evaluated
0
2536 printf(" %s", fwd->connect_path);
never executed: printf(" %s", fwd->connect_path);
0
2537 else if (fwd->connect_host == NULL)
fwd->connect_h...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2538 printf(" %d", fwd->connect_port);
never executed: printf(" %d", fwd->connect_port);
0
2539 else {-
2540 printf(" [%s]:%d",-
2541 fwd->connect_host, fwd->connect_port);-
2542 }
never executed: end of block
0
2543 }-
2544 printf("\n");-
2545 }
never executed: end of block
0
2546}
never executed: end of block
0
2547-
2548void-
2549dump_client_config(Options *o, const char *host)-
2550{-
2551 int i;-
2552 char buf[8], *all_key;-
2553-
2554 /* This is normally prepared in ssh_kex2 */-
2555 all_key = sshkey_alg_list(0, 0, 1, ',');-
2556 if (kex_assemble_names( &o->hostkeyalgorithms,
kex_assemble_n... all_key) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2557 KEX_DEFAULT_PK_ALG, all_key) != 0)
kex_assemble_n... all_key) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2558 fatal("%s: kex_assemble_names failed", __func__);
never executed: fatal("%s: kex_assemble_names failed", __func__);
0
2559 free(all_key);-
2560-
2561 /* Most interesting options first: user, host, port */-
2562 dump_cfg_string(oUser, o->user);-
2563 dump_cfg_string(oHostName, host);-
2564 dump_cfg_int(oPort, o->port);-
2565-
2566 /* Flag options */-
2567 dump_cfg_fmtint(oAddKeysToAgent, o->add_keys_to_agent);-
2568 dump_cfg_fmtint(oAddressFamily, o->address_family);-
2569 dump_cfg_fmtint(oBatchMode, o->batch_mode);-
2570 dump_cfg_fmtint(oCanonicalizeFallbackLocal, o->canonicalize_fallback_local);-
2571 dump_cfg_fmtint(oCanonicalizeHostname, o->canonicalize_hostname);-
2572 dump_cfg_fmtint(oChallengeResponseAuthentication, o->challenge_response_authentication);-
2573 dump_cfg_fmtint(oCheckHostIP, o->check_host_ip);-
2574 dump_cfg_fmtint(oCompression, o->compression);-
2575 dump_cfg_fmtint(oControlMaster, o->control_master);-
2576 dump_cfg_fmtint(oEnableSSHKeysign, o->enable_ssh_keysign);-
2577 dump_cfg_fmtint(oClearAllForwardings, o->clear_forwardings);-
2578 dump_cfg_fmtint(oExitOnForwardFailure, o->exit_on_forward_failure);-
2579 dump_cfg_fmtint(oFingerprintHash, o->fingerprint_hash);-
2580 dump_cfg_fmtint(oForwardAgent, o->forward_agent);-
2581 dump_cfg_fmtint(oForwardX11, o->forward_x11);-
2582 dump_cfg_fmtint(oForwardX11Trusted, o->forward_x11_trusted);-
2583 dump_cfg_fmtint(oGatewayPorts, o->fwd_opts.gateway_ports);-
2584#ifdef GSSAPI-
2585 dump_cfg_fmtint(oGssAuthentication, o->gss_authentication);-
2586 dump_cfg_fmtint(oGssDelegateCreds, o->gss_deleg_creds);-
2587#endif /* GSSAPI */-
2588 dump_cfg_fmtint(oHashKnownHosts, o->hash_known_hosts);-
2589 dump_cfg_fmtint(oHostbasedAuthentication, o->hostbased_authentication);-
2590 dump_cfg_fmtint(oIdentitiesOnly, o->identities_only);-
2591 dump_cfg_fmtint(oKbdInteractiveAuthentication, o->kbd_interactive_authentication);-
2592 dump_cfg_fmtint(oNoHostAuthenticationForLocalhost, o->no_host_authentication_for_localhost);-
2593 dump_cfg_fmtint(oPasswordAuthentication, o->password_authentication);-
2594 dump_cfg_fmtint(oPermitLocalCommand, o->permit_local_command);-
2595 dump_cfg_fmtint(oProxyUseFdpass, o->proxy_use_fdpass);-
2596 dump_cfg_fmtint(oPubkeyAuthentication, o->pubkey_authentication);-
2597 dump_cfg_fmtint(oRequestTTY, o->request_tty);-
2598 dump_cfg_fmtint(oStreamLocalBindUnlink, o->fwd_opts.streamlocal_bind_unlink);-
2599 dump_cfg_fmtint(oStrictHostKeyChecking, o->strict_host_key_checking);-
2600 dump_cfg_fmtint(oTCPKeepAlive, o->tcp_keep_alive);-
2601 dump_cfg_fmtint(oTunnel, o->tun_open);-
2602 dump_cfg_fmtint(oVerifyHostKeyDNS, o->verify_host_key_dns);-
2603 dump_cfg_fmtint(oVisualHostKey, o->visual_host_key);-
2604 dump_cfg_fmtint(oUpdateHostkeys, o->update_hostkeys);-
2605-
2606 /* Integer options */-
2607 dump_cfg_int(oCanonicalizeMaxDots, o->canonicalize_max_dots);-
2608 dump_cfg_int(oConnectionAttempts, o->connection_attempts);-
2609 dump_cfg_int(oForwardX11Timeout, o->forward_x11_timeout);-
2610 dump_cfg_int(oNumberOfPasswordPrompts, o->number_of_password_prompts);-
2611 dump_cfg_int(oServerAliveCountMax, o->server_alive_count_max);-
2612 dump_cfg_int(oServerAliveInterval, o->server_alive_interval);-
2613-
2614 /* String options */-
2615 dump_cfg_string(oBindAddress, o->bind_address);-
2616 dump_cfg_string(oBindInterface, o->bind_interface);-
2617 dump_cfg_string(oCiphers, o->ciphers ? o->ciphers : KEX_CLIENT_ENCRYPT);-
2618 dump_cfg_string(oControlPath, o->control_path);-
2619 dump_cfg_string(oHostKeyAlgorithms, o->hostkeyalgorithms);-
2620 dump_cfg_string(oHostKeyAlias, o->host_key_alias);-
2621 dump_cfg_string(oHostbasedKeyTypes, o->hostbased_key_types);-
2622 dump_cfg_string(oIdentityAgent, o->identity_agent);-
2623 dump_cfg_string(oIgnoreUnknown, o->ignored_unknown);-
2624 dump_cfg_string(oKbdInteractiveDevices, o->kbd_interactive_devices);-
2625 dump_cfg_string(oKexAlgorithms, o->kex_algorithms ? o->kex_algorithms : KEX_CLIENT_KEX);-
2626 dump_cfg_string(oCASignatureAlgorithms, o->ca_sign_algorithms ? o->ca_sign_algorithms : SSH_ALLOWED_CA_SIGALGS);-
2627 dump_cfg_string(oLocalCommand, o->local_command);-
2628 dump_cfg_string(oRemoteCommand, o->remote_command);-
2629 dump_cfg_string(oLogLevel, log_level_name(o->log_level));-
2630 dump_cfg_string(oMacs, o->macs ? o->macs : KEX_CLIENT_MAC);-
2631#ifdef ENABLE_PKCS11-
2632 dump_cfg_string(oPKCS11Provider, o->pkcs11_provider);-
2633#endif-
2634 dump_cfg_string(oPreferredAuthentications, o->preferred_authentications);-
2635 dump_cfg_string(oPubkeyAcceptedKeyTypes, o->pubkey_key_types);-
2636 dump_cfg_string(oRevokedHostKeys, o->revoked_host_keys);-
2637 dump_cfg_string(oXAuthLocation, o->xauth_location);-
2638-
2639 /* Forwards */-
2640 dump_cfg_forwards(oDynamicForward, o->num_local_forwards, o->local_forwards);-
2641 dump_cfg_forwards(oLocalForward, o->num_local_forwards, o->local_forwards);-
2642 dump_cfg_forwards(oRemoteForward, o->num_remote_forwards, o->remote_forwards);-
2643-
2644 /* String array options */-
2645 dump_cfg_strarray(oIdentityFile, o->num_identity_files, o->identity_files);-
2646 dump_cfg_strarray_oneline(oCanonicalDomains, o->num_canonical_domains, o->canonical_domains);-
2647 dump_cfg_strarray(oCertificateFile, o->num_certificate_files, o->certificate_files);-
2648 dump_cfg_strarray_oneline(oGlobalKnownHostsFile, o->num_system_hostfiles, o->system_hostfiles);-
2649 dump_cfg_strarray_oneline(oUserKnownHostsFile, o->num_user_hostfiles, o->user_hostfiles);-
2650 dump_cfg_strarray(oSendEnv, o->num_send_env, o->send_env);-
2651 dump_cfg_strarray(oSetEnv, o->num_setenv, o->setenv);-
2652-
2653 /* Special cases */-
2654-
2655 /* oConnectTimeout */-
2656 if (o->connection_timeout == -1)
o->connection_timeout == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2657 printf("connecttimeout none\n");
never executed: printf("connecttimeout none\n");
0
2658 else-
2659 dump_cfg_int(oConnectTimeout, o->connection_timeout);
never executed: dump_cfg_int(oConnectTimeout, o->connection_timeout);
0
2660-
2661 /* oTunnelDevice */-
2662 printf("tunneldevice");-
2663 if (o->tun_local == SSH_TUNID_ANY)
o->tun_local == 0x7fffffffDescription
TRUEnever evaluated
FALSEnever evaluated
0
2664 printf(" any");
never executed: printf(" any");
0
2665 else-
2666 printf(" %d", o->tun_local);
never executed: printf(" %d", o->tun_local);
0
2667 if (o->tun_remote == SSH_TUNID_ANY)
o->tun_remote == 0x7fffffffDescription
TRUEnever evaluated
FALSEnever evaluated
0
2668 printf(":any");
never executed: printf(":any");
0
2669 else-
2670 printf(":%d", o->tun_remote);
never executed: printf(":%d", o->tun_remote);
0
2671 printf("\n");-
2672-
2673 /* oCanonicalizePermittedCNAMEs */-
2674 if ( o->num_permitted_cnames > 0) {
o->num_permitted_cnames > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2675 printf("canonicalizePermittedcnames");-
2676 for (i = 0; i < o->num_permitted_cnames; i++) {
i < o->num_permitted_cnamesDescription
TRUEnever evaluated
FALSEnever evaluated
0
2677 printf(" %s:%s", o->permitted_cnames[i].source_list,-
2678 o->permitted_cnames[i].target_list);-
2679 }
never executed: end of block
0
2680 printf("\n");-
2681 }
never executed: end of block
0
2682-
2683 /* oControlPersist */-
2684 if (o->control_persist == 0 || o->control_persist_timeout == 0)
o->control_persist == 0Description
TRUEnever evaluated
FALSEnever evaluated
o->control_per...t_timeout == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2685 dump_cfg_fmtint(oControlPersist, o->control_persist);
never executed: dump_cfg_fmtint(oControlPersist, o->control_persist);
0
2686 else-
2687 dump_cfg_int(oControlPersist, o->control_persist_timeout);
never executed: dump_cfg_int(oControlPersist, o->control_persist_timeout);
0
2688-
2689 /* oEscapeChar */-
2690 if (o->escape_char == SSH_ESCAPECHAR_NONE)
o->escape_char == -2Description
TRUEnever evaluated
FALSEnever evaluated
0
2691 printf("escapechar none\n");
never executed: printf("escapechar none\n");
0
2692 else {-
2693 vis(buf, o->escape_char, VIS_WHITE, 0);-
2694 printf("escapechar %s\n", buf);-
2695 }
never executed: end of block
0
2696-
2697 /* oIPQoS */-
2698 printf("ipqos %s ", iptos2str(o->ip_qos_interactive));-
2699 printf("%s\n", iptos2str(o->ip_qos_bulk));-
2700-
2701 /* oRekeyLimit */-
2702 printf("rekeylimit %llu %d\n",-
2703 (unsigned long long)o->rekey_limit, o->rekey_interval);-
2704-
2705 /* oStreamLocalBindMask */-
2706 printf("streamlocalbindmask 0%o\n",-
2707 o->fwd_opts.streamlocal_bind_mask);-
2708-
2709 /* oLogFacility */-
2710 printf("syslogfacility %s\n", log_facility_name(o->log_facility));-
2711-
2712 /* oProxyCommand / oProxyJump */-
2713 if (o->jump_host == NULL)
o->jump_host == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
2714 dump_cfg_string(oProxyCommand, o->proxy_command);
never executed: dump_cfg_string(oProxyCommand, o->proxy_command);
0
2715 else {-
2716 /* Check for numeric addresses */-
2717 i = strchr(o->jump_host, ':') != NULL ||
(__extension__...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( ':' )Description
TRUEnever evaluated
FALSEnever evaluated
!__builtin_con...o->jump_host )Description
TRUEnever evaluated
FALSEnever evaluated
( ':' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
2718 strspn(o->jump_host, "1234567890.") == strlen(o->jump_host);
__builtin_strs...(o->jump_host)Description
TRUEnever evaluated
FALSEnever evaluated
0
2719 snprintf(buf, sizeof(buf), "%d", o->jump_port);-
2720 printf("proxyjump %s%s%s%s%s%s%s%s%s\n",-
2721 /* optional additional jump spec */-
2722 o->jump_extra == NULL ? "" : o->jump_extra,-
2723 o->jump_extra == NULL ? "" : ",",-
2724 /* optional user */-
2725 o->jump_user == NULL ? "" : o->jump_user,-
2726 o->jump_user == NULL ? "" : "@",-
2727 /* opening [ if hostname is numeric */-
2728 i ? "[" : "",-
2729 /* mandatory hostname */-
2730 o->jump_host,-
2731 /* closing ] if hostname is numeric */-
2732 i ? "]" : "",-
2733 /* optional port number */-
2734 o->jump_port <= 0 ? "" : ":",-
2735 o->jump_port <= 0 ? "" : buf);-
2736 }
never executed: end of block
0
2737}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2