From 88a2d3e5ecd6f390d1ac1ddd96ce4d39b51fe5aa 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 +- 3 files changed, 21 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; -- 2.39.5