]> git.sur5r.net Git - bacula/bacula/commitdiff
- Make authentication timeout compile time configurable.
authorKern Sibbald <kern@sibbald.com>
Sun, 21 Nov 2004 17:53:03 +0000 (17:53 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 21 Nov 2004 17:53:03 +0000 (17:53 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1713 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/authenticate.c
bacula/src/filed/authenticate.c
bacula/src/lib/tree.c
bacula/src/stored/authenticate.c
bacula/src/version.h

index 2b6762d9552a8382af1f3d0b022101d530a56a23..733177f1fee6e1dfe5908090d52235a8d4def135 100644 (file)
@@ -65,7 +65,7 @@ bool authenticate_storage_daemon(JCR *jcr, STORE *store)
    bstrncpy(dirname, director->hdr.name, sizeof(dirname));
    bash_spaces(dirname);
    /* Timeout Hello after 1 min */
-   btimer_t *tid = start_bsock_timer(sd, 60 * 10);
+   btimer_t *tid = start_bsock_timer(sd, AUTH_TIMEOUT);
    if (!bnet_fsend(sd, hello, dirname)) {
       stop_bsock_timer(tid);
       Dmsg1(50, _("Error sending Hello to Storage daemon. ERR=%s\n"), bnet_strerror(sd));
@@ -121,7 +121,7 @@ int authenticate_file_daemon(JCR *jcr)
    bstrncpy(dirname, director->hdr.name, sizeof(dirname));
    bash_spaces(dirname);
    /* Timeout Hello after 10 mins */
-   btimer_t *tid = start_bsock_timer(fd, 60 * 10);
+   btimer_t *tid = start_bsock_timer(fd, AUTH_TIMEOUT);
    if (!bnet_fsend(fd, hello, dirname)) {
       stop_bsock_timer(tid);
       Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to File daemon. ERR=%s\n"), bnet_strerror(fd));
index b8f123431de5c3f9d88440c33b50eb14e01e55c2..d0ad7ab74e25ba1166dd65381e6785bb72994a96 100644 (file)
@@ -83,7 +83,7 @@ static int authenticate(int rcode, BSOCK *bs, JCR* jcr)
       free_pool_memory(dirname);
       return 0;
    }
-   btimer_t *tid = start_bsock_timer(bs, 60 * 10);
+   btimer_t *tid = start_bsock_timer(bs, AUTH_TIMEOUT);
    auth = cram_md5_auth(bs, director->password, ssl_need);  
    if (auth) {
       get_auth = cram_md5_get_auth(bs, director->password, ssl_need);  
@@ -136,7 +136,7 @@ int authenticate_storagedaemon(JCR *jcr)
    int ssl_need = BNET_SSL_NONE;
    bool get_auth, auth = false;
 
-   btimer_t *tid = start_bsock_timer(sd, 60 * 10);
+   btimer_t *tid = start_bsock_timer(sd, AUTH_TIMEOUT);
    get_auth = cram_md5_get_auth(sd, jcr->sd_auth_key, ssl_need);  
    if (!get_auth) {
       Dmsg1(50, "cram_get_auth failed for %s\n", sd->who);
index ced63a245446301123bd426337255d51b55ef015..e6ef465eb199b273711383aa951be35aa7923486 100755 (executable)
@@ -87,6 +87,7 @@ TREE_ROOT *new_tree(int count)
    }
    Dmsg2(400, "count=%d size=%d\n", count, size);
    malloc_buf(root, size);
+   root->cached_path_len = -1;
    root->cached_path = get_pool_memory(PM_FNAME);
    root->type = TN_ROOT;
    root->fname = "";
index 4aaadadf2095e99126a7cdaa49c88494f3902563..b053dcb93f2a89f22fcf33b591b760b93252ad59 100644 (file)
@@ -86,7 +86,7 @@ static int authenticate(int rcode, BSOCK *bs, JCR* jcr)
    }
 
    /* Timeout Hello after 10 mins */
-   btimer_t *tid = start_bsock_timer(bs, 60 * 10);
+   btimer_t *tid = start_bsock_timer(bs, AUTH_TIMEOUT);
    auth = cram_md5_auth(bs, director->password, ssl_need);
    if (auth) {
       get_auth = cram_md5_get_auth(bs, director->password, ssl_need);
@@ -142,7 +142,7 @@ int authenticate_filed(JCR *jcr)
    bool auth, get_auth = false;
 
    /* Timeout Hello after 5 mins */
-   btimer_t *tid = start_bsock_timer(fd, 60 * 10);
+   btimer_t *tid = start_bsock_timer(fd, AUTH_TIMEOUT);
    auth = cram_md5_auth(fd, jcr->sd_auth_key, ssl_need);
    if (auth) {
        get_auth = cram_md5_get_auth(fd, jcr->sd_auth_key, ssl_need);
index 6dd499059c1454d24314f21c0a7d4523cae87293..58a9cc9b05ae344da3ef8ebf86a90e0e9d825736 100644 (file)
 #define TRACEBACK 1
 #define SMCHECK     
 #define TRACE_FILE 1  
+
+/* If this is set stdout will not be closed on startup */
 #define DEVELOPER 1
 
 
+/*
+ * Set to time limit for other end to respond to
+ *  authentication.  Normally 10 minutes is *way*
+ *  more than enough.
+ */
+#define AUTH_TIMEOUT 60 * 1000
+
 /* Debug flags not normally turned on */
 
 /* #define TRACE_JCR_CHAIN 1 */
 /* #define TRACE_RES 1 */
 /* #define DEBUG_MEMSET 1 */
+
+/* Check if header of tape block is zero before writing */
 #define DEBUG_BLOCK_ZEROING 1
 
 /* #define FULL_DEBUG 1 */   /* normally on for testing only */