fi
$(INSTALL_SCRIPT) mtx-changer $(DESTDIR)$(scriptdir)/mtx-changer
@if test -f ${DESTDIR}${scriptdir}/mtx-changer.conf; then \
- echo " ==> Saving existing mtx-changer.conf to mtx-changer.conf.new"; \
+ echo " ==> Installing mtx-changer.conf to mtx-changer.conf.new"; \
$(INSTALL_SCRIPT) mtx-changer.conf $(DESTDIR)$(scriptdir)/mtx-changer.conf.new; \
else \
$(INSTALL_SCRIPT) mtx-changer.conf $(DESTDIR)$(scriptdir)/mtx-changer.conf; \
return 1; /* Return if no plugins loaded */
}
+ jcr->cmd_plugin = true;
bpContext *plugin_ctx_list = (bpContext *)jcr->plugin_ctx_list;
event.eventType = bEventBackupCommand;
Jmsg1(jcr, M_ERROR, 0, "Command plugin \"%s\" not found.\n", cmd);
bail_out:
+ jcr->cmd_plugin = false;
return 1;
}
attribsEx[0] = 0; /* no extended attributes */
+ if (jcr->cmd_plugin) {
+ return STREAM_UNIX_ATTRIBUTES;
+ }
+
unix_name_to_win32(&ff_pkt->sys_fname, ff_pkt->fname);
// try unicode version
if (p_GetFileAttributesExW) {
- POOLMEM* pwszBuf = get_pool_memory (PM_FNAME);
+ POOLMEM* pwszBuf = get_pool_memory(PM_FNAME);
make_win32_path_UTF8_2_wchar(&pwszBuf, ff_pkt->fname);
- BOOL b=p_GetFileAttributesExW((LPCWSTR) pwszBuf, GetFileExInfoStandard, (LPVOID)&atts);
+ BOOL b=p_GetFileAttributesExW((LPCWSTR)pwszBuf, GetFileExInfoStandard,
+ (LPVOID)&atts);
free_pool_memory(pwszBuf);
if (!b) {
int rtnstat;
Dmsg1(000, "call plugin_bopen fname=%s\n", fname);
rtnstat = plugin_bopen(bfd, fname, flags, mode);
+ if (rtnstat >= 0) {
+ if (flags & O_CREAT || flags & O_WRONLY) { /* Open existing for write */
+ bfd->mode = BF_WRITE;
+ } else {
+ bfd->mode = BF_READ;
+ }
+ } else {
+ bfd->mode = BF_CLOSED;
+ }
free_pool_memory(win32_fname_wchar);
free_pool_memory(win32_fname);
- return rtnstat;
+ return bfd->mode == BF_CLOSED ? -1 : 1;
}
if (!(p_CreateFileA || p_CreateFileW))
Plugin *plugin; /* plugin instance */
save_pkt *plugin_sp; /* plugin save packet */
char *plugin_options; /* user set options for plugin */
+ bool cmd_plugin; /* Set when processing a command Plugin = */
/* Daemon specific part of JCR */
/* This should be empty in the library */
POOLMEM *last_fname; /* last file saved/verified */
POOLMEM *acl_text; /* text of ACL for backup */
int32_t last_type; /* type of last file saved/verified */
- /*********FIXME********* add missing files and files to be retried */
int incremental; /* set if incremental for SINCE */
time_t mtime; /* begin time for SINCE */
int listing; /* job listing in estimate */
+++ /dev/null
-#
-# Simple Makefile for building test FD plugins for Bacula
-#
-# Version $Id: Makefile.in 7638 2008-09-25 14:04:17Z kerns $
-#
-#
-# This file is pulled in by all the Unix Bacula Makefiles
-# so it has all the "common" definitions
-#
-
-DATE="26 September 2008"
-LSMDATE=26Sep08
-VERSION=2.5.5
-VERNAME=bacula-$(VERSION)#
-MAINT=Kern Sibbald#
-MAINTEMAIL=<kern@sibbald.com>#
-WEBMAINT=#
-WEBMAINTEMAIL=#
-WEBPAGE=#
-FTPSITENAME=#
-FTPSITEDIR=#
-#-------------------------------------------------------------------------
-
-SHELL = /bin/sh
-
-# Installation target directories & other installation stuff
-prefix =
-exec_prefix =
-binprefix =
-manprefix =
-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
-
-NO_ECHO = @
-
-# Tools & program stuff
-CC = gcc
-CPP = gcc -E
-CXX = /usr/bin/g++
-MV = /bin/mv
-RM = /bin/rm
-RMF = /bin/rm -f
-CP = /bin/cp
-SED = /bin/sed
-AWK = /usr/bin/mawk
-ECHO = /bin/echo
-CMP = /usr/bin/cmp
-TBL = /usr/bin/tbl
-AR = /usr/bin/ar
-RANLIB = ranlib
-MKDIR = /home/kern/bacula/k/autoconf/mkinstalldirs
-INSTALL = /usr/bin/install -c
-# add the -s to the following in PRODUCTION mode
-INSTALL_PROGRAM = /usr/bin/install -c -m 0754
-INSTALL_DATA = /usr/bin/install -c -m 644
-INSTALL_SCRIPT = /usr/bin/install -c -m 0754
-INSTALL_CONFIG = /usr/bin/install -c -m 640
-
-# Flags & libs
-CFLAGS = -g -O2 -Wall -fno-strict-aliasing -fno-exceptions -fno-rtti
-
-CPPFLAGS = -fno-strict-aliasing -fno-exceptions -fno-rtti
-LDFLAGS =
-TTOOL_LDFLAGS =
-#DEFS = -DHAVE_CONFIG_H
-LIBS = -lpthread -ldl
-WRAPLIBS = -lwrap
-DINCLUDE =
-DLIB =
-DB_LIBS = -L/home/kern/bacula/depkgs/sqlite3 -lsqlite3
-PYTHON_LIBS = -L/usr/lib/python2.5/config -lpython2.5 -lutil -lrt
-PYTHON_INC = -I/usr/include/python2.5
-OPENSSL_LIBS = -lssl -lcrypto
-BDB_CPPFLAGS =
-BDB_LIBS =
-
-
-# Windows (cygwin) flags
-WCFLAGS =
-WLDFLAGS =
-
-# X Include directory
-#XINC = @XPM_CFLAGS@
-
-# extra libraries needed by X on some systems, X library location
-#XLIB = @XPM_LIBS@ -lX11
-
-# End of common section of the Makefile
-#-------------------------------------------------------------------------
-
-
-# No optimization for now for easy debugging
-
-FDDIR=../../filed
-SRCDIR=../..
-LIBDIR=../../lib
-
-.SUFFIXES: .c .o
-.c.o:
- $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -I${SRCDIR} -I${FDDIR} -DTEST_PROGRAM -c $<
-
-all: bpipe-fd.so
-
-test: main example-plugin-fd.so
-
-fd_plugins.o: ${FDDIR}/fd_plugins.h ${FDDIR}/fd_plugins.c
- $(CXX) -I${SRCDIR} -I${FDDIR} -DTEST_PROGRAM -c ${FDDIR}/fd_plugins.c
-
-main: fd_plugins.o
- $(CXX) $(LDFLAGS) -L${LIBDIR} fd_plugins.o -o main -lbac -lpthread -lssl -l crypto -ldl
-
-example-plugin-fd.o: example-plugin-fd.c ${FDDIR}/fd_plugins.h
- $(CXX) -fPIC -I../.. -I${FDDIR} -c example-plugin-fd.c
-
-example-plugin-fd.so: example-plugin-fd.o
- $(CXX) $(LDFLAGS) -shared example-plugin-fd.o -o example-plugin-fd.so
-
-bpipe-fd.o: bpipe-fd.c ${FDDIR}/fd_plugins.h
- $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -fPIC -I../.. -I${FDDIR} -c bpipe-fd.c
-
-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:
*/
#undef VERSION
-#define VERSION "2.5.6"
-#define BDATE "27 September 2008"
-#define LSMDATE "27Sep08"
+#define VERSION "2.5.7"
+#define BDATE "28 September 2008"
+#define LSMDATE "28Sep08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
remove reader/writer in FOPTS????
General:
+28Sep08
+kes Add cmd_plugin flag to jcr so we can globally know if a
+ command plugin is running.
+kes If command plugin running, do not attempt (for the moment)
+ to get Win32 extended attributes.
+kes Ensure that proper Win32 flags are set in bfile packet
+ if plugin_bopen() works on Win32.
+kes Remove generated src/plugins/fd/Makefile
27Sep08
kes Implement build and install of bpipe-fd.so plugin.
kes Rework the interface that passes packets to the plugin