} else if (strcasecmp(ua->argv[j], NT_("RESTORE_FIRST")) == 0) {
rr.FileType = FT_RESTORE_FIRST;
+ } else if (strcasecmp(ua->argv[j], NT_("SECURITY")) == 0) {
+ rr.FileType = FT_SECURITY_OBJECT;
+
} else if (strcasecmp(ua->argv[j], NT_("ALL")) == 0) {
rr.FileType = 0;
case FT_LNK:
Dmsg2(130, "FT_LNK saving: %s -> %s\n", ff_pkt->fname, ff_pkt->link);
break;
+ case FT_SECURITY_OBJECT:
+ Dmsg1(100, "FT_SECURITY_OBJECT saving: %s\n", ff_pkt->fname);
+ break;
case FT_RESTORE_FIRST:
Dmsg1(100, "FT_RESTORE_FIRST saving: %s\n", ff_pkt->fname);
break;
ff_pkt->type, ff_pkt->link, 0, attribs, 0, 0,
attribsEx, 0, ff_pkt->delta_seq, 0);
break;
+ case FT_SECURITY_OBJECT:
case FT_PLUGIN_CONFIG:
case FT_RESTORE_FIRST:
comp_len = ff_pkt->restore_obj.object_len;
static bRC baculaAcceptFile(bpContext *ctx, struct save_pkt *sp);
static bRC baculaAccurateAttribs(bpContext *ctx, accurate_attribs_pkt *att);
static void plugin_register_verify_data(bpContext *ctx);
+static bRC baculaAddPlugin(bpContext *ctx, const char *file);
/*
* These will be plugged into the global pointer structure for
baculaCheckChanges,
baculaAcceptFile,
baculaAccurateAttribs,
+ baculaAddPlugin
};
/*
}
/**
- * Let the plugin define files/directories to be excluded
+ * Let the plugin define files/directories to be included
* from the main backup.
*/
static bRC baculaAddInclude(bpContext *ctx, const char *file)
return bRC_OK;
}
+/**
+ * Let the plugin define plugin to be included
+ * from the main backup.
+ */
+static bRC baculaAddPlugin(bpContext *ctx, const char *file)
+{
+ JCR *jcr;
+ findINCEXE *old;
+ bacula_ctx *bctx;
+
+ Dsm_check(999);
+ if (!is_ctx_good(ctx, jcr, bctx)) {
+ return bRC_Error;
+ }
+ if (!file) {
+ return bRC_Error;
+ }
+
+ /* Save the include context */
+ old = get_incexe(jcr);
+
+ /* Not right time to add include */
+ if (!old) {
+ return bRC_Error;
+ }
+ if (!bctx->include) {
+ bctx->include = old;
+ }
+
+ set_incexe(jcr, bctx->include);
+ add_file_to_fileset(jcr, file, false);
+
+ /* Restore the current context */
+ set_incexe(jcr, old);
+
+ Dmsg1(100, "Add include file=%s\n", file);
+ Dsm_check(999);
+ return bRC_OK;
+}
+
static bRC baculaAddOptions(bpContext *ctx, const char *opts)
{
JCR *jcr;
bRC (*checkChanges)(bpContext *ctx, struct save_pkt *sp);
bRC (*AcceptFile)(bpContext *ctx, struct save_pkt *sp); /* Need fname and statp */
bRC (*getAccurateAttribs)(bpContext *ctx, accurate_attribs_pkt *att);
+ bRC (*AddPlugin)(bpContext *ctx, const char *file);
+
} bFuncs;
Jmsg(jcr, M_SKIPPED, 1, _(" File system change prohibited. Directory skipped: %s\n"), ff_pkt->fname);
return 1;
case FT_PLUGIN_CONFIG:
+ case FT_SECURITY_OBJECT:
case FT_RESTORE_FIRST:
return 1; /* silently skip */
case FT_NOOPEN: {
#define FT_PLUGIN_CONFIG 27 /* Object for Plugin configuration */
#define FT_PLUGIN_CONFIG_FILLED 28 /* Object for Plugin configuration filled by Director */
#define FT_PLUGIN_OBJECT 29 /* Opaque Plugin Object used for Object Management*/
+#define FT_SECURITY_OBJECT 30 /* Security report */
/* Definitions for upper part of type word (see above). */
#define AR_DATA_STREAM (1<<16) /* Data stream id present */
/* Quick way to know if a Filetype is about a plugin "Object" */
#define IS_FT_OBJECT(x) (((x) == FT_RESTORE_FIRST) || ((x) == FT_PLUGIN_CONFIG_FILLED) || ((x) == FT_PLUGIN_CONFIG) \
- || ((x) == FT_PLUGIN_OBJECT))
+ || ((x) == FT_PLUGIN_OBJECT) || ((x) == FT_SECURITY_OBJECT))
#endif /* __BFILETYPES_H */