Skip to content

Commit

Permalink
Merge branch 'bareos-15.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Jan 7, 2016
2 parents 9fc293e + 3c5810f commit 7f1fdd6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 25 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -75,6 +75,7 @@ Jose Luis Tallon
Josip Almasi
Juan Luis Frances
Juergen Lock
Jyri Palis
Karl Cunningham
Kern Sibbald
Kjetil Torgrim Homme
Expand Down
29 changes: 18 additions & 11 deletions src/cats/sql_create.c
Expand Up @@ -723,7 +723,6 @@ bool db_create_fileset_record(JCR *jcr, B_DB *mdb, FILESET_DBR *fsr)
int num_rows, len;
char esc_fs[MAX_ESCAPE_NAME_LENGTH];
char esc_md5[MAX_ESCAPE_NAME_LENGTH];
POOL_MEM esc_filesettext(PM_MESSAGE);

db_lock(mdb);
fsr->created = false;
Expand Down Expand Up @@ -761,23 +760,31 @@ bool db_create_fileset_record(JCR *jcr, B_DB *mdb, FILESET_DBR *fsr)
sql_free_result(mdb);
}

/*
* Must create it
*/
if (fsr->CreateTime == 0 && fsr->cCreateTime[0] == 0) {
fsr->CreateTime = time(NULL);
}

bstrutime(fsr->cCreateTime, sizeof(fsr->cCreateTime), fsr->CreateTime);
if (fsr->FileSetText) {
POOL_MEM esc_filesettext(PM_MESSAGE);

len = strlen(fsr->FileSetText);
esc_filesettext.check_size(len * 2 + 1);
mdb->db_escape_string(jcr, esc_filesettext.c_str(), fsr->FileSetText, len);
len = strlen(fsr->FileSetText);
esc_filesettext.check_size(len * 2 + 1);
mdb->db_escape_string(jcr, esc_filesettext.c_str(), fsr->FileSetText, len);

/*
* Must create it
*/
Mmsg(mdb->cmd,
"INSERT INTO FileSet (FileSet,MD5,CreateTime,FileSetText) "
"VALUES ('%s','%s','%s','%s')",
esc_fs, esc_md5, fsr->cCreateTime, esc_filesettext.c_str());
Mmsg(mdb->cmd,
"INSERT INTO FileSet (FileSet,MD5,CreateTime,FileSetText) "
"VALUES ('%s','%s','%s','%s')",
esc_fs, esc_md5, fsr->cCreateTime, esc_filesettext.c_str());
} else {
Mmsg(mdb->cmd,
"INSERT INTO FileSet (FileSet,MD5,CreateTime) "
"VALUES ('%s','%s','%s')",
esc_fs, esc_md5, fsr->cCreateTime);
}

fsr->FileSetId = sql_insert_autokey_record(mdb, mdb->cmd, NT_("FileSet"));
if (fsr->FileSetId == 0) {
Expand Down
22 changes: 9 additions & 13 deletions src/dird/dird_conf.c
Expand Up @@ -1765,20 +1765,18 @@ bool FILESETRES::print_config(POOL_MEM &buff, bool hide_sensitive_data)
for (int i = 0; i < num_includes; i++) {
INCEXE *incexe = include_items[i];

Mmsg(temp, "Include {\n");
indent_config_item(cfg_str, 1, temp.c_str());
indent_config_item(cfg_str, 1, "Include {\n");

/*
* Start options block
*/
if (incexe->num_opts > 0) {
Mmsg(temp, "Options {\n");
indent_config_item(cfg_str, 2, temp.c_str());

for (int j = 0; j < incexe->num_opts; j++) {
FOPTS *fo = incexe->opts_list[j];
bool enhanced_wild = false;

indent_config_item(cfg_str, 2, "Options {\n");

for (int k = 0; fo->opts[k] != '\0'; k++) {
if (fo->opts[k]=='W') {
enhanced_wild = true;
Expand All @@ -1803,7 +1801,7 @@ bool FILESETRES::print_config(POOL_MEM &buff, bool hide_sensitive_data)
pm_strcat(cfg_str, "\n");
break;
case 'c':
indent_config_item(cfg_str, 3, "CheckFileChanges = yes\n");
indent_config_item(cfg_str, 3, "CheckFileChanges = Yes\n");
break;
case 'd':
switch(*(p + 1)) {
Expand All @@ -1826,19 +1824,19 @@ bool FILESETRES::print_config(POOL_MEM &buff, bool hide_sensitive_data)
}
break;
case 'e':
indent_config_item(cfg_str, 3, "Exclude = yes\n");
indent_config_item(cfg_str, 3, "Exclude = Yes\n");
break;
case 'f':
indent_config_item(cfg_str, 3, "OneFS = no\n");
indent_config_item(cfg_str, 3, "OneFS = No\n");
break;
case 'h': /* no recursion */
indent_config_item(cfg_str, 3, "Recurse = no\n");
indent_config_item(cfg_str, 3, "Recurse = No\n");
break;
case 'H': /* no hard link handling */
indent_config_item(cfg_str, 3, "Hardlinks = no\n");
indent_config_item(cfg_str, 3, "Hardlinks = No\n");
break;
case 'i':
indent_config_item(cfg_str, 3, "IgnoreCase = yes\n");
indent_config_item(cfg_str, 3, "IgnoreCase = Yes\n");
break;
case 'J': /* Base Job */
indent_config_item(cfg_str, 3, "BaseJob = ");
Expand Down Expand Up @@ -2056,9 +2054,7 @@ bool FILESETRES::print_config(POOL_MEM &buff, bool hide_sensitive_data)
Mmsg(temp, "Writer = \"%s\"\n", fo->writer);
indent_config_item(cfg_str, 3, temp.c_str());
}
}

if (incexe->num_opts > 0) {
indent_config_item(cfg_str, 2, "}\n");
}
} /* end options block */
Expand Down
11 changes: 10 additions & 1 deletion src/win32/plugins/filed/mssqlvdi-fd.c
Expand Up @@ -1429,7 +1429,16 @@ static inline bool setup_vdi_device(bpContext *ctx, struct io_pkt *io)
/*
* Create the VDI device set.
*/
hr = p_ctx->VDIDeviceSet->CreateEx(NULL, p_ctx->vdsname, &p_ctx->VDIConfig);
if (bstrcasecmp(p_ctx->instance, DEFAULT_INSTANCE)) {
hr = p_ctx->VDIDeviceSet->CreateEx(NULL, p_ctx->vdsname, &p_ctx->VDIConfig);
} else {
POOLMEM *instance_name;

instance_name = get_pool_memory(PM_NAME);
UTF8_2_wchar(&instance_name, p_ctx->instance);
hr = p_ctx->VDIDeviceSet->CreateEx((LPCWSTR)instance_name, p_ctx->vdsname, &p_ctx->VDIConfig);
free_pool_memory(instance_name);
}
if (!SUCCEEDED(hr)) {
comReportError(ctx, hr);
return false;
Expand Down

0 comments on commit 7f1fdd6

Please sign in to comment.