inline char *first_path_separator(char *path) { return strpbrk(path, "/\\"); }
inline const char *first_path_separator(const char *path) { return strpbrk(path, "/\\"); }
+extern void pause_msg(const char *file, const char *func, int line, const char *msg);
+#define pause(msg) if (debug_level) pause_msg(__FILE__, __func__, __LINE__, (msg))
+
#else
#define PathSeparator '/'
/* Define Winsock functions if we aren't on Windows */
inline bool IsPathSeparator(int ch) { return ch == '/'; }
inline char *first_path_separator(char *path) { return strchr(path, '/'); }
inline const char *first_path_separator(const char *path) { return strchr(path, '/'); }
+#define pause(msg)
#endif
bclose(&rctx.bfd);
}
- /* TODO: manage deleted files */
- if (rctx.type == FT_DELETED) { /* deleted file */
- continue;
- }
+ /* TODO: manage deleted files */
+ if (rctx.type == FT_DELETED) { /* deleted file */
+ continue;
+ }
/*
* Unpack attributes and do sanity check them
* packet length may be re-read by unser_crypto_packet_len() */
cipher_ctx->packet_len = 0;
}
-
return wsize;
}
mode_t old_mask;
bool ok = true;
boffset_t fsize;
-
+
if (uid_set) {
my_uid = getuid();
my_gid = getgid();
POOLMEM *win32_ofile;
// if we have neither ansi nor wchar version, we leave
- if (!(p_SetFileAttributesW || p_SetFileAttributesA))
+ if (!(p_SetFileAttributesW || p_SetFileAttributesA)) {
return false;
+ }
if (!p || !*p) { /* we should have attributes */
Dmsg2(100, "Attributes missing. of=%s ofd=%d\n", attr->ofname, ofd->fid);
}
Dmsg1(100, "SetFileAtts %s\n", attr->ofname);
- if (!(atts.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
- {
+ if (!(atts.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
if (p_SetFileAttributesW) {
- POOLMEM* pwszBuf = get_pool_memory (PM_FNAME);
+ POOLMEM* pwszBuf = get_pool_memory(PM_FNAME);
make_win32_path_UTF8_2_wchar(&pwszBuf, attr->ofname);
BOOL b=p_SetFileAttributesW((LPCWSTR)pwszBuf, atts.dwFileAttributes & SET_ATTRS);
#define fdatasync(fd)
#endif
+#ifdef HAVE_WIN32
+void pause_msg(const char *file, const char *func, int line, const char *msg)
+{
+ char buf[1000];
+ if (msg) {
+ bsnprintf(buf, sizeof(buf), "%s:%s:%d %s", file, func, line, msg);
+ } else {
+ bsnprintf(buf, sizeof(buf), "%s:%s:%d", file, func, line);
+ }
+ MessageBox(NULL, buf, "Pause", MB_OK);
+}
+#endif
/* ===============================================================
*
{
/* convert little endian to big endian */
if (htonl(1) != 1L) { /* no work if on little endian machine */
- memcpy(pBE, &v, sizeof(int64_t));
+ memcpy(pBE, &v, sizeof(int64_t));
} else {
- int i;
- uint8_t rv[sizeof(int64_t)];
- uint8_t *pv = (uint8_t *) &v;
-
- for (i = 0; i < 8; i++) {
- rv[i] = pv[7 - i];
- }
- memcpy(pBE, &rv, sizeof(int64_t));
+ int i;
+ uint8_t rv[sizeof(int64_t)];
+ uint8_t *pv = (uint8_t *) &v;
+
+ for (i = 0; i < 8; i++) {
+ rv[i] = pv[7 - i];
+ }
+ memcpy(pBE, &rv, sizeof(int64_t));
}
}
{
/* convert little endian to big endian */
if (htonl(1) != 1L) { /* no work if on little endian machine */
- memcpy(pBE, &v, sizeof(int32_t));
+ memcpy(pBE, &v, sizeof(int32_t));
} else {
- int i;
- uint8_t rv[sizeof(int32_t)];
- uint8_t *pv = (uint8_t *) &v;
-
- for (i = 0; i < 4; i++) {
- rv[i] = pv[3 - i];
- }
- memcpy(pBE, &rv, sizeof(int32_t));
+ int i;
+ uint8_t rv[sizeof(int32_t)];
+ uint8_t *pv = (uint8_t *) &v;
+
+ for (i = 0; i < 4; i++) {
+ rv[i] = pv[3 - i];
+ }
+ memcpy(pBE, &rv, sizeof(int32_t));
}
}
goto all_done;
}
+ /*
+ * We need to tell the API to release the buffer it
+ * allocated in lpContext. We do so by calling the
+ * API one more time, but with the Abort bit set.
+ */
if (bfd->use_backup_api && bfd->mode == BF_READ) {
BYTE buf[10];
- if (!bfd->lpContext && !p_BackupRead(bfd->fh,
+ if (bfd->lpContext && !p_BackupRead(bfd->fh,
buf, /* buffer */
(DWORD)0, /* bytes to read */
&bfd->rw_bytes, /* bytes read */
}
} else if (bfd->use_backup_api && bfd->mode == BF_WRITE) {
BYTE buf[10];
- if (!bfd->lpContext && !p_BackupWrite(bfd->fh,
+ if (bfd->lpContext && !p_BackupWrite(bfd->fh,
buf, /* buffer */
(DWORD)0, /* bytes to read */
&bfd->rw_bytes, /* bytes written */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-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.
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2003-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2003-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.
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2007-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.
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2007-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.
Technical notes on version 2.3
General:
+18Mar08
+kes Apply doc fix from bug #1062.
+kes Resolve crash and improper restore wx-console Win32 restore
+ GUI. Fixes bug #1065.
+kes Update Win32 wxWidgets to latest version.
+kes Attempt to do correct handling of Win32 mount points. Should
+ fix bug #1046.
+kes Fix Win32 FD backup/restore memory leak due to improper termination
+ of BackupRead/Write. This fixes bug# 1038.
16Mar08
ebl Reduce memory usage for accurate backup, working only with ctime
and mtime. (not all Lstat field)