1.37 Possibilities:
+- Document security problems with the same password for everyone in
+ rpm and Win32 releases.
- Browse generations of files.
- Add offline command to Bacula console.
- I've seen an error when my catalog's File table fills up. I
};
#undef MAX_FOPTS
-#define MAX_FOPTS 30
+#define MAX_FOPTS 32
/* File options structure */
struct FOPTS {
{"aclsupport", store_opts, NULL, 0, 0, 0},
{"reader", store_reader, NULL, 0, 0, 0},
{"writer", store_writer, NULL, 0, 0, 0},
+ {"ignorecase", store_opts, NULL, 0, 0, 0},
{NULL, NULL, NULL, 0, 0, 0}
};
INC_KW_MTIMEONLY,
INC_KW_KEEPATIME,
INC_KW_EXCLUDE,
- INC_KW_ACL
+ INC_KW_ACL,
+ INC_KW_IGNORECASE
};
/*
{"keepatime", INC_KW_KEEPATIME},
{"exclude", INC_KW_EXCLUDE},
{"aclsupport", INC_KW_ACL},
+ {"ignorecase", INC_KW_IGNORECASE},
{NULL, 0}
};
{"no", INC_KW_EXCLUDE, "0"},
{"yes", INC_KW_ACL, "A"},
{"no", INC_KW_ACL, "0"},
+ {"yes", INC_KW_IGNORECASE, "i"},
+ {"no", INC_KW_IGNORECASE, "0"},
{NULL, 0, 0}
};
#include "bacula.h"
#include "dird.h"
+#ifdef HAVE_FNMATCH
#include <fnmatch.h>
+#else
+#include "lib/fnmatch.h"
+#endif
#include "findlib/find.h"
int rc;
char prbuf[500];
preg = (regex_t *)malloc(sizeof(regex_t));
- rc = regcomp(preg, item, REG_EXTENDED);
+ if (current_opts->flags & FO_IGNORECASE) {
+ rc = regcomp(preg, item, REG_EXTENDED|REG_ICASE);
+ } else {
+ rc = regcomp(preg, item, REG_EXTENDED);
+ }
if (rc != 0) {
regerror(rc, preg, prbuf, sizeof(prbuf));
regfree(preg);
case 'H': /* no hard link handling */
fo->flags |= FO_NO_HARDLINK;
break;
+ case 'i':
+ fo->flags |= FO_IGNORECASE;
+ break;
case 'M': /* MD5 */
fo->flags |= FO_MD5;
break;
static bool accept_file(FF_PKT *ff)
{
int i, j, k;
+ int ic;
findFILESET *fileset = ff->fileset;
findINCEXE *incexe = fileset->incexe;
ff->GZIP_level = fo->GZIP_level;
ff->reader = fo->reader;
ff->writer = fo->writer;
+ ic = (ff->flags & FO_IGNORECASE) ? FNM_CASEFOLD : 0;
for (k=0; k<fo->wild.size(); k++) {
- if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode) == 0) {
+ if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode|ic) == 0) {
if (ff->flags & FO_EXCLUDE) {
Dmsg2(100, "Exclude wild: %s file=%s\n", (char *)fo->wild.get(k),
ff->fname);
findINCEXE *incexe = (findINCEXE *)fileset->exclude_list.get(i);
for (j=0; j<incexe->opts_list.size(); j++) {
findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
+ ic = (fo->flags & FO_IGNORECASE) ? FNM_CASEFOLD : 0;
for (k=0; k<fo->wild.size(); k++) {
- if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode) == 0) {
+ if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode|ic) == 0) {
Dmsg1(100, "Reject wild1: %s\n", ff->fname);
return false; /* reject file */
}
}
}
+ ic = (incexe->current_opts != NULL && incexe->current_opts->flags & FO_IGNORE
+ ? FNM_CASEFOLD : 0;
for (j=0; j<incexe->name_list.size(); j++) {
- if (fnmatch((char *)incexe->name_list.get(j), ff->fname, fnmode) == 0) {
+ if (fnmatch((char *)incexe->name_list.get(j), ff->fname, fnmode|ic) == 0) {
Dmsg1(100, "Reject wild2: %s\n", ff->fname);
return false; /* reject file */
}
#define FO_EXCLUDE (1<<13) /* Exclude file */
#define FO_ACL (1<<14) /* Backup ACLs */
#define FO_NO_HARDLINK (1<<15) /* don't handle hard links */
+#define FO_IGNORECASE (1<<16) /* Ignore file name case */
+
struct s_included_file {
struct s_included_file *next;
#include "bacula.h"
#include "stored.h"
+#ifdef HAVE_FNMATCH
#include <fnmatch.h>
+#else
+#include "lib/fnmatch.h"
+#endif
/* Forward references */
static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done);