to what we do with sockets).
- Solaris is untested
- Win32 servers are untested, and very likely not to work.
+- SQLite is no longer supported for Solaris -- it fails too often with
+ bus errors.
The major new features are:
- Much faster insertion of attributes (somewhere around 10 times),
- Novell NSS backup http://www.novell.com/coolsolutions/tools/18952.html
Priority:
+- Look at mincore: http://insights.oetiker.ch/linux/fadvise.html
- Unicode input http://en.wikipedia.org/wiki/Byte_Order_Mark
- How does restore JobId=nnn work? (Dirk)
- What does: restore select fileset="TestSet" client="workplay-fd" pool="Default"
brwlock_t con_lock; /* Console lock structure */
static char *catalog_db = NULL; /* database type */
+static void (*message_callback)(int type, char *msg) = NULL;
const char *host_os = HOST_OS;
const char *distname = DISTNAME;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static MSGS *daemon_msgs; /* global messages */
+void register_message_callback(void msg_callback(int type, char *msg))
+{
+ message_callback = msg_callback;
+}
+
/*
* Set daemon name. Also, find canonical execution
* Resource record. On the second call, generally,
* argv is NULL to avoid doing the path code twice.
*/
-#define BTRACE_EXTRA 20
void my_name_is(int argc, char *argv[], const char *name)
{
char *l, *p, *q;
dt[dtlen] = 0;
}
+ /* If the program registered a callback, send it there */
+ if (message_callback) {
+ message_callback(type, msg);
+ return;
+ }
+
if (type == M_ABORT || type == M_ERROR_TERM) {
fputs(dt, stdout);
fputs(msg, stdout); /* print this here to INSURE that it is printed */
fflush(stdout);
}
+
/* Now figure out where to send the message */
msgs = NULL;
if (jcr) {
pthread_mutex_t mutex;
};
+/*
+ * ***FIXME*** this is a sort of dummy to avoid having to
+ * change all the existing code to pass either a jcr or
+ * a NULL. Passing a NULL causes the messages to be
+ * printed by the daemon -- not very good :-(
+ */
void openssl_post_errors(int code, const char *errstring)
{
openssl_post_errors(NULL, code, errstring);
/* Pop errors off of the per-thread queue */
while((sslerr = ERR_get_error()) != 0) {
/* Acquire the human readable string */
- ERR_error_string_n(sslerr, (char *) &buf, sizeof(buf));
+ ERR_error_string_n(sslerr, buf, sizeof(buf));
Dmsg3(100, "jcr=%p %s: ERR=%s\n", jcr, errstring, buf);
Jmsg2(jcr, M_ERROR, 0, "%s: ERR=%s\n", errstring, buf);
}
* Returns: thread ID
*
*/
-static unsigned long get_openssl_thread_id (void)
+static unsigned long get_openssl_thread_id(void)
{
/* Comparison without use of pthread_equal() is mandated by the OpenSSL API */
- return ((unsigned long) pthread_self());
+ return ((unsigned long)pthread_self());
}
/*
struct CRYPTO_dynlock_value *dynlock;
int stat;
- dynlock = (struct CRYPTO_dynlock_value *) malloc(sizeof(struct CRYPTO_dynlock_value));
+ dynlock = (struct CRYPTO_dynlock_value *)malloc(sizeof(struct CRYPTO_dynlock_value));
if ((stat = pthread_mutex_init(&dynlock->mutex, NULL)) != 0) {
berrno be;
return dynlock;
}
-static void openssl_update_dynamic_mutex (int mode, struct CRYPTO_dynlock_value *dynlock, const char *file, int line)
+static void openssl_update_dynamic_mutex(int mode, struct CRYPTO_dynlock_value *dynlock, const char *file, int line)
{
if (mode & CRYPTO_LOCK) {
P(dynlock->mutex);
}
}
-static void openssl_destroy_dynamic_mutex (struct CRYPTO_dynlock_value *dynlock, const char *file, int line)
+static void openssl_destroy_dynamic_mutex(struct CRYPTO_dynlock_value *dynlock, const char *file, int line)
{
int stat;
void dequeue_messages (JCR *jcr);
void set_trace (int trace_flag);
void set_db_type (const char *name);
+void register_message_callback(void msg_callback(int type, char *msg));
/* bnet_server.c */
void bnet_thread_server(dlist *addr, int max_clients, workq_t *client_wq,
SSL_CTX *openssl;
CRYPTO_PEM_PASSWD_CB *pem_callback;
const void *pem_userdata;
+ bool tls_enable;
+ bool tls_require;
};
struct TLS_Connection {
*/
static int openssl_verify_peer(int ok, X509_STORE_CTX *store)
{
-
if (!ok) {
X509 *cert = X509_STORE_CTX_get_current_cert(store);
int depth = X509_STORE_CTX_get_error_depth(store);
BIO *bio;
DH *dh;
- ctx = (TLS_CONTEXT *) malloc(sizeof(TLS_CONTEXT));
+ ctx = (TLS_CONTEXT *)malloc(sizeof(TLS_CONTEXT));
/* Allocate our OpenSSL TLSv1 Context */
ctx->openssl = SSL_CTX_new(TLSv1_method());
/* Verify Peer Certificate */
if (verify_peer) {
- /* SSL_VERIFY_FAIL_IF_NO_PEER_CERT has no effect in client mode */
- SSL_CTX_set_verify(ctx->openssl,
- SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
- openssl_verify_peer);
+ /* SSL_VERIFY_FAIL_IF_NO_PEER_CERT has no effect in client mode */
+ SSL_CTX_set_verify(ctx->openssl,
+ SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
+ openssl_verify_peer);
}
return ctx;
* Returns: Pointer to TLS_CONNECTION instance on success
* NULL on failure;
*/
-TLS_CONNECTION *new_tls_connection (TLS_CONTEXT *ctx, int fd)
+TLS_CONNECTION *new_tls_connection(TLS_CONTEXT *ctx, int fd)
{
BIO *bio;
BIO_set_fd(bio, fd, BIO_NOCLOSE);
/* Allocate our new tls connection */
- TLS_CONNECTION *tls = (TLS_CONNECTION *) malloc(sizeof(TLS_CONNECTION));
+ TLS_CONNECTION *tls = (TLS_CONNECTION *)malloc(sizeof(TLS_CONNECTION));
/* Create the SSL object and attach the socket BIO */
if ((tls->openssl = SSL_new(ctx->openssl)) == NULL) {
/*
* Free TLS_CONNECTION instance
*/
-void free_tls_connection (TLS_CONNECTION *tls)
+void free_tls_connection(TLS_CONNECTION *tls)
{
SSL_free(tls->openssl);
free(tls);
/*
* Shutdown TLS_CONNECTION instance
*/
-void tls_bsock_shutdown (BSOCK *bsock)
+void tls_bsock_shutdown(BSOCK *bsock)
{
/*
* SSL_shutdown must be called twice to fully complete the process -
* Kern Sibbald, January 2007
*/
+#include <QtGui>
+#include <QtCore>
#include "mainwin.h"
#include "config.h"
#include "bacula.h"
*
*/
-#include <QAbstractEventDispatcher>
+//#include <QAbstractEventDispatcher>
#include "bat.h"
#include "console.h"
#include "restore.h"
m_parent = parent;
m_closeable = false;
m_console = this;
- (void)parent;
setupUi(this);
m_sock = NULL;
sigignore.sa_handler = SIG_IGN;
sigfillset(&sigignore.sa_mask);
sigaction(SIGPIPE, &sigignore, NULL);
+ sigaction(SIGUSR2, &sigignore, NULL);
+
while ((ch = getopt(argc, argv, "bc:d:r:st?")) != -1) {
switch (ch) {
#include "joblist/joblist.h"
#include "clients/clients.h"
+/*
+ * Daemon message callback
+ */
+void message_callback(int /* type */, char *msg)
+{
+ QMessageBox::warning(mainWin, "Bat", msg, QMessageBox::Ok);
+}
+
MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
{
m_dtformat = "yyyy-MM-dd HH:mm:ss";
mainWin = this;
setupUi(this); /* Setup UI defined by main.ui (designer) */
+ register_message_callback(message_callback);
readPreferences();
treeWidget->clear();
treeWidget->setColumnCount(1);
#undef VERSION
#define VERSION "2.1.11"
-#define BDATE "21 May 2007"
-#define LSMDATE "21May07"
+#define BDATE "22 May 2007"
+#define LSMDATE "22May07"
#define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
#define BYEAR "2007" /* year for copyright messages in progs */
Technical notes on version 2.1
General:
+22May07
+kes Implement message callback so that GUI is sure to get all
+ daemon messages. Currently displayed in a dialog in bat.
+kes Ignore SIGUSR2 (Bacula timer) in bat.
+kes Apply regress patch from bug #859 to allow regress to work
+ with Solaris compiler.
21May07
kes Begin adding TLS support to bat.
kes Apply UTF-8/16 patch from Yves Orton <demerphq@gmail.com> to