From f407ff6c03b1b372f203dd6f751b4c050affdd70 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 8 Oct 2008 19:41:24 +0000 Subject: [PATCH] ebl Add a new custom Id variable that is printed in version command. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7737 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/dird_conf.c | 4 ++++ bacula/src/dird/dird_conf.h | 2 +- bacula/src/dird/ua_cmds.c | 4 ++-- bacula/src/filed/filed_conf.c | 4 ++++ bacula/src/filed/filed_conf.h | 1 + bacula/src/stored/stored_conf.c | 4 ++++ bacula/src/stored/stored_conf.h | 2 +- bacula/technotes-2.5 | 1 + 8 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 7b24659153..31c04092f6 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -134,6 +134,7 @@ static RES_ITEM dir_items[] = { {"tlsdhfile", store_dir, ITEM(res_dir.tls_dhfile), 0, 0, 0}, {"tlsallowedcn", store_alist_str, ITEM(res_dir.tls_allowed_cns), 0, 0, 0}, {"statisticsretention", store_time, ITEM(res_dir.stats_retention), 0, ITEM_DEFAULT, 60*60*24*31*12*5}, + {"verid", store_str, ITEM(res_dir.verid), 0, 0, 0}, {NULL, NULL, {0}, 0, 0, 0} }; @@ -1094,6 +1095,9 @@ void free_resource(RES *sres, int type) if (res->res_dir.tls_allowed_cns) { delete res->res_dir.tls_allowed_cns; } + if (res->res_dir.verid) { + free(res->res_dir.verid); + } break; case R_DEVICE: case R_COUNTER: diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index a44cc64523..c4279f3d6b 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -130,7 +130,7 @@ public: bool tls_enable; /* Enable TLS */ bool tls_require; /* Require TLS */ bool tls_verify_peer; /* TLS Verify Client Certificate */ - + char *verid; /* Custom Id to print in version command */ /* Methods */ char *name() const; }; diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 945a45973a..d02e2f5b6c 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1774,8 +1774,8 @@ int qhelp_cmd(UAContext *ua, const char *cmd) #if 1 static int version_cmd(UAContext *ua, const char *cmd) { - ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE, - HOST_OS, DISTNAME, DISTVER); + ua->send_msg(_("%s Version: %s (%s) %s %s %s %s\n"), my_name, VERSION, BDATE, + NPRTB(director->verid), HOST_OS, DISTNAME, DISTVER); return 1; } #else diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index 42f2b907a1..7a07998759 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -116,6 +116,7 @@ static RES_ITEM cli_items[] = { {"tlscacertificatedir", store_dir, ITEM(res_client.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, 0}, {"tlskey", store_dir, ITEM(res_client.tls_keyfile), 0, 0, 0}, + {"verid", store_str, ITEM(res_client.verid), 0, 0, 0}, {NULL, NULL, {0}, 0, 0, 0} }; @@ -312,6 +313,9 @@ void free_resource(RES *sres, int type) if (res->res_client.tls_keyfile) { free(res->res_client.tls_keyfile); } + if (res->res_client.verid) { + free(res->res_client.verid); + } break; case R_MSGS: if (res->res_msgs.mail_cmd) diff --git a/bacula/src/filed/filed_conf.h b/bacula/src/filed/filed_conf.h index 573efd48cd..3624950b0e 100644 --- a/bacula/src/filed/filed_conf.h +++ b/bacula/src/filed/filed_conf.h @@ -103,6 +103,7 @@ struct CLIENT { alist *pki_signers; /* Shared PKI Trusted Signers */ alist *pki_recipients; /* Shared PKI Recipients */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ + char *verid; /* Custom Id to print in version command */ }; diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 33bf8b0f5e..5e1d84abfa 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -89,6 +89,7 @@ static RES_ITEM store_items[] = { {"tlsdhfile", store_dir, ITEM(res_store.tls_dhfile), 0, 0, 0}, {"tlsallowedcn", store_alist_str, ITEM(res_store.tls_allowed_cns), 0, 0, 0}, {"clientconnectwait", store_time, ITEM(res_store.client_wait), 0, ITEM_DEFAULT, 30 * 60}, + {"verid", store_str, ITEM(res_store.verid), 0, 0, 0}, {NULL, NULL, {0}, 0, 0, 0} }; @@ -483,6 +484,9 @@ void free_resource(RES *sres, int type) if (res->res_store.tls_allowed_cns) { delete res->res_store.tls_allowed_cns; } + if (res->res_store.verid) { + free(res->res_store.verid); + } break; case R_DEVICE: if (res->res_dev.media_type) { diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index 7c3555bca3..2f4f5d9134 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -99,7 +99,7 @@ public: char *tls_keyfile; /* TLS Server Key File */ char *tls_dhfile; /* TLS Diffie-Hellman Parameters */ alist *tls_allowed_cns; /* TLS Allowed Clients */ - + char *verid; /* Custom Id to print in version command */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ }; typedef class s_res_store STORES; diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 342e1df5e9..5a1d7701cd 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -18,6 +18,7 @@ remove reader/writer in FOPTS???? General: 08Oct08 +ebl Add a new VerId variable that is printed in version command. kes Fix migration SQL not to migrate a job that has not terminated. This is a partial fix to bug #1164. kes Sort JobIds returned from db_accurate_get_jobids() to fix Virtual -- 2.39.5