Repo for OpenPTS version 0.2.X
修订版 | cd6c958ca824ab2f1d07ca3bc6ebebdd749189d9 (tree) |
---|---|
时间 | 2012-01-05 17:49:15 |
作者 | Seiji Munetoh <munetoh@jp.i...> |
Commiter | Seiji Munetoh |
Hold SSH username and port
@@ -721,6 +721,7 @@ int readPtsConfig(OPENPTS_CONFIG *conf, char *filename) { | ||
721 | 721 | xfree(conf->prop_filename); |
722 | 722 | } |
723 | 723 | conf->prop_filename = getFullpathName(conf->config_dir, value); |
724 | + DEBUG("conf->prop_filename : %s\n", conf->prop_filename); | |
724 | 725 | } |
725 | 726 | if (!strncmp(name, "ir.quote", 8)) { |
726 | 727 | if (!strncmp(value, "WITHOUT_QUOTE", 13)) { |
@@ -760,8 +761,10 @@ int readPtsConfig(OPENPTS_CONFIG *conf, char *filename) { | ||
760 | 761 | if (!strncmp(name, "ima.validation.mode", 19)) { |
761 | 762 | if (!strncmp(value, "aide", 4)) { |
762 | 763 | conf->ima_validation_mode = OPENPTS_VALIDATION_MODE_AIDE; |
764 | + DEBUG("conf->ima_validation_mode : OPENPTS_VALIDATION_MODE_AIDE\n"); | |
763 | 765 | } else if (!strncmp(value, "none", 4)) { |
764 | 766 | conf->ima_validation_mode = OPENPTS_VALIDATION_MODE_NONE; |
767 | + DEBUG("conf->ima_validation_mode : OPENPTS_VALIDATION_MODE_NONE\n"); | |
765 | 768 | } else { |
766 | 769 | LOG(LOG_ERR, "unknown ima.validation.mode [%s]\n", value); |
767 | 770 | isFileIncorrect = 1; |
@@ -923,9 +926,8 @@ int readPtsConfig(OPENPTS_CONFIG *conf, char *filename) { | ||
923 | 926 | |
924 | 927 | /* SSH */ |
925 | 928 | /* default values */ |
926 | - conf->ssh_username = NULL; // use default values | |
927 | - conf->ssh_port = NULL; | |
928 | - | |
929 | + // conf->ssh_username = NULL; // use default values | |
930 | + // conf->ssh_port = NULL; | |
929 | 931 | if (!strncmp(name, "ssh.username", 12)) { |
930 | 932 | conf->ssh_username = smalloc_assert(value); |
931 | 933 | DEBUG("conf->ssh_username : %s\n", conf->ssh_username); |
@@ -342,6 +342,14 @@ int main(int argc, char *argv[]) { | ||
342 | 342 | target_conf_dir = getTargetConfDir(conf); // HOME/.openpts/UUID/ |
343 | 343 | target_conf_filename = smalloc_assert(target_collector->target_conf_filename); |
344 | 344 | target_conf = (OPENPTS_CONFIG*)target_collector->target_conf; |
345 | + /* lookup SSH setting */ | |
346 | + if ((ssh_username == NULL) && (target_conf->ssh_username != NULL)) { | |
347 | + ssh_username = target_conf->ssh_username; | |
348 | + } | |
349 | + if ((ssh_port == NULL) && (target_conf->ssh_port != NULL)) { | |
350 | + ssh_port = target_conf->ssh_port; | |
351 | + } | |
352 | + | |
345 | 353 | } |
346 | 354 | } |
347 | 355 |
@@ -1319,6 +1319,12 @@ int enroll( | ||
1319 | 1319 | |
1320 | 1320 | |
1321 | 1321 | /* save target conf */ |
1322 | + if (ssh_username != NULL) { | |
1323 | + target_conf->ssh_username = smalloc(ssh_username); | |
1324 | + } | |
1325 | + if (ssh_port != NULL) { | |
1326 | + target_conf->ssh_port = smalloc(ssh_port); | |
1327 | + } | |
1322 | 1328 | writeTargetConf( |
1323 | 1329 | target_conf, |
1324 | 1330 | target_conf->uuid->uuid, |