General:
Changes to 1.37.21:
+- Fix compile problems on Win32
+- Start writing Volume reservation list (already exists, but
+ is not really very good).
- Implement attribute caching to put Signature into database
at the same time as the file attributes thus eliminating a
number of database accesses.
int Mmsg(POOL_MEM &msgbuf, const char *fmt,...);
-struct JCR;
+class JCR;
void d_msg(const char *file, int line, int level, const char *fmt,...);
void p_msg(const char *file, int line, int level, const char *fmt,...);
void e_msg(const char *file, int line, int type, int level, const char *fmt,...);
BSOCK *sd, *dir;
time_t last_heartbeat = time(NULL);
time_t now;
- int oflags;
pthread_detach(pthread_self());
/* Get our own local copy */
sd = dup_bsock(jcr->store_bsock);
+#ifndef WIN32
+ int oflags;
if ((oflags = fcntl(sd->fd, F_GETFL, 0)) != -1) {
fcntl(sd->fd, F_SETFL, oflags|O_NONBLOCK);
}
+#endif
dir = dup_bsock(jcr->dir_bsock);
jcr->hb_bsock = sd;
* in the list while traversing it rather than a single lock
* at the beginning of a traversal and one at the end. This
* incurs slightly more overhead, but effectively eliminates
- * the possibilty of race conditions. In addition, with the
+ * the possibilty of race conditions. In addition, with the
* exception of the global locking of the list during the
* re-reading of the config file, no recursion is needed.
*
dlist *last_jobs = NULL;
const int max_last_jobs = 10;
-static dlist *jcrs = NULL; /* JCR chain */
+static dlist *jcrs = NULL; /* JCR chain */
static pthread_mutex_t jcr_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t job_start_mutex = PTHREAD_MUTEX_INITIALIZER;
void init_last_jobs_list()
{
- JCR *jcr;
+ JCR *jcr = NULL;
struct s_last_job *job_entry = NULL;
if (!last_jobs) {
last_jobs = New(dlist(job_entry, &job_entry->link));
{
if (last_jobs) {
while (!last_jobs->empty()) {
- void *je = last_jobs->first();
- last_jobs->remove(je);
- free(je);
+ void *je = last_jobs->first();
+ last_jobs->remove(je);
+ free(je);
}
delete last_jobs;
last_jobs = NULL;
for ( ; num; num--) {
if (read(fd, &job, sizeof(job)) != sizeof(job)) {
Dmsg1(000, "Read job entry. ERR=%s\n", strerror(errno));
- return;
+ return;
}
if (job.JobId > 0) {
- je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
- memcpy((char *)je, (char *)&job, sizeof(job));
- if (!last_jobs) {
- init_last_jobs_list();
- }
- last_jobs->append(je);
- if (last_jobs->size() > max_last_jobs) {
- je = (struct s_last_job *)last_jobs->first();
- last_jobs->remove(je);
- free(je);
- }
+ je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
+ memcpy((char *)je, (char *)&job, sizeof(job));
+ if (!last_jobs) {
+ init_last_jobs_list();
+ }
+ last_jobs->append(je);
+ if (last_jobs->size() > max_last_jobs) {
+ je = (struct s_last_job *)last_jobs->first();
+ last_jobs->remove(je);
+ free(je);
+ }
}
}
}
num = last_jobs->size();
if (write(fd, &num, sizeof(num)) != sizeof(num)) {
Dmsg1(000, "Error writing num_items: ERR=%s\n", strerror(errno));
- return 0;
+ return 0;
}
foreach_dlist(je, last_jobs) {
- if (write(fd, je, sizeof(struct s_last_job)) != sizeof(struct s_last_job)) {
+ if (write(fd, je, sizeof(struct s_last_job)) != sizeof(struct s_last_job)) {
Dmsg1(000, "Error writing job: ERR=%s\n", strerror(errno));
- return 0;
- }
+ return 0;
+ }
}
}
/* Return current address */
/* Setup some dummy values */
bstrncpy(jcr->Job, "*System*", sizeof(jcr->Job));
jcr->JobId = 0;
- jcr->JobType = JT_SYSTEM; /* internal job until defined */
+ jcr->JobType = JT_SYSTEM; /* internal job until defined */
jcr->JobLevel = L_NONE;
jcr->JobStatus = JS_Created;
/*
* Remove a JCR from the chain
* NOTE! The chain must be locked prior to calling
- * this routine.
+ * this routine.
*/
static void remove_jcr(JCR *jcr)
{
last_job.end_time = time(NULL);
/* Keep list of last jobs, but not Console where JobId==0 */
if (last_job.JobId > 0) {
- je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
- memcpy((char *)je, (char *)&last_job, sizeof(last_job));
- if (!last_jobs) {
- init_last_jobs_list();
- }
- last_jobs->append(je);
- if (last_jobs->size() > max_last_jobs) {
- je = (struct s_last_job *)last_jobs->first();
- last_jobs->remove(je);
- free(je);
- }
+ je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
+ memcpy((char *)je, (char *)&last_job, sizeof(last_job));
+ if (!last_jobs) {
+ init_last_jobs_list();
+ }
+ last_jobs->append(je);
+ if (last_jobs->size() > max_last_jobs) {
+ je = (struct s_last_job *)last_jobs->first();
+ last_jobs->remove(je);
+ free(je);
+ }
}
break;
default:
pthread_mutex_destroy(&jcr->mutex);
delete jcr->msg_queue;
- close_msg(jcr); /* close messages for this job */
+ close_msg(jcr); /* close messages for this job */
/* do this after closing messages */
if (jcr->client_name) {
dequeue_messages(jcr);
lock_jcr_chain();
- jcr->dec_use_count(); /* decrement use count */
+ jcr->dec_use_count(); /* decrement use count */
if (jcr->use_count < 0) {
Emsg2(M_ERROR, 0, _("JCR use_count=%d JobId=%d\n"),
- jcr->use_count, jcr->JobId);
+ jcr->use_count, jcr->JobId);
}
Dmsg3(3400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId);
- if (jcr->use_count > 0) { /* if in use */
+ if (jcr->use_count > 0) { /* if in use */
unlock_jcr_chain();
Dmsg2(3400, "free_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
return;
}
- remove_jcr(jcr); /* remove Jcr from chain */
+ remove_jcr(jcr); /* remove Jcr from chain */
unlock_jcr_chain();
- job_end_pop(jcr); /* pop and call hooked routines */
+ job_end_pop(jcr); /* pop and call hooked routines */
Dmsg1(3400, "End job=%d\n", jcr->JobId);
if (jcr->daemon_free_jcr) {
jcr->daemon_free_jcr(jcr); /* call daemon free routine */
}
free_common_jcr(jcr);
- close_msg(NULL); /* flush any daemon messages */
+ close_msg(NULL); /* flush any daemon messages */
Dmsg0(3400, "Exit free_jcr\n");
}
/*
* Given a JobId, find the JCR
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_id(uint32_t JobId)
{
JCR *jcr;
- lock_jcr_chain(); /* lock chain */
+ lock_jcr_chain(); /* lock chain */
foreach_dlist(jcr, jcrs) {
if (jcr->JobId == JobId) {
- jcr->inc_use_count();
+ jcr->inc_use_count();
Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
/*
* Given a SessionId and SessionTime, find the JCR
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_session(uint32_t SessionId, uint32_t SessionTime)
{
lock_jcr_chain();
foreach_dlist(jcr, jcrs) {
if (jcr->VolSessionId == SessionId &&
- jcr->VolSessionTime == SessionTime) {
- jcr->inc_use_count();
+ jcr->VolSessionTime == SessionTime) {
+ jcr->inc_use_count();
Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
* compares on the number of characters in Job
* thus allowing partial matches.
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_partial_name(char *Job)
{
len = strlen(Job);
foreach_dlist(jcr, jcrs) {
if (strncmp(Job, jcr->Job, len) == 0) {
- jcr->inc_use_count();
+ jcr->inc_use_count();
Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
* Given a Job, find the JCR
* requires an exact match of names.
* Returns: jcr on success
- * NULL on failure
+ * NULL on failure
*/
JCR *get_jcr_by_full_name(char *Job)
{
lock_jcr_chain();
foreach_dlist(jcr, jcrs) {
if (strcmp(jcr->Job, Job) == 0) {
- jcr->inc_use_count();
+ jcr->inc_use_count();
Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
- break;
+ break;
}
}
unlock_jcr_chain();
watchdog_t *wd = new_watchdog();
wd->one_shot = false;
- wd->interval = 30; /* FIXME: should be configurable somewhere, even
- if only with a #define */
+ wd->interval = 30; /* FIXME: should be configurable somewhere, even
+ if only with a #define */
wd->callback = jcr_timeout_check;
register_watchdog(wd);
*/
foreach_jcr(jcr) {
if (jcr->JobId == 0) {
- free_jcr(jcr);
- continue;
+ free_jcr(jcr);
+ continue;
}
fd = jcr->store_bsock;
if (fd) {
- timer_start = fd->timer_start;
- if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
- fd->timer_start = 0; /* turn off timer */
- fd->timed_out = TRUE;
- Jmsg(jcr, M_ERROR, 0, _(
+ timer_start = fd->timer_start;
+ if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
+ fd->timer_start = 0; /* turn off timer */
+ fd->timed_out = TRUE;
+ Jmsg(jcr, M_ERROR, 0, _(
"Watchdog sending kill after %d secs to thread stalled reading Storage daemon.\n"),
- watchdog_time - timer_start);
- pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
- }
+ watchdog_time - timer_start);
+ pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
+ }
}
fd = jcr->file_bsock;
if (fd) {
- timer_start = fd->timer_start;
- if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
- fd->timer_start = 0; /* turn off timer */
- fd->timed_out = TRUE;
- Jmsg(jcr, M_ERROR, 0, _(
+ timer_start = fd->timer_start;
+ if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
+ fd->timer_start = 0; /* turn off timer */
+ fd->timed_out = TRUE;
+ Jmsg(jcr, M_ERROR, 0, _(
"Watchdog sending kill after %d secs to thread stalled reading File daemon.\n"),
- watchdog_time - timer_start);
- pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
- }
+ watchdog_time - timer_start);
+ pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
+ }
}
fd = jcr->dir_bsock;
if (fd) {
- timer_start = fd->timer_start;
- if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
- fd->timer_start = 0; /* turn off timer */
- fd->timed_out = TRUE;
- Jmsg(jcr, M_ERROR, 0, _(
+ timer_start = fd->timer_start;
+ if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
+ fd->timer_start = 0; /* turn off timer */
+ fd->timed_out = TRUE;
+ Jmsg(jcr, M_ERROR, 0, _(
"Watchdog sending kill after %d secs to thread stalled reading Director.\n"),
- watchdog_time - timer_start);
- pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
- }
+ watchdog_time - timer_start);
+ pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
+ }
}
free_jcr(jcr);
}
*/
extern "C" void timeout_handler(int sig)
{
- return; /* thus interrupting the function */
+ return; /* thus interrupting the function */
}
*/
-struct JCR;
+class JCR;
/* attr.c */
ATTR *new_attr();
int init_tls (void);
int cleanup_tls (void);
-#ifdef HAVE_TLS
TLS_CONTEXT *new_tls_context (const char *ca_certfile,
const char *ca_certdir,
const char *certfile,
const char *dhfile,
bool verify_peer);
void free_tls_context (TLS_CONTEXT *ctx);
+#ifdef HAVE_TLS
bool tls_postconnect_verify_host (TLS_CONNECTION *tls,
const char *host);
bool tls_postconnect_verify_cn (TLS_CONNECTION *tls,
/* Dummy routines */
int init_tls(void) { return 0; }
int cleanup_tls (void) { return 0; }
-
+TLS_CONTEXT *new_tls_context(const char *ca_certfile, const char *ca_certdir,
+ const char *certfile, const char *keyfile,
+ TLS_PEM_PASSWD_CB *pem_callback,
+ const void *pem_userdata, const char *dhfile,
+ bool verify_peer)
+{
+ return NULL;
+}
+void free_tls_context(TLS_CONTEXT *ctx) { }
#endif /* HAVE_TLS */
// init with win9x, but maybe set to NT in InitWinAPI
DWORD g_platform_id = VER_PLATFORM_WIN32_WINDOWS;
+#ifdef WIN32_VSS
/* preset VSSClient to NULL */
VSSClient* g_pVSSClient = NULL;
+#endif
/* API Pointers */
-t_OpenProcessToken p_OpenProcessToken = NULL;
+t_OpenProcessToken p_OpenProcessToken = NULL;
t_AdjustTokenPrivileges p_AdjustTokenPrivileges = NULL;
-t_LookupPrivilegeValue p_LookupPrivilegeValue = NULL;
+t_LookupPrivilegeValue p_LookupPrivilegeValue = NULL;
t_SetProcessShutdownParameters p_SetProcessShutdownParameters = NULL;
-t_CreateFileA p_CreateFileA = NULL;
-t_CreateFileW p_CreateFileW = NULL;
+t_CreateFileA p_CreateFileA = NULL;
+t_CreateFileW p_CreateFileW = NULL;
t_wunlink p_wunlink = NULL;
t_wmkdir p_wmkdir = NULL;
t_wopen p_wopen = NULL;
-t_GetFileAttributesA p_GetFileAttributesA = NULL;
-t_GetFileAttributesW p_GetFileAttributesW = NULL;
+t_GetFileAttributesA p_GetFileAttributesA = NULL;
+t_GetFileAttributesW p_GetFileAttributesW = NULL;
-t_GetFileAttributesExA p_GetFileAttributesExA = NULL;
-t_GetFileAttributesExW p_GetFileAttributesExW = NULL;
+t_GetFileAttributesExA p_GetFileAttributesExA = NULL;
+t_GetFileAttributesExW p_GetFileAttributesExW = NULL;
-t_SetFileAttributesA p_SetFileAttributesA = NULL;
-t_SetFileAttributesW p_SetFileAttributesW = NULL;
-t_BackupRead p_BackupRead = NULL;
-t_BackupWrite p_BackupWrite = NULL;
+t_SetFileAttributesA p_SetFileAttributesA = NULL;
+t_SetFileAttributesW p_SetFileAttributesW = NULL;
+t_BackupRead p_BackupRead = NULL;
+t_BackupWrite p_BackupWrite = NULL;
t_WideCharToMultiByte p_WideCharToMultiByte = NULL;
t_MultiByteToWideChar p_MultiByteToWideChar = NULL;
/* wopen */
p_wopen = (t_wopen)
GetProcAddress(hLib, "_wopen");
-
+
FreeLibrary(hLib);
}
p_BackupRead = NULL;
p_BackupWrite = NULL;
- p_CreateFileW = NULL;
- p_GetFileAttributesW = NULL;
+ p_CreateFileW = NULL;
+ p_GetFileAttributesW = NULL;
p_GetFileAttributesExW = NULL;
-
+
p_SetFileAttributesW = NULL;
-
+
p_FindFirstFileW = NULL;
p_FindNextFileW = NULL;
p_SetCurrentDirectoryW = NULL;
#ifdef WIN32_VSS
switch (dwMinorVersion) {
case 1:
- g_pVSSClient = new VSSClientXP();
- atexit(VSSCleanup);
- break;
+ g_pVSSClient = new VSSClientXP();
+ atexit(VSSCleanup);
+ break;
case 2:
- g_pVSSClient = new VSSClient2003();
- atexit(VSSCleanup);
- break;
+ g_pVSSClient = new VSSClient2003();
+ atexit(VSSCleanup);
+ break;
}
#endif
}
Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
+ modify it under the terms of the GNU General Public License
+ version 2 as ammended with additional clauses defined in the
+ file LICENSE in the main source directory.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ the file LICENSE for additional details.
*/
return do_get_volume_info(dcr);
}
+/*
+ * Rewrite this to use a list, but need something to add
+ * and remove volumes from the list.
+ */
+static bool is_volume_in_use(JCR *jcr, const char *VolumeName) {
+ bool in_use = false;
+ JCR *njcr;
+ Dmsg2(300, "JobId=%d got possible Vol=%s\n", jcr->JobId, VolumeName);
+ /*
+ * Walk through all jobs and see if the volume is
+ * already mounted. If so, try a different one.
+ * This would be better done by walking through
+ * all the devices.
+ */
+ foreach_jcr(njcr) {
+ if (jcr == njcr) {
+ free_jcr(njcr);
+ continue; /* us */
+ }
+ Dmsg2(300, "Compare to JobId=%d using Vol=%s\n", njcr->JobId, njcr->dcr->VolumeName);
+ if (njcr->dcr && strcmp(VolumeName, njcr->dcr->VolumeName) == 0) {
+ in_use = true;
+ Dmsg1(400, "Vol in use by JobId=%u\n", njcr->JobId);
+ free_jcr(njcr);
+ break;
+ }
+ free_jcr(njcr);
+ }
+ return in_use;
+ }
+
/*
{
JCR *jcr = dcr->jcr;
BSOCK *dir = jcr->dir_bsock;
- JCR *njcr;
Dmsg0(200, "dir_find_next_appendable_volume\n");
/*
- * Try the three oldest or most available volumes. Note,
+ * Try the twenty oldest or most available volumes. Note,
* the most available could already be mounted on another
* drive, so we continue looking for a not in use Volume.
*/
- for (int vol_index=1; vol_index < 3; vol_index++) {
+ for (int vol_index=1; vol_index < 20; vol_index++) {
bash_spaces(dcr->media_type);
bash_spaces(dcr->pool_name);
bnet_fsend(dir, Find_media, jcr->Job, vol_index, dcr->pool_name, dcr->media_type);
unbash_spaces(dcr->pool_name);
Dmsg1(100, ">dird: %s", dir->msg);
if (do_get_volume_info(dcr)) {
- Dmsg2(300, "JobId=%d got possible Vol=%s\n", jcr->JobId, dcr->VolumeName);
- bool found = false;
- /*
- * Walk through all jobs and see if the volume is
- * already mounted. If so, try a different one.
- * This would be better done by walking through
- * all the devices.
- */
- foreach_jcr(njcr) {
- if (jcr == njcr) {
- free_jcr(njcr);
- continue; /* us */
- }
- Dmsg2(300, "Compare to JobId=%d using Vol=%s\n", njcr->JobId, njcr->dcr->VolumeName);
- if (njcr->dcr && strcmp(dcr->VolumeName, njcr->dcr->VolumeName) == 0) {
- found = true;
- Dmsg1(400, "Vol in use by JobId=%u\n", njcr->JobId);
- free_jcr(njcr);
- break;
- }
- free_jcr(njcr);
- }
- if (!found) {
- Dmsg0(400, "dir_find_next_appendable_volume return true\n");
- return true; /* Got good Volume */
+ if (is_volume_in_use(jcr, dcr->VolumeName)) {
+ continue;
+ } else {
+ break;
}
} else {
Dmsg0(200, "No volume info, return false\n");
OK = false;
}
-#ifdef HAVE_TLS
DIRRES *director;
STORES *store;
foreach_res(store, R_STORAGE) {
/* tls_require implies tls_enable */
if (store->tls_require) {
+#ifndef HAVE_TLS
+ Jmsg(NULL, M_FATAL, 0, _("TLS required but not configured in Bacula.\n"));
+ OK = false;
+ continue;
+#else
store->tls_enable = true;
+#endif
}
if (!store->tls_certfile && store->tls_enable) {
}
}
}
-#endif /* HAVE_TLS */
/* Ensure that the media_type for each device is the same */
foreach_res(changer, R_AUTOCHANGER) {
{"scriptsdirectory", store_dir, ITEM(res_store.scripts_directory), 0, 0, 0},
{"maximumconcurrentjobs", store_pint, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 10},
{"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 0},
-#ifdef HAVE_TLS
{"tlsenable", store_yesno, ITEM(res_store.tls_enable), 1, ITEM_DEFAULT, 0},
{"tlsrequire", store_yesno, ITEM(res_store.tls_require), 1, ITEM_DEFAULT, 0},
{"tlsverifypeer", store_yesno, ITEM(res_store.tls_verify_peer), 1, ITEM_DEFAULT, 0},
{"tlskey", store_dir, ITEM(res_store.tls_keyfile), 0, 0, 0},
{"tlsdhfile", store_dir, ITEM(res_store.tls_dhfile), 0, 0, 0},
{"tlsallowedcn", store_alist_str, ITEM(res_store.tls_allowed_cns), 0, 0, 0},
-#endif /* HAVE_TLS */
{NULL, NULL, 0, 0, 0, 0}
};
{"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0},
{"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0},
{"monitor", store_yesno, ITEM(res_dir.monitor), 1, ITEM_DEFAULT, 0},
-#ifdef HAVE_TLS
{"tlsenable", store_yesno, ITEM(res_dir.tls_enable), 1, ITEM_DEFAULT, 0},
{"tlsrequire", store_yesno, ITEM(res_dir.tls_require), 1, ITEM_DEFAULT, 0},
{"tlsverifypeer", store_yesno, ITEM(res_dir.tls_verify_peer), 1, ITEM_DEFAULT, 0},
{"tlskey", store_dir, ITEM(res_dir.tls_keyfile), 0, 0, 0},
{"tlsdhfile", store_dir, ITEM(res_dir.tls_dhfile), 0, 0, 0},
{"tlsallowedcn", store_alist_str, ITEM(res_dir.tls_allowed_cns), 0, 0, 0},
-#endif /* HAVE_TLS */
{NULL, NULL, 0, 0, 0, 0}
};
if (res->res_dir.address) {
free(res->res_dir.address);
}
-#ifdef HAVE_TLS
if (res->res_dir.tls_ctx) {
free_tls_context(res->res_dir.tls_ctx);
}
if (res->res_dir.tls_allowed_cns) {
delete res->res_dir.tls_allowed_cns;
}
-#endif /* HAVE_TLS */
break;
case R_AUTOCHANGER:
if (res->res_changer.changer_name) {
if (res->res_store.scripts_directory) {
free(res->res_store.scripts_directory);
}
-#ifdef HAVE_TLS
if (res->res_store.tls_ctx) {
free_tls_context(res->res_store.tls_ctx);
}
if (res->res_store.tls_allowed_cns) {
delete res->res_store.tls_allowed_cns;
}
-#endif /* HAVE_TLS */
break;
case R_DEVICE:
if (res->res_dev.media_type) {
if ((res = (URES *)GetResWithName(R_DIRECTOR, res_all.res_dir.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, "Cannot find Director resource \"%s\"\n", res_all.res_dir.hdr.name);
}
-#ifdef HAVE_TLS
res->res_dir.tls_allowed_cns = res_all.res_dir.tls_allowed_cns;
-#endif
break;
case R_STORAGE:
if ((res = (URES *)GetResWithName(R_STORAGE, res_all.res_dir.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, "Cannot find Storage resource \"%s\"\n", res_all.res_dir.hdr.name);
}
res->res_store.messages = res_all.res_store.messages;
-#ifdef HAVE_TLS
res->res_store.tls_allowed_cns = res_all.res_store.tls_allowed_cns;
-#endif
break;
case R_AUTOCHANGER:
if ((res = (URES *)GetResWithName(type, res_all.res_changer.hdr.name)) == NULL) {
char *password; /* Director password */
char *address; /* Director IP address or zero */
int monitor; /* Have only access to status and .status functions */
-#ifdef HAVE_TLS
int tls_enable; /* Enable TLS */
int tls_require; /* Require TLS */
int tls_verify_peer; /* TLS Verify Client Certificate */
alist *tls_allowed_cns; /* TLS Allowed Clients */
TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
-#endif /* HAVE_TLS */
};
uint32_t max_concurrent_jobs; /* maximum concurrent jobs to run */
MSGS *messages; /* Daemon message handler */
utime_t heartbeat_interval; /* Interval to send hb to FD */
-#ifdef HAVE_TLS
int tls_enable; /* Enable TLS */
int tls_require; /* Require TLS */
int tls_verify_peer; /* TLS Verify Client Certificate */
alist *tls_allowed_cns; /* TLS Allowed Clients */
TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
-#endif /* HAVE_TLS */
};
typedef struct s_res_store STORES;