From 2e90f5461f629eafbbbe658290c8584c5bee9ffe Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 1 Mar 2011 21:22:26 +0100 Subject: [PATCH] Add extra Bacula plugin variables --- bacula/src/filed/fd_plugins.c | 17 ++++++++++++++++- bacula/src/filed/fd_plugins.h | 5 ++++- bacula/src/lib/message.c | 2 +- bacula/src/win32/lib/bacula32.def | 3 +++ bacula/src/win32/lib/bacula64.def | 3 +++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index b54adc9810..e02b49e98d 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2010 Free Software Foundation Europe e.V. + Copyright (C) 2007-2011 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -36,6 +36,9 @@ extern CLIENT *me; extern DLL_IMP_EXP char *exepath; +extern DLL_IMP_EXP char *version; +extern DLL_IMP_EXP char *dist_name; +extern DLL_IMP_EXP int beef; const int dbglvl = 150; #ifdef HAVE_WIN32 @@ -1026,6 +1029,15 @@ static bRC baculaGetValue(bpContext *ctx, bVariable var, void *value) case bVarExePath: *(char **)value = exepath; break; + case bVarVersion: + *(char **)value = version; + break; + case bVarDistName: + *(char **)value = dist_name; + break; + case bVarBEEF: + *((int *)value) = beef; + break; default: break; } @@ -1100,6 +1112,9 @@ static bRC baculaGetValue(bpContext *ctx, bVariable var, void *value) case bVarFDName: /* get warning with g++ if we missed one */ case bVarWorkingDir: case bVarExePath: + case bVarVersion: + case bVarDistName: + case bVarBEEF: break; } return bRC_OK; diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index c9db624158..f5c80678dd 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -180,7 +180,10 @@ typedef enum { bVarWorkingDir = 13, bVarWhere = 14, bVarRegexWhere = 15, - bVarExePath = 16 + bVarExePath = 16, + bVarVersion = 17, + bVarDistName = 18, + bVarBEEF = 19 } bVariable; /* Events that are passed to plugin */ diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 3d7fc0e12d..05e0c2aabf 100644 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -57,7 +57,7 @@ bool prt_kaboom = false; /* Print kaboom output */ utime_t daemon_start_time = 0; /* Daemon start time */ const char *version = VERSION " (" BDATE ")"; const char *dist_name = DISTNAME " " DISTVER; -const int beef = BEEF; +int beef = BEEF; char my_name[30] = {0}; /* daemon name is stored here */ char host_name[50] = {0}; /* host machine name */ char *exepath = (char *)NULL; diff --git a/bacula/src/win32/lib/bacula32.def b/bacula/src/win32/lib/bacula32.def index afd5a32379..997b9ec08c 100644 --- a/bacula/src/win32/lib/bacula32.def +++ b/bacula/src/win32/lib/bacula32.def @@ -780,3 +780,6 @@ plugin_bwrite DATA plugin_bread DATA plugin_blseek DATA exepath DATA +beef DATA +version DATA +dist_name DATA diff --git a/bacula/src/win32/lib/bacula64.def b/bacula/src/win32/lib/bacula64.def index 3591f464c8..51f114ce1e 100644 --- a/bacula/src/win32/lib/bacula64.def +++ b/bacula/src/win32/lib/bacula64.def @@ -770,3 +770,6 @@ plugin_bwrite DATA plugin_bread DATA plugin_blseek DATA exepath DATA +beef DATA +version DATA +dist_name DATA -- 2.39.5