|
Lines 249-254
static struct {
Link Here
|
| 249 |
{ NULL, oBadOption } |
249 |
{ NULL, oBadOption } |
| 250 |
}; |
250 |
}; |
| 251 |
|
251 |
|
|
|
252 |
/* optional path to be used instead of user's HOME directory |
| 253 |
* to search for the per-user configuration directory .ssh |
| 254 |
*/ |
| 255 |
char *path_instead_pwdir = NULL; |
| 256 |
|
| 252 |
/* |
257 |
/* |
| 253 |
* Adds a local TCP/IP port forward to options. Never returns if there is an |
258 |
* Adds a local TCP/IP port forward to options. Never returns if there is an |
| 254 |
* error. |
259 |
* error. |
|
Lines 1232-1263
fill_default_options(Options * options)
Link Here
|
| 1232 |
/* options->hostkeyalgorithms, default set in myproposals.h */ |
1237 |
/* options->hostkeyalgorithms, default set in myproposals.h */ |
| 1233 |
if (options->protocol == SSH_PROTO_UNKNOWN) |
1238 |
if (options->protocol == SSH_PROTO_UNKNOWN) |
| 1234 |
options->protocol = SSH_PROTO_2; |
1239 |
options->protocol = SSH_PROTO_2; |
|
|
1240 |
char *home = path_instead_pwdir; |
| 1241 |
if (NULL == home) home = "~"; |
| 1235 |
if (options->num_identity_files == 0) { |
1242 |
if (options->num_identity_files == 0) { |
| 1236 |
if (options->protocol & SSH_PROTO_1) { |
1243 |
if (options->protocol & SSH_PROTO_1) { |
| 1237 |
len = 2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1; |
1244 |
len = strlen(home) + 1 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1; |
| 1238 |
options->identity_files[options->num_identity_files] = |
1245 |
options->identity_files[options->num_identity_files] = |
| 1239 |
xmalloc(len); |
1246 |
xmalloc(len); |
| 1240 |
snprintf(options->identity_files[options->num_identity_files++], |
1247 |
snprintf(options->identity_files[options->num_identity_files++], |
| 1241 |
len, "~/%.100s", _PATH_SSH_CLIENT_IDENTITY); |
1248 |
len, "%s/%.100s", home , _PATH_SSH_CLIENT_IDENTITY); |
| 1242 |
} |
1249 |
} |
| 1243 |
if (options->protocol & SSH_PROTO_2) { |
1250 |
if (options->protocol & SSH_PROTO_2) { |
| 1244 |
len = 2 + strlen(_PATH_SSH_CLIENT_ID_RSA) + 1; |
1251 |
len = strlen(home) + 1 + strlen(_PATH_SSH_CLIENT_ID_RSA) + 1; |
| 1245 |
options->identity_files[options->num_identity_files] = |
1252 |
options->identity_files[options->num_identity_files] = |
| 1246 |
xmalloc(len); |
1253 |
xmalloc(len); |
| 1247 |
snprintf(options->identity_files[options->num_identity_files++], |
1254 |
snprintf(options->identity_files[options->num_identity_files++], |
| 1248 |
len, "~/%.100s", _PATH_SSH_CLIENT_ID_RSA); |
1255 |
len, "%s/%.100s", home , _PATH_SSH_CLIENT_ID_RSA); |
| 1249 |
|
1256 |
|
| 1250 |
len = 2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1; |
1257 |
len = strlen(home) + 1 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1; |
| 1251 |
options->identity_files[options->num_identity_files] = |
1258 |
options->identity_files[options->num_identity_files] = |
| 1252 |
xmalloc(len); |
1259 |
xmalloc(len); |
| 1253 |
snprintf(options->identity_files[options->num_identity_files++], |
1260 |
snprintf(options->identity_files[options->num_identity_files++], |
| 1254 |
len, "~/%.100s", _PATH_SSH_CLIENT_ID_DSA); |
1261 |
len, "%s/%.100s", home , _PATH_SSH_CLIENT_ID_DSA); |
| 1255 |
#ifdef OPENSSL_HAS_ECC |
1262 |
#ifdef OPENSSL_HAS_ECC |
| 1256 |
len = 2 + strlen(_PATH_SSH_CLIENT_ID_ECDSA) + 1; |
1263 |
len = strlen(home) + 1 + strlen(_PATH_SSH_CLIENT_ID_ECDSA) + 1; |
| 1257 |
options->identity_files[options->num_identity_files] = |
1264 |
options->identity_files[options->num_identity_files] = |
| 1258 |
xmalloc(len); |
1265 |
xmalloc(len); |
| 1259 |
snprintf(options->identity_files[options->num_identity_files++], |
1266 |
snprintf(options->identity_files[options->num_identity_files++], |
| 1260 |
len, "~/%.100s", _PATH_SSH_CLIENT_ID_ECDSA); |
1267 |
len, "%s/%.100s", home , _PATH_SSH_CLIENT_ID_ECDSA); |
| 1261 |
#endif |
1268 |
#endif |
| 1262 |
} |
1269 |
} |
| 1263 |
} |
1270 |
} |
|
Lines 1265-1276
fill_default_options(Options * options)
Link Here
|
| 1265 |
options->escape_char = '~'; |
1272 |
options->escape_char = '~'; |
| 1266 |
if (options->system_hostfile == NULL) |
1273 |
if (options->system_hostfile == NULL) |
| 1267 |
options->system_hostfile = _PATH_SSH_SYSTEM_HOSTFILE; |
1274 |
options->system_hostfile = _PATH_SSH_SYSTEM_HOSTFILE; |
| 1268 |
if (options->user_hostfile == NULL) |
1275 |
if (options->user_hostfile == NULL) { |
| 1269 |
options->user_hostfile = _PATH_SSH_USER_HOSTFILE; |
1276 |
len = strlen(home) + 1 + strlen(_PA_SSH_USER_HOSTFILE) + 1; |
|
|
1277 |
options->user_hostfile = xmalloc(len); |
| 1278 |
snprintf(options->user_hostfile, |
| 1279 |
len, "%s/%.100s", home , _PA_SSH_USER_HOSTFILE); |
| 1280 |
} |
| 1270 |
if (options->system_hostfile2 == NULL) |
1281 |
if (options->system_hostfile2 == NULL) |
| 1271 |
options->system_hostfile2 = _PATH_SSH_SYSTEM_HOSTFILE2; |
1282 |
options->system_hostfile2 = _PATH_SSH_SYSTEM_HOSTFILE2; |
| 1272 |
if (options->user_hostfile2 == NULL) |
1283 |
if (options->user_hostfile2 == NULL) { |
| 1273 |
options->user_hostfile2 = _PATH_SSH_USER_HOSTFILE2; |
1284 |
len = strlen(home) + 1 + strlen(_PA_SSH_USER_HOSTFILE2) + 1; |
|
|
1285 |
options->user_hostfile2 = xmalloc(len); |
| 1286 |
snprintf(options->user_hostfile2, |
| 1287 |
len, "%s/%.100s", home , _PA_SSH_USER_HOSTFILE2); |
| 1288 |
} |
| 1274 |
if (options->log_level == SYSLOG_LEVEL_NOT_SET) |
1289 |
if (options->log_level == SYSLOG_LEVEL_NOT_SET) |
| 1275 |
options->log_level = SYSLOG_LEVEL_INFO; |
1290 |
options->log_level = SYSLOG_LEVEL_INFO; |
| 1276 |
if (options->clear_forwardings == 1) |
1291 |
if (options->clear_forwardings == 1) |