]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/lib/bsock.h
authorAlain Spineux <alain@baculasystems.com>
Mon, 20 Apr 2020 15:09:52 +0000 (17:09 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:16 +0000 (10:44 +0200)
This commit is the result of the squash of the following main commits:

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Wed Feb 26 09:50:29 2020 +0100

    Use Bacula Systems copyright for bcollector/bsock files

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Wed Feb 26 09:49:29 2020 +0100

    Sync bsock/bcollector copyright with community

Author: Alain Spineux <alain@baculasystems.com>
Date:   Mon Apr 8 17:42:28 2019 +0200

    PSK: modify bnet_tls_(client|server) to pass the shared key via the SSL*

    - instead of the CTX, because for SD <-> FD the auth_key is generated by
       the director

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Wed Mar 20 14:53:33 2019 +0100

    Add FD Calls Director feature to ease client behind NAT access

     - Implement scheduler in Client side to activate the feature
     - Refactor Run resource between the director and the file daemon
     - Allow to use the Director resource to connect a Director for the proxy command and the FDCallsDir
     - Add FDCallsDir state in show client
     - Add code to handle permanent connections bsock_meeting

    New Directive
     FileDaemon:Director:FDCallsDir=<yes/no>
     FileDaemon:Director:FDCallsDirReconnect=<time>
     FileDaemon:Director:FDCallsDirSchedule=<resource>

     Director:Client:FDCallsDir=<yes/no>

    New Resource
     FileDaemon:Schedule

Author: Alain Spineux <alain@baculasystems.com>
Date:   Tue Mar 12 18:21:11 2019 +0100

    PSK: make Bacula's core files related to TLS and authentication ready

    - add PSK code to tls.c
    - modify cram_md5_respond() to support early "STARTLS"
      - the recv() must be done first to see if we get a starttls command
        or if we continue cram-md5the old way
    - skip TLS verification part when PSK is used

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Tue Sep 11 09:35:35 2018 +0200

    Fix warning in bsock.h

bacula/src/lib/bsock.h

index 87248355d5b77faa1f4af0bb002da296f96bde74..5020c96b7ef3a450c53499831b43ffc61fa094a8 100644 (file)
@@ -28,7 +28,7 @@
  *
  * Major refactoring of BSOCK code written by:
  *
- * Radosław Korzeniewski, MMXVIII
+ * Radoslaw Korzeniewski, MMXVIII
  * radoslaw@korzeniewski.net, radekk@inteos.pl
  * Inteos Sp. z o.o. http://www.inteos.pl/
  *
@@ -48,6 +48,9 @@ class BSOCK: public BSOCKCORE {
 public:
    FILE *m_spool_fd;                  /* spooling file */
    POOLMEM *cmsg;                     /* Compress buffer */
+                                      /* tlspsk_XX are not always used */
+   int tlspsk_local;                  /* the "tlspsk=%d" to send via the hello */
+   int tlspsk_remote;                 /* the "tlspsk=%d" received from the hello */
 
 private:
    boffset_t m_data_end;              /* offset of data written */
@@ -70,7 +73,7 @@ public:
    BSOCK();
    BSOCK(int sockfd);
    ~BSOCK();
-  // int32_t recv(int /*len*/) { return recv(); };
+   int32_t recv(int) { return recv(); };
    int32_t recv();
    bool send() { return send(0); };
    bool send(int flags);
@@ -78,8 +81,10 @@ public:
    void close();              /* close connection and destroy packet */
    bool comm_compress();               /* in bsock.c */
    bool despool(void update_attr_spool_size(ssize_t size), ssize_t tsize);
+#if 0
    bool authenticate_director(const char *name, const char *password,
            TLS_CONTEXT *tls_ctx, char *response, int response_len);
+#endif
 
    /* Inline functions */
    bool is_spooling() const { return m_spool; };
@@ -141,7 +146,8 @@ enum {
    BNET_TEXT_INPUT     = -28,         /* Get text input from user */
    BNET_EXT_TERMINATE  = -29,         /* A Terminate condition has been met and
                                          already reported somewhere else */
-   BNET_FDCALLED       = -30          /* The FD should keep the connection for a new job */
+   BNET_FDCALLED       = -30,         /* The FD should keep the connection for a new job */
+   BNET_ISALIVE        = -31          /* Test if the connection is UP */
 };
 
 /*