• R/O
  • HTTP
  • SSH
  • HTTPS

openpts: 提交

Repo for OpenPTS version 0.2.X


Commit MetaInfo

修订版cd6c958ca824ab2f1d07ca3bc6ebebdd749189d9 (tree)
时间2012-01-05 17:49:15
作者Seiji Munetoh <munetoh@jp.i...>
CommiterSeiji Munetoh

Log Message

Hold SSH username and port

更改概述

差异

--- a/src/conf.c
+++ b/src/conf.c
@@ -721,6 +721,7 @@ int readPtsConfig(OPENPTS_CONFIG *conf, char *filename) {
721721 xfree(conf->prop_filename);
722722 }
723723 conf->prop_filename = getFullpathName(conf->config_dir, value);
724+ DEBUG("conf->prop_filename : %s\n", conf->prop_filename);
724725 }
725726 if (!strncmp(name, "ir.quote", 8)) {
726727 if (!strncmp(value, "WITHOUT_QUOTE", 13)) {
@@ -760,8 +761,10 @@ int readPtsConfig(OPENPTS_CONFIG *conf, char *filename) {
760761 if (!strncmp(name, "ima.validation.mode", 19)) {
761762 if (!strncmp(value, "aide", 4)) {
762763 conf->ima_validation_mode = OPENPTS_VALIDATION_MODE_AIDE;
764+ DEBUG("conf->ima_validation_mode : OPENPTS_VALIDATION_MODE_AIDE\n");
763765 } else if (!strncmp(value, "none", 4)) {
764766 conf->ima_validation_mode = OPENPTS_VALIDATION_MODE_NONE;
767+ DEBUG("conf->ima_validation_mode : OPENPTS_VALIDATION_MODE_NONE\n");
765768 } else {
766769 LOG(LOG_ERR, "unknown ima.validation.mode [%s]\n", value);
767770 isFileIncorrect = 1;
@@ -923,9 +926,8 @@ int readPtsConfig(OPENPTS_CONFIG *conf, char *filename) {
923926
924927 /* SSH */
925928 /* 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;
929931 if (!strncmp(name, "ssh.username", 12)) {
930932 conf->ssh_username = smalloc_assert(value);
931933 DEBUG("conf->ssh_username : %s\n", conf->ssh_username);
--- a/src/openpts.c
+++ b/src/openpts.c
@@ -342,6 +342,14 @@ int main(int argc, char *argv[]) {
342342 target_conf_dir = getTargetConfDir(conf); // HOME/.openpts/UUID/
343343 target_conf_filename = smalloc_assert(target_collector->target_conf_filename);
344344 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+
345353 }
346354 }
347355
--- a/src/verifier.c
+++ b/src/verifier.c
@@ -1319,6 +1319,12 @@ int enroll(
13191319
13201320
13211321 /* 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+ }
13221328 writeTargetConf(
13231329 target_conf,
13241330 target_conf->uuid->uuid,
Show on old repository browser