- Figure out how to use ssh or stunnel to protect Bacula communications.
For 1.31 release:
-- Finish WIN32_DATA stream code (bextract, check if can handle stream)
+- Investigate doing RAW backup of Win32 partition.
+- Add JobName= to VerifyToCatalog so that all verifies can be done at the end.
+- Add thread specific data to hold the jcr -- send error messages from
+ low level routines by accessing it and using Jmsg().
- Default duration with no qualifier is sec should be 1 day
- Find a solution for the multiple FileSet problem (when it is changed). Add date?
- Cancel waiting for Client connect in SD if FD goes away.
- Count errors during restore and print them in the Job report.
- Bug: fix access problems on files restored on WinXP.
- Put system type returned by FD into catalog.
-
+- Finish WIN32_DATA stream code (bextract, check if can handle stream)
install-autostart-fd:
- @if test -f $(DESTDIR)/etc/rc.d/init.d/bacula-fd; then \
- /sbin/chkconfig --del bacula-fd; \
+ @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-fd; then \
+ /sbin/chkconfig --del bacula-fd; \
fi
@$(INSTALL_PROGRAM) -m 744 bacula-fd $(DESTDIR)/etc/rc.d/init.d/bacula-fd
# set symlinks for script at startup and shutdown
- @/sbin/chkconfig --add bacula-fd
+ @if test x$(DESTDIR) = x ; then \
+ /sbin/chkconfig --add bacula-fd; \
+ fi
install-autostart-sd:
- @if test -f $(DESTDIR)/etc/rc.d/init.d/bacula-sd; then \
+ @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-sd; then \
/sbin/chkconfig --del bacula-sd; \
fi
@$(INSTALL_PROGRAM) -m 744 bacula-sd $(DESTDIR)/etc/rc.d/init.d/bacula-sd
# set symlinks for script at startup and shutdown
- @/sbin/chkconfig --add bacula-sd
+ @if test x$(DESTDIR) = x ; then \
+ /sbin/chkconfig --add bacula-sd; \
+ fi
install-autostart-dir:
- @if test -f $(DESTDIR)/etc/rc.d/init.d/bacula-dir; then \
+ @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-dir; then \
/sbin/chkconfig --del bacula-dir; \
fi
@$(INSTALL_PROGRAM) -m 744 bacula-dir $(DESTDIR)/etc/rc.d/init.d/bacula-dir
# set symlinks for script at startup and shutdown
- @/sbin/chkconfig --add bacula-dir
+ @if test x$(DESTDIR) = x ; then \
+ /sbin/chkconfig --add bacula-dir; \
+ fi
uninstall: uninstall-autostart
uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
uninstall-autostart-fd:
- @if test -f $(DESTDIR)/etc/rc.d/init.d/bacula-fd; then \
+ @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-fd; then \
/sbin/chkconfig --del bacula-fd; \
fi
@rm -f $(DESTDIR)/etc/rc.d/init.d/bacula-fd
uninstall-autostart-sd:
- @if test -f $(DESTDIR)/etc/rc.d/init.d/bacula-sd; then \
+ @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-sd; then \
/sbin/chkconfig --del bacula-sd; \
fi
@rm -f $(DESTDIR)/etc/rc.d/init.d/bacula-sd
uninstall-autostart-dir:
- @if test -f $(DESTDIR)/etc/rc.d/init.d/bacula-dir; then \
+ @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-dir; then \
/sbin/chkconfig --del bacula-dir; \
fi
@rm -f $(DESTDIR)/etc/rc.d/init.d/bacula-dir
if (fgets(UA_sock->msg, len, input) == NULL) {
stat = -1;
} else {
+ sendit("%s", UA_sock->msg); /* echo to terminal */
strip_trailing_junk(UA_sock->msg);
UA_sock->msglen = strlen(UA_sock->msg);
stat = 1;
if (jcr->JobLevel == L_VERIFY_CATALOG || jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
memcpy(&jr, &(jcr->jr), sizeof(jr));
if (!db_find_last_jobid(jcr, jcr->db, &jr)) {
- Jmsg(jcr, M_FATAL, 0, _(
- "Unable to find JobId of previous InitCatalog Job.\n"
- "Please run a Verify with Level=InitCatalog before\n"
- "running the current Job.\n"));
+ if (jcr->JobLevel == L_VERIFY_CATALOG) {
+ Jmsg(jcr, M_FATAL, 0, _(
+ "Unable to find JobId of previous InitCatalog Job.\n"
+ "Please run a Verify with Level=InitCatalog before\n"
+ "running the current Job.\n"));
+ } else {
+ Jmsg(jcr, M_FATAL, 0, _(
+ "Unable to find JobId of previous Job for this client.\n"));
+ }
goto bail_out;
}
JobId = jr.JobId;
memset(&jr, 0, sizeof(jr));
jr.JobId = JobId;
if (!db_get_job_record(jcr, jcr->db, &jr)) {
- Jmsg(jcr, M_FATAL, 0, _("Could not get job record. %s"), db_strerror(jcr->db));
+ Jmsg(jcr, M_FATAL, 0, _("Could not get job record for previous Job. ERR=%s"),
+ db_strerror(jcr->db));
goto bail_out;
}
if (jr.JobStatus != 'T') {
jcr->VolumeName[0] = 0;
if (!db_get_job_volume_names(jcr, jcr->db, jr.JobId, &jcr->VolumeName) ||
jcr->VolumeName[0] == 0) {
- Jmsg(jcr, M_FATAL, 0, _("Cannot find Volume Name for verify JobId=%d. %s"),
+ Jmsg(jcr, M_FATAL, 0, _("Cannot find Volume Name for verify JobId=%u. ERR=%s"),
jr.JobId, db_strerror(jcr->db));
goto bail_out;
}
case FT_NOACCESS:
Jmsg(jcr, M_NOTSAVED, -1, _(" Could not access %s: ERR=%s\n"), ff_pkt->fname,
strerror(ff_pkt->ff_errno));
+ jcr->Errors++;
return 1;
case FT_NOFOLLOW:
Jmsg(jcr, M_NOTSAVED, -1, _(" Could not follow link %s: ERR=%s\n"), ff_pkt->fname,
strerror(ff_pkt->ff_errno));
+ jcr->Errors++;
return 1;
case FT_NOSTAT:
Jmsg(jcr, M_NOTSAVED, -1, _(" Could not stat %s: ERR=%s\n"), ff_pkt->fname,
strerror(ff_pkt->ff_errno));
+ jcr->Errors++;
return 1;
case FT_DIRNOCHG:
case FT_NOCHG:
case FT_NOOPEN:
Jmsg(jcr, M_NOTSAVED, -1, _(" Could not open directory %s: ERR=%s\n"), ff_pkt->fname,
strerror(ff_pkt->ff_errno));
+ jcr->Errors++;
return 1;
default:
Jmsg(jcr, M_NOTSAVED, 0, _(" Unknown file type %d; not saved: %s\n"), ff_pkt->type, ff_pkt->fname);
+ jcr->Errors++;
return 1;
}
/* Open any file with data that we intend to save */
if (ff_pkt->type != FT_LNKSAVED && (S_ISREG(ff_pkt->statp.st_mode) &&
ff_pkt->statp.st_size > 0) ||
- ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO
-#ifdef HAVE_CYGWIN
- || ff_pkt->type == FT_DIR
-#endif
- ) {
+ ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO ||
+ (is_win32_backup() && ff_pkt->type == FT_DIR)) {
btimer_id tid;
if (ff_pkt->type == FT_FIFO) {
tid = start_thread_timer(pthread_self(), 60);
ff_pkt->ff_errno = errno;
Jmsg(jcr, M_NOTSAVED, -1, _(" Cannot open %s: ERR=%s.\n"), ff_pkt->fname,
berror(&ff_pkt->bfd));
+ jcr->Errors++;
stop_thread_timer(tid);
return 1;
}
Dmsg1(100, "Saving data, type=%d\n", ff_pkt->type);
/* Note, no sparse option for win32_data */
- if (is_win32_data(&ff_pkt->bfd)) {
+ if (is_win32_backup()) {
stream = STREAM_WIN32_DATA;
ff_pkt->flags &= ~FO_SPARSE;
} else if (ff_pkt->flags & FO_SPARSE) {
}
}
+ P(jcr->mutex);
+ pm_strcpy(&jcr->last_fname, fname);
+ V(jcr->mutex);
jcr->num_files_examined++;
Dmsg1(30, "Outfile=%s\n", ofile);
/* Data stream */
} else if (stream == STREAM_FILE_DATA || stream == STREAM_SPARSE_DATA ||
stream == STREAM_WIN32_DATA) {
+ if (stream == STREAM_WIN32_DATA && !is_win32_backup()) {
+ Jmsg(jcr, M_ERROR, 0, _("Win32 backup data not supported on this Client.\n"));
+ extract = FALSE;
+ continue;
+ }
if (extract) {
if (stream == STREAM_SPARSE_DATA) {
ser_declare;
if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
Jmsg3(jcr, M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
edit_uint64(fileAddr, ec1), ofile, berror(&bfd));
- goto bail_out;
+ extract = FALSE;
+ continue;
}
}
} else {
if ((uint32_t)bwrite(&bfd, wbuf, wsize) != wsize) {
Dmsg0(0, "===Write error===\n");
Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: ERR=%s\n"), ofile, berror(&bfd));
- goto bail_out;
- }
+ extract = FALSE;
+ continue;
+ }
total += wsize;
jcr->JobBytes += wsize;
fileAddr += wsize;
/* GZIP data stream */
} else if (stream == STREAM_GZIP_DATA || stream == STREAM_SPARSE_GZIP_DATA ||
stream == STREAM_WIN32_GZIP_DATA) {
+ if (stream == STREAM_WIN32_GZIP_DATA && !is_win32_backup()) {
+ Jmsg(jcr, M_ERROR, 0, _("Win32 GZIP backup data not supported on this Client.\n"));
+ extract = FALSE;
+ continue;
+ }
#ifdef HAVE_LIBZ
if (extract) {
ser_declare;
if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
Jmsg3(jcr, M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
edit_uint64(fileAddr, ec1), ofile, berror(&bfd));
- goto bail_out;
+ extract = FALSE;
+ continue;
}
}
} else {
if ((stat=uncompress((Byte *)jcr->compress_buf, &compress_len,
(const Byte *)wbuf, (uLong)wsize)) != Z_OK) {
Jmsg(jcr, M_ERROR, 0, _("Uncompression error. ERR=%d\n"), stat);
- goto bail_out;
+ extract = FALSE;
+ continue;
}
Dmsg2(100, "Write uncompressed %d bytes, total before write=%d\n", compress_len, total);
if ((uLong)bwrite(&bfd, jcr->compress_buf, compress_len) != compress_len) {
Dmsg0(0, "===Write error===\n");
Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"), ofile, berror(&bfd));
- goto bail_out;
+ extract = FALSE;
+ continue;
}
total += compress_len;
jcr->JobBytes += compress_len;
#else
if (extract) {
Jmsg(jcr, M_ERROR, 0, _("GZIP data stream found, but GZIP not configured!\n"));
- goto bail_out;
+ extract = FALSE;
+ continue;
}
#endif
/* If extracting, wierd stream (not 1 or 2), close output file anyway */
p_BackupWrite = (t_BackupWrite)
GetProcAddress(hLib, "BackupWrite");
FreeLibrary(hLib);
- }
- hLib = LoadLibrary("ADVAPI32.DLL");
- if (hLib) {
- p_OpenProcessToken = (t_OpenProcessToken)
- GetProcAddress(hLib, "OpenProcessToken");
- p_AdjustTokenPrivileges = (t_AdjustTokenPrivileges)
- GetProcAddress(hLib, "AdjustTokenPrivileges");
- p_LookupPrivilegeValue = (t_LookupPrivilegeValue)
- GetProcAddress(hLib, "LookupPrivilegeValueA");
- FreeLibrary(hLib);
- }
+ }
+ hLib = LoadLibrary("ADVAPI32.DLL");
+ if (hLib) {
+ p_OpenProcessToken = (t_OpenProcessToken)
+ GetProcAddress(hLib, "OpenProcessToken");
+ p_AdjustTokenPrivileges = (t_AdjustTokenPrivileges)
+ GetProcAddress(hLib, "AdjustTokenPrivileges");
+ p_LookupPrivilegeValue = (t_LookupPrivilegeValue)
+ GetProcAddress(hLib, "LookupPrivilegeValueA");
+ FreeLibrary(hLib);
+ }
+ /*
+ * Even if these are defined, don't use on old
+ * platforms.
+ */
+ if (bacService::IsWin95()) {
+ p_BackupRead = NULL;
+ p_BackupWrite = NULL;
+ }
// Set this process to be the last application to be shut down.
if (p_SetProcessShutdownParameters) {
* Returns 1 if function worked
* Returns 0 if failed (i.e. do not have Backup API on this machine)
*/
-int set_win32_data(BFILE *bfd, int enable)
+int set_win32_backup(BFILE *bfd, int enable)
{
if (!enable) {
bfd->use_backup_api = 0;
return bfd->use_backup_api;
}
-int is_win32_data(BFILE *bfd)
+int is_win32_backup(void)
{
- return bfd->use_backup_api;
+ return p_BackupRead && p_BackupWrite;
}
HANDLE bget_handle(BFILE *bfd)
{
-#ifdef xxx
- if (!bfd->use_win_api) {
- return get_osfhandle(bfd->fid);
- }
-#endif
return bfd->fh;
}
int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode)
{
POOLMEM *win32_fname;
-
-#ifdef xxx
- if (!bfd->use_win_api) {
- bfd->fid = open(fname, flags, mode);
- if (bfd->fid >= 0) {
- bfd->mode = BF_READ; /* not important if BF_READ or BF_WRITE */
- }
- return bfd->fid;
- }
-#endif
+ DWORD dwaccess, dwflags;
/* Convert to Windows path format */
win32_fname = get_pool_memory(PM_FNAME);
unix_name_to_win32(&win32_fname, (char *)fname);
- if (flags & O_CREAT) {
+ if (flags & O_CREAT) { /* Create */
+ if (bfd->use_backup_api) {
+ dwaccess = GENERIC_WRITE|FILE_ALL_ACCESS|WRITE_OWNER|WRITE_DAC|ACCESS_SYSTEM_SECURITY;
+ dwflags = FILE_FLAG_BACKUP_SEMANTICS;
+ } else {
+ dwaccess = GENERIC_WRITE|FILE_ALL_ACCESS;
+ dwflags = 0;
+ }
bfd->fh = CreateFile(win32_fname,
- GENERIC_WRITE|FILE_ALL_ACCESS|WRITE_OWNER|WRITE_DAC|ACCESS_SYSTEM_SECURITY, /* access */
- 0,
- NULL, /* SecurityAttributes */
- CREATE_ALWAYS, /* CreationDisposition */
- FILE_FLAG_BACKUP_SEMANTICS, /* Flags and attributes */
- NULL); /* TemplateFile */
+ dwaccess, /* Requested access */
+ 0, /* Shared mode */
+ NULL, /* SecurityAttributes */
+ CREATE_ALWAYS, /* CreationDisposition */
+ dwflags, /* Flags and attributes */
+ NULL); /* TemplateFile */
bfd->mode = BF_WRITE;
- } else if (flags & O_WRONLY) { /* creating */
+
+ } else if (flags & O_WRONLY) { /* Open existing for write */
+ if (bfd->use_backup_api) {
+ dwaccess = FILE_ALL_ACCESS|WRITE_OWNER|WRITE_DAC|ACCESS_SYSTEM_SECURITY;
+ dwflags = FILE_FLAG_BACKUP_SEMANTICS;
+ } else {
+ dwaccess = FILE_ALL_ACCESS;
+ dwflags = 0;
+ }
bfd->fh = CreateFile(win32_fname,
- FILE_ALL_ACCESS|WRITE_OWNER|WRITE_DAC|ACCESS_SYSTEM_SECURITY, /* access */
- 0,
- NULL, /* SecurityAttributes */
- OPEN_EXISTING, /* CreationDisposition */
- FILE_FLAG_BACKUP_SEMANTICS, /* Flags and attributes */
- NULL);
+ dwaccess, /* Requested access */
+ 0, /* Shared mode */
+ NULL, /* SecurityAttributes */
+ OPEN_EXISTING, /* CreationDisposition */
+ dwflags, /* Flags and attributes */
+ NULL); /* TemplateFile */
bfd->mode = BF_WRITE;
- } else {
- bfd->fh = CreateFile(win32_fname,
- GENERIC_READ|READ_CONTROL|ACCESS_SYSTEM_SECURITY, /* access */
- FILE_SHARE_READ, /* shared mode */
- NULL, /* SecurityAttributes */
- OPEN_EXISTING, /* CreationDisposition */
- FILE_FLAG_BACKUP_SEMANTICS, /* Flags and attributes */
- NULL); /* TemplateFile */
+ } else { /* Read */
+ if (bfd->use_backup_api) {
+ dwaccess = GENERIC_READ|READ_CONTROL|ACCESS_SYSTEM_SECURITY;
+ dwflags = FILE_FLAG_BACKUP_SEMANTICS;
+ } else {
+ dwaccess = GENERIC_READ;
+ dwflags = 0;
+ }
+ bfd->fh = CreateFile(win32_fname,
+ dwaccess, /* Requested access */
+ FILE_SHARE_READ, /* Shared mode */
+ NULL, /* SecurityAttributes */
+ OPEN_EXISTING, /* CreationDisposition */
+ dwflags, /* Flags and attributes */
+ NULL); /* TemplateFile */
bfd->mode = BF_READ;
}
+
if (bfd->fh == INVALID_HANDLE_VALUE) {
bfd->lerror = GetLastError();
bfd->mode = BF_CLOSED;
int bclose(BFILE *bfd)
{
int stat = 0;
-#ifdef xxx
- if (!bfd->use_win_api) {
- int stat = close(bfd->fid);
- bfd->fid = -1;
- bfd->mode = BF_CLOSED;
- return stat;
- }
-#endif
+
if (bfd->errmsg) {
free_pool_memory(bfd->errmsg);
bfd->errmsg = NULL;
char *berror(BFILE *bfd)
{
LPTSTR msg;
-#ifdef xxx
- if (!bfd->use_win_api) {
- return strerror(errno);
- }
-#endif
+
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
*/
ssize_t bread(BFILE *bfd, void *buf, size_t count)
{
-#ifdef xxx
- if (!bfd->use_win_api) {
- return read(bfd->fid, buf, count);
- }
-#endif
bfd->rw_bytes = 0;
if (bfd->use_backup_api) {
ssize_t bwrite(BFILE *bfd, void *buf, size_t count)
{
-#ifdef xxx
- if (!bfd->use_win_api) {
- return write(bfd->fid, buf, count);
- }
-#endif
bfd->rw_bytes = 0;
if (bfd->use_backup_api) {
off_t blseek(BFILE *bfd, off_t offset, int whence)
{
-#ifdef xxx
- if (!bfd->use_win_api) {
- return lseek(bfd->fid, offset, whence);
- }
-#endif
/* ****FIXME**** this is needed if we want to read Win32 Archives */
return -1;
}
bfd->fid = -1;
}
-int is_win32_data(BFILE *bfd)
+int set_win32_backup(BFILE *bfd, int enable)
+{
+ return 0;
+}
+
+int is_win32_backup(void)
{
return 0;
}
#include "winapi.h"
#define BF_CLOSED 0
-#define BF_READ 1 /* BackupRead */
-#define BF_WRITE 2 /* BackupWrite */
+#define BF_READ 1 /* BackupRead */
+#define BF_WRITE 2 /* BackupWrite */
/* In bfile.c */
/* Basic low level I/O file packet */
typedef struct s_bfile {
#ifdef xxx
- int use_win_api; /* set if using WinAPI */
+ int use_win_api; /* set if using WinAPI */
#endif
- int use_backup_api; /* set if using BackupRead/Write */
- int mode; /* set if file is open */
- HANDLE fh; /* Win32 file handle */
- int fid; /* fd if doing Unix style */
- LPVOID lpContext; /* BackupRead/Write context */
- POOLMEM *errmsg; /* error message buffer */
- DWORD rw_bytes; /* Bytes read or written */
- DWORD lerror; /* Last error code */
+ int use_backup_api; /* set if using BackupRead/Write */
+ int mode; /* set if file is open */
+ HANDLE fh; /* Win32 file handle */
+ int fid; /* fd if doing Unix style */
+ LPVOID lpContext; /* BackupRead/Write context */
+ POOLMEM *errmsg; /* error message buffer */
+ DWORD rw_bytes; /* Bytes read or written */
+ DWORD lerror; /* Last error code */
} BFILE;
HANDLE bget_handle(BFILE *bfd);
-#else /* Linux/Unix systems */
+#else /* Linux/Unix systems */
/* Basic low level I/O file packet */
typedef struct s_bfile {
- int fid; /* file id on Unix */
+ int fid; /* file id on Unix */
int berrno;
} BFILE;
void binit(BFILE *bfd);
int is_bopen(BFILE *bfd);
-int is_win32_data(BFILE *bfd);
+int set_win32_backup(BFILE *bfd, int enable);
+int is_win32_backup();
char *berror(BFILE *bfd);
int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode);
int bclose(BFILE *bfd);
if (make_path(jcr, ofile, new_mode, parent_mode, uid, gid, 0, NULL) != 0) {
return CF_ERROR;
}
-#ifdef HAVE_CYGWIN
- if ((bopen(ofd, ofile, O_WRONLY|O_BINARY, 0)) < 0) {
- Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"),
- ofile, berror(ofd));
- return CF_ERROR;
+ /*
+ * If we are using the Win32 Backup API, we open the
+ * directory so that the security info will be read
+ * and saved.
+ */
+ if (is_win32_backup()) {
+ if ((bopen(ofd, ofile, O_WRONLY|O_BINARY, 0)) < 0) {
+ Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"),
+ ofile, berror(ofd));
+ return CF_ERROR;
+ }
+ return CF_EXTRACT;
+ } else {
+ return CF_CREATED;
}
- return CF_EXTRACT;
-#else
- return CF_CREATED;
-#endif
/* The following should not occur */
case FT_NOACCESS:
int status;
dev_t our_device = ff_pkt->statp.st_dev;
-#ifndef HAVE_CYGWIN
- if (access(fname, R_OK) == -1 && geteuid() != 0) {
- /* Could not access() directory */
- ff_pkt->type = FT_NOACCESS;
- ff_pkt->ff_errno = errno;
- rtn_stat = handle_file(ff_pkt, pkt);
- if (ff_pkt->linked) {
- ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
+ /*
+ * If we are using Win32 backup API, don't check
+ * access as everything is more complicated, and
+ * in principle, we should be able to access everything.
+ */
+ if (!is_win32_backup()) {
+ if (access(fname, R_OK) == -1 && geteuid() != 0) {
+ /* Could not access() directory */
+ ff_pkt->type = FT_NOACCESS;
+ ff_pkt->ff_errno = errno;
+ rtn_stat = handle_file(ff_pkt, pkt);
+ if (ff_pkt->linked) {
+ ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
+ }
+ return rtn_stat;
}
- return rtn_stat;
}
-#endif
/* Build a canonical directory name with a trailing slash in link var */
len = strlen(fname);
static int type;
static int stream;
static int prog_name_msg = 0;
+static int win32_data_msg = 0;
static char *VolumeName = NULL;
static char *wbuf; /* write buffer address */
if (bsr) {
free_bsr(bsr);
}
+ if (prog_name_msg) {
+ Pmsg1(000, "%d Program Name and/or Program Data Stream records ignored.\n",
+ prog_name_msg);
+ }
+ if (win32_data_msg) {
+ Pmsg1(000, "%d Win32 data or Win32 gzip data stream records. Ignored.\n",
+ win32_data_msg);
+ }
return 0;
}
} else if (rec->Stream == STREAM_PROGRAM_NAMES || rec->Stream == STREAM_PROGRAM_DATA) {
if (!prog_name_msg) {
Pmsg0(000, "Got Program Name or Data Stream. Ignored.\n");
- prog_name_msg = 1;
+ prog_name_msg++;
+ }
+ } else if (rec->Stream == STREAM_WIN32_DATA || rec->Stream == STREAM_WIN32_GZIP_DATA) {
+ if (!win32_data_msg) {
+ Pmsg0(000, "Got Win32 data or Win32 gzip data stream. Ignored.\n");
+ win32_data_msg++;
}
} else if (!(rec->Stream == STREAM_MD5_SIGNATURE ||
rec->Stream == STREAM_SHA1_SIGNATURE)) {
mjcr->JobBytes += rec->data_len - sizeof(uint64_t); /* No correct, we should expand it */
free_jcr(mjcr); /* done using JCR */
+ /* Win32 Data stream */
+ } else if (rec->Stream == STREAM_WIN32_DATA) {
+ mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
+ if (!mjcr) {
+ if (mr.VolJobs > 0) {
+ Pmsg2(000, _("Could not find Job SessId=%d SessTime=%d for Win32 Data record.\n"),
+ rec->VolSessionId, rec->VolSessionTime);
+ } else {
+ ignored_msgs++;
+ }
+ return;
+ }
+ mjcr->JobBytes += rec->data_len;
+ free_jcr(mjcr); /* done using JCR */
+
+ /* Win32 GZIP stream */
+ } else if (rec->Stream == STREAM_WIN32_GZIP_DATA) {
+ mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
+ if (!mjcr) {
+ if (mr.VolJobs > 0) {
+ Pmsg2(000, _("Could not find Job SessId=%d SessTime=%d for Win32 GZIP Data record.\n"),
+ rec->VolSessionId, rec->VolSessionTime);
+ } else {
+ ignored_msgs++;
+ }
+ return;
+ }
+ mjcr->JobBytes += rec->data_len;
+ free_jcr(mjcr); /* done using JCR */
} else if (rec->Stream == STREAM_MD5_SIGNATURE) {
char MD5buf[50];
return "UATTR";
case STREAM_FILE_DATA:
return "DATA";
+ case STREAM_WIN32_DATA:
+ return "WIN32-DATA";
+ case STREAM_WIN32_GZIP_DATA:
+ return "WIN32-GZIP";
case STREAM_MD5_SIGNATURE:
return "MD5";
case STREAM_SHA1_SIGNATURE:
return "contUATTR";
case -STREAM_FILE_DATA:
return "contDATA";
+ case -STREAM_WIN32_DATA:
+ return "contWIN32-DATA";
+ case -STREAM_WIN32_GZIP_DATA:
+ return "contWIN32-GZIP";
case -STREAM_MD5_SIGNATURE:
return "contMD5";
case -STREAM_SHA1_SIGNATURE: