# --client-only directories
fd_subdirs = src scripts src/lib src/findlib src/filed \
@READLINE_SRC@ @BAT_DIR@ @GNOME_DIR@ @TRAY_MONITOR_DIR@ @WX_DIR@ \
- src/console
+ src/console src/plugins/fd
# Non-client-only directores
subdirs = src/cats @DIRD_DIR@ @STORED_DIR@ src/tools
datarootdir = @datarootdir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
+plugindir = @plugindir@
scriptdir = @scriptdir@
mandir = @mandir@
manext = 8
/* Loop getting filenames to backup then saving them */
while (!job_canceled(jcr)) {
memset(&sp, 0, sizeof(sp));
- sp.type = FT_REG;
+ sp.pkt_size = sizeof(sp);
+ sp.pkt_end = sizeof(sp);
sp.portable = true;
sp.cmd = cmd;
Dmsg3(dbglvl, "startBackup st_size=%p st_blocks=%p sp=%p\n", &sp.statp.st_size, &sp.statp.st_blocks,
if (plug_func(plugin)->startBackupFile(&plugin_ctx_list[i], &sp) != bRC_OK) {
goto bail_out;
}
+ if (sp.type == 0 || sp.fname == NULL) {
+ Jmsg1(jcr, M_FATAL, 0, _("Command plugin \"%s\" returned bad startBackupFile packet.\n"),
+ cmd);
+ goto bail_out;
+ }
jcr->plugin_ctx = &plugin_ctx_list[i];
jcr->plugin = plugin;
jcr->plugin_sp = &sp;
memcpy(&ff_pkt->statp, &sp.statp, sizeof(ff_pkt->statp));
Dmsg1(dbglvl, "Save_file: file=%s\n", ff_pkt->fname);
save_file(jcr, ff_pkt, true);
- if (plug_func(plugin)->endBackupFile(&plugin_ctx_list[i]) != bRC_More) {
- goto bail_out;
+ bRC rc = plug_func(plugin)->endBackupFile(&plugin_ctx_list[i]);
+ if (rc == bRC_More) {
+ continue;
}
+ goto bail_out;
}
}
Jmsg1(jcr, M_ERROR, 0, "Command plugin \"%s\" not found.\n", cmd);
if (!set_cmd_plugin(bfd, jcr)) {
return CF_ERROR;
}
+ rp.pkt_size = sizeof(rp);
+ rp.pkt_end = sizeof(rp);
rp.stream = attr->stream;
rp.data_stream = attr->data_stream;
rp.type = attr->type;
if (plug_func(plugin)->createFile(plugin_ctx, &rp) != bRC_OK) {
return CF_ERROR;
}
+ io.pkt_size = sizeof(io);
+ io.pkt_end = sizeof(io);
io.func = IO_OPEN;
io.count = 0;
io.buf = NULL;
Dmsg1(dbglvl, "Loaded plugin: %s\n", plugin->file);
}
-
}
/*
bpContext *plugin_ctx = (bpContext *)jcr->plugin_ctx;
struct io_pkt io;
Dmsg0(dbglvl, "plugin_bopen\n");
+ io.pkt_size = sizeof(io);
+ io.pkt_end = sizeof(io);
io.func = IO_OPEN;
io.count = 0;
io.buf = NULL;
bpContext *plugin_ctx = (bpContext *)jcr->plugin_ctx;
struct io_pkt io;
Dmsg0(dbglvl, "plugin_bclose\n");
+ io.pkt_size = sizeof(io);
+ io.pkt_end = sizeof(io);
io.func = IO_CLOSE;
io.count = 0;
io.buf = NULL;
bpContext *plugin_ctx = (bpContext *)jcr->plugin_ctx;
struct io_pkt io;
Dmsg0(dbglvl, "plugin_bread\n");
+ io.pkt_size = sizeof(io);
+ io.pkt_end = sizeof(io);
io.func = IO_READ;
io.count = count;
io.buf = (char *)buf;
bpContext *plugin_ctx = (bpContext *)jcr->plugin_ctx;
struct io_pkt io;
Dmsg0(dbglvl, "plugin_bwrite\n");
+ io.pkt_size = sizeof(io);
+ io.pkt_end = sizeof(io);
io.func = IO_WRITE;
io.count = count;
io.buf = (char *)buf;
bpContext *plugin_ctx = (bpContext *)jcr->plugin_ctx;
struct io_pkt io;
Dmsg0(dbglvl, "plugin_bseek\n");
+ io.pkt_size = sizeof(io);
+ io.pkt_end = sizeof(io);
io.func = IO_SEEK;
io.offset = offset;
io.whence = whence;
* This packet is used for file save info transfer.
*/
struct save_pkt {
+ int32_t pkt_size; /* size of this packet */
char *fname; /* Full path and filename */
char *link; /* Link name if any */
struct stat statp; /* System stat() packet for file */
uint32_t flags; /* Bacula internal flags */
bool portable; /* set if data format is portable */
char *cmd; /* command */
+ int32_t pkt_end; /* end packet sentinel */
};
/*
* This packet is used for file restore info transfer.
*/
struct restore_pkt {
+ int32_t pkt_size; /* size of this packet */
int32_t stream; /* attribute stream id */
int32_t data_stream; /* id of data stream to follow */
int32_t type; /* file type FT */
const char *where; /* where */
const char *RegexWhere; /* regex where */
int replace; /* replace flag */
+ int32_t pkt_end; /* end packet sentinel */
};
enum {
};
struct io_pkt {
+ int32_t pkt_size; /* Size of this packet */
int32_t func; /* Function code */
int32_t count; /* read/write count */
int32_t flags; /* Open flags */
int32_t whence; /* lseek argument */
boffset_t offset; /* lseek argument */
bool win32; /* Win32 GetLastError returned */
+ int32_t pkt_end; /* end packet sentinel */
};
/****************************************************************************
# so it has all the "common" definitions
#
-DATE="25 September 2008"
-LSMDATE=25Sep08
-VERSION=2.5.4
+DATE="26 September 2008"
+LSMDATE=26Sep08
+VERSION=2.5.5
VERNAME=bacula-$(VERSION)#
MAINT=Kern Sibbald#
MAINTEMAIL=<kern@sibbald.com>#
datarootdir = ${prefix}/share
sbindir = /home/kern/bacula/bin
sysconfdir = /home/kern/bacula/bin
+plugindir = /home/kern/bacula/bin
scriptdir = /home/kern/bacula/bin
mandir = /home/kern/bacula/bin
manext = 8
bpipe-fd.so: bpipe-fd.o
$(CXX) $(LDFLAGS) -shared bpipe-fd.o -o bpipe-fd.so
+install: all
+ $(INSTALL_PROGRAM) bpipe-fd.so $(DESTDIR)$(plugindir)/bpipe-fd.so
+
clean:
rm -f main *.so *.o 1 2 3
+
+distclean: clean
+ rm -f Makefile
+
+uninstall:
+ $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.so
+
+depend:
bpipe-fd.so: bpipe-fd.o
$(CXX) $(LDFLAGS) -shared bpipe-fd.o -o bpipe-fd.so
+install: all
+ $(INSTALL_PROGRAM) bpipe-fd.so $(DESTDIR)$(plugindir)/bpipe-fd.so
+
clean:
rm -f main *.so *.o 1 2 3
+
+distclean: clean
+ rm -f Makefile
+
+uninstall:
+ $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.so
+
+depend:
struct plugin_ctx *p_ctx = (struct plugin_ctx *)ctx->pContext;
time_t now = time(NULL);
sp->fname = p_ctx->fname;
+ sp->type = FT_REG;
sp->statp.st_mode = 0700 | S_IFREG;
sp->statp.st_ctime = now;
sp->statp.st_mtime = now;
*/
#undef VERSION
-#define VERSION "2.5.5"
-#define BDATE "26 September 2008"
-#define LSMDATE "26Sep08"
+#define VERSION "2.5.6"
+#define BDATE "27 September 2008"
+#define LSMDATE "27Sep08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
#define MAP_FAILED ((void *) -1)
void *mmap(void *start, size_t length, int prot, int flags,
- int fd, off_t offset);
+ int fd, off_t offset);
int munmap(void *start, size_t length);
#endif /* __COMPAT_H_ */
remove reader/writer in FOPTS????
General:
+27Sep08
+kes Implement build and install of bpipe-fd.so plugin.
+kes Rework the interface that passes packets to the plugin
+ so that the packet is started and ended by the packet size.
+ This allows the driver to do a sanity check.
26Sep08
kes Rework the pluginIO Bacula internal code to enable
proper handling of Win32 error codes from GetLastError.