Skip to content

Commit

Permalink
Merge tag 'Release/17.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens committed Mar 16, 2018
2 parents ae715e4 + 0e3298c commit ea81cbc
Show file tree
Hide file tree
Showing 16 changed files with 505 additions and 99 deletions.
1 change: 1 addition & 0 deletions platforms/packaging/bareos.spec
Expand Up @@ -90,6 +90,7 @@ Vendor: The Bareos Team
# therefore build it only for SLE_12 and SLE_12_SP1
%if 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120100
%define ceph 1
%define objectstorage 1
%endif

#
Expand Down
36 changes: 32 additions & 4 deletions platforms/univention/univention-bareos.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
#
# Univention SSL
"""Bareos Client Configuration Listener Module."""
#


__package__ = '' # workaround for PEP 366
from listener import configRegistry, setuid, unsetuid
Expand Down Expand Up @@ -80,6 +79,7 @@ def postrun():
return



def processClient(client_name,entry,delete=False):
if client_name==None:
return
Expand All @@ -99,6 +99,8 @@ def processClient(client_name,entry,delete=False):

addClient(client_name,client_type)



def addClient(client_name,client_type):
createClientJob(client_name,client_type)
addClientInclude(client_name)
Expand All @@ -110,8 +112,21 @@ def removeClient(client_name,client_type):
disableClientJob(client_name,client_type)
addClientInclude(client_name)



def getClientSecret(client_name):
return createClientSecret(client_name)
path=getClientSecretPath(client_name)
password=None

try:
f=open(path,'r')
password=f.read().strip()
except:
password=createClientSecret(client_name)

return password



def exportBareosFdDirectorResource(client_name, client_type):
# send commands via pipe to bconsole
Expand All @@ -120,11 +135,22 @@ def exportBareosFdDirectorResource(client_name, client_type):
out = process.communicate(b'reload\nconfigure export client="{client_name}-fd"\n'.format(client_name=client_name))[0]
ud.debug(ud.LISTENER, ud.INFO, "bareos export output:\n" + str(out))



def createClientSecret(client_name):
path=getClientSecretPath(client_name)

char_set = string.ascii_uppercase + string.digits + string.ascii_lowercase
password=''.join(random.sample(char_set*40,40))
os.umask(077)
with open(path,'w') as f:
f.write(password)
os.chown(path,-1,0)

return password



def removeClientJob(client_name):
path=JOBS_PATH+'/'+client_name+'.include'
os.remove(path)
Expand All @@ -149,6 +175,9 @@ def disableClientJob(client_name,client_type):
def getClientIncludePath(client_name):
return '@'+JOBS_PATH+'/'+client_name+'.include'

def getClientSecretPath(client_name):
return JOBS_PATH+'/'+client_name+'.secret'

def addClientInclude(client_name):
# is the client already in the include list?
if isClientIncluded(client_name):
Expand All @@ -170,4 +199,3 @@ def isClientIncluded(client_name):
if want in l:
return True
return False

1 change: 1 addition & 0 deletions src/cats/sql_create.cc
Expand Up @@ -829,6 +829,7 @@ bool B_DB::write_batch_file_records(JCR *jcr)
Dmsg1(50,"db_create_file_record changes=%u\n", changes);

jcr->JobStatus = JS_AttrInserting;

Jmsg(jcr, M_INFO, 0, "Insert of attributes batch table with %u entries start\n", jcr->db_batch->changes);

if (!jcr->db_batch->sql_batch_end(jcr, NULL)) {
Expand Down
8 changes: 4 additions & 4 deletions src/dird/dird_conf.cc
Expand Up @@ -232,7 +232,7 @@ static RES_ITEM cli_items[] = {
{ "FdPassword", CFG_TYPE_AUTOPASSWORD, ITEM(res_client.password), 0, CFG_ITEM_ALIAS, NULL, NULL, NULL },
{ "Catalog", CFG_TYPE_RES, ITEM(res_client.catalog), R_CATALOG, 0, NULL, NULL, NULL },
{ "Passive", CFG_TYPE_BOOL, ITEM(res_client.passive), 0, CFG_ITEM_DEFAULT, "false", "13.2.0-",
"If enabled, the Storage Daemon will initiate the network connection to the Client. If disabled, the Client will initiate the netowrk connection to the Storage Daemon." },
"If enabled, the Storage Daemon will initiate the network connection to the Client. If disabled, the Client will initiate the network connection to the Storage Daemon." },
{ "ConnectionFromDirectorToClient", CFG_TYPE_BOOL, ITEM(res_client.conn_from_dir_to_fd), 0, CFG_ITEM_DEFAULT, "true", "16.2.2",
"Let the Director initiate the network connection to the Client." },
{ "AllowClientConnect", CFG_TYPE_BOOL, ITEM(res_client.conn_from_fd_to_dir), 0, CFG_ITEM_DEPRECATED | CFG_ITEM_ALIAS, NULL, NULL,
Expand All @@ -253,7 +253,7 @@ static RES_ITEM cli_items[] = {
{ "MaximumConcurrentJobs", CFG_TYPE_PINT32, ITEM(res_client.MaxConcurrentJobs), 0, CFG_ITEM_DEFAULT, "1", NULL, NULL },
{ "MaximumBandwidthPerJob", CFG_TYPE_SPEED, ITEM(res_client.max_bandwidth), 0, 0, NULL, NULL, NULL },
{ "NdmpLogLevel", CFG_TYPE_PINT32, ITEM(res_client.ndmp_loglevel), 0, CFG_ITEM_DEFAULT, "4", NULL, NULL },
{ "NdmpBlockSize", CFG_TYPE_PINT32, ITEM(res_client.ndmp_blocksize), 0, CFG_ITEM_DEFAULT, "64512", NULL, NULL },
{ "NdmpBlockSize", CFG_TYPE_SIZE32, ITEM(res_client.ndmp_blocksize), 0, CFG_ITEM_DEFAULT, "64512", NULL, NULL },
{ "NdmpUseLmdb", CFG_TYPE_BOOL, ITEM(res_client.ndmp_use_lmdb), 0, CFG_ITEM_DEFAULT, "true", NULL, NULL },
TLS_COMMON_CONFIG(res_client),
TLS_CERT_CONFIG(res_client),
Expand Down Expand Up @@ -528,8 +528,8 @@ static RES_ITEM pool_items[] = {
{ "Catalog", CFG_TYPE_RES, ITEM(res_pool.catalog), R_CATALOG, 0, NULL, NULL, NULL },
{ "FileRetention", CFG_TYPE_TIME, ITEM(res_pool.FileRetention), 0, 0, NULL, NULL, NULL },
{ "JobRetention", CFG_TYPE_TIME, ITEM(res_pool.JobRetention), 0, 0, NULL, NULL, NULL },
{ "MinimumBlockSize", CFG_TYPE_PINT32, ITEM(res_pool.MinBlocksize), 0, 0, NULL, NULL, NULL },
{ "MaximumBlockSize", CFG_TYPE_PINT32, ITEM(res_pool.MaxBlocksize), 0, 0, NULL, "14.2.0-", NULL },
{ "MinimumBlockSize", CFG_TYPE_SIZE32, ITEM(res_pool.MinBlocksize), 0, 0, NULL, NULL, NULL },
{ "MaximumBlockSize", CFG_TYPE_SIZE32, ITEM(res_pool.MaxBlocksize), 0, 0, NULL, "14.2.0-", NULL },
{ NULL, 0, { 0 }, 0, 0, NULL, NULL, NULL }
};

Expand Down
12 changes: 12 additions & 0 deletions src/filed/accurate.h
Expand Up @@ -40,13 +40,21 @@
* disadvantage that we need to keep a filenr to index the bitmap which
* also cost some bytes.
*/

#include "hostconfig.h"

#ifdef HAVE_HPUX_OS
#pragma pack(push,4)
#endif

struct accurate_payload {
int64_t filenr;
int32_t delta_seq;
char *lstat;
char *chksum;
};


/*
* Accurate payload storage abstraction classes.
*/
Expand Down Expand Up @@ -89,6 +97,10 @@ struct CurFile {
accurate_payload payload;
};

#ifdef HAVE_HPUX_OS
#pragma pack(pop)
#endif

class B_ACCURATE_HTABLE: public B_ACCURATE {
protected:
htable *m_file_list;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/edit.cc
Expand Up @@ -365,7 +365,7 @@ char *edit_utime(utime_t val, char *buf, int buf_len)
char mybuf[200];
static const int32_t mult[] = {
60 * 60 * 24 * 365,
60 * 60 * 24 *30,
60 * 60 * 24 * 30,
60 * 60 * 24,
60 * 60,
60
Expand Down
13 changes: 12 additions & 1 deletion src/lib/htable.h
Expand Up @@ -45,6 +45,13 @@
(*((void **)&(var))=(void *)((tbl)->next())))
#endif


#include "hostconfig.h"

#ifdef HAVE_HPUX_OS
#pragma pack(push,4)
#endif

typedef enum {
KEY_TYPE_CHAR = 1,
KEY_TYPE_UINT32 = 2,
Expand Down Expand Up @@ -74,7 +81,11 @@ struct h_mem {
char first[1]; /* First byte */
};

class DLL_IMP_EXP htable : public SMARTALLOC {
#ifdef HAVE_HPUX_OS
#pragma pack(pop)
#endif

class DLL_IMP_EXP htable : public SMARTALLOC {
hlink **table; /* Hash table */
int loffset; /* Link offset in item */
hlink *walkptr; /* Table walk pointer */
Expand Down
12 changes: 11 additions & 1 deletion src/lib/ordered_cbuf.cc
Expand Up @@ -135,7 +135,7 @@ void *ordered_circbuf::enqueue(void *data,
* e.g. replace the old with the new data but don't allocate a new
* item on the ordered circular list.
*/
update(item, new_item);
update(item->data, new_item->data);

/*
* Release the unused ocbuf_item.
Expand Down Expand Up @@ -342,6 +342,16 @@ void *ordered_circbuf::peek(enum oc_peek_types type,
item = (struct ocbuf_item *)m_data->next(item);
}
break;
case PEEK_CLONE:
item = (struct ocbuf_item *)m_data->first();
while (item) {
if (callback(item->data, data) == 0) {
retval = data;
break;
}
item = (struct ocbuf_item *)m_data->next(item);
}
break;
default:
goto bail_out;
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/ordered_cbuf.h
Expand Up @@ -31,7 +31,8 @@
enum oc_peek_types {
PEEK_FIRST = 0,
PEEK_LAST,
PEEK_LIST
PEEK_LIST,
PEEK_CLONE
};

struct ocbuf_item {
Expand Down
10 changes: 10 additions & 0 deletions src/lib/tree.h
Expand Up @@ -29,6 +29,12 @@

#include "htable.h"

#include "hostconfig.h"

#ifdef HAVE_HPUX_OS
#pragma pack(push,4)
#endif

struct s_mem {
struct s_mem *next; /* next buffer */
int rem; /* remaining bytes */
Expand Down Expand Up @@ -123,6 +129,10 @@ struct s_hl_entry {
};
typedef struct s_hl_entry HL_ENTRY;

#ifdef HAVE_HPUX_OS
#pragma pack(pop)
#endif

/* type values */
#define TN_ROOT 1 /* root node */
#define TN_NEWDIR 2 /* created directory to fill path */
Expand Down
9 changes: 7 additions & 2 deletions src/plugins/filed/gfapi-fd.cc
Expand Up @@ -698,8 +698,13 @@ static bRC get_next_file_to_backup(bpContext *ctx)
if (status != 0) {
berrno be;

Jmsg(ctx, M_ERROR, "gfapi-fd: glfs_stat(%s) failed: %s\n", p_ctx->cwd, be.bstrerror());
return bRC_Error;
switch (errno) {
case ENOENT:
continue;
default:
Jmsg(ctx, M_ERROR, "gfapi-fd: glfs_stat(%s) failed: %s\n", p_ctx->next_filename, be.bstrerror());
return bRC_Error;
}
}
} else {
#ifndef HAVE_GLFS_READDIRPLUS
Expand Down

0 comments on commit ea81cbc

Please sign in to comment.