]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/jcr.h
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / jcr.h
index d37a31f0fe6b523bf4d756bdb9867797bf3d2205..405632676ad27f8d886f2fe58b14b4864acdb837 100644 (file)
@@ -1,8 +1,7 @@
 /*
    Bacula(R) - The Network Backup Solution
 
 /*
    Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2000-2015 Kern Sibbald
-   Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2017 Kern Sibbald
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
@@ -12,7 +11,7 @@
    Public License, v3.0 ("AGPLv3") and some additional permissions and
    terms pursuant to its AGPLv3 Section 7.
 
    Public License, v3.0 ("AGPLv3") and some additional permissions and
    terms pursuant to its AGPLv3 Section 7.
 
-   This notice must be preserved when any source code is 
+   This notice must be preserved when any source code is
    conveyed and/or propagated.
 
    Bacula(R) is a registered trademark of Kern Sibbald.
    conveyed and/or propagated.
 
    Bacula(R) is a registered trademark of Kern Sibbald.
@@ -59,6 +58,9 @@
 #define JT_MIGRATE               'g'  /* Migration Job */
 #define JT_SCAN                  'S'  /* Scan Job */
 
 #define JT_MIGRATE               'g'  /* Migration Job */
 #define JT_SCAN                  'S'  /* Scan Job */
 
+/* Used to handle ClientAcl in various commands, not stored in the DB */
+#define JT_BACKUP_RESTORE        '*'  /* Backup or Restore Job */
+
 /* Job Status. Some of these are stored in the DB */
 #define JS_Canceled              'A'  /* canceled by user */
 #define JS_Blocked               'B'  /* blocked */
 /* Job Status. Some of these are stored in the DB */
 #define JS_Canceled              'A'  /* canceled by user */
 #define JS_Blocked               'B'  /* blocked */
 #define JS_WaitDevice            'q'  /* Queued waiting for device */
 #define JS_WaitStoreRes          's'  /* Waiting for storage resource */
 #define JS_WaitStartTime         't'  /* Waiting for start time */
 #define JS_WaitDevice            'q'  /* Queued waiting for device */
 #define JS_WaitStoreRes          's'  /* Waiting for storage resource */
 #define JS_WaitStartTime         't'  /* Waiting for start time */
+#define JS_CloudUpload           'u'  /* Cloud upload */
+#define JS_CloudDownload         'w'  /* Cloud download */
 
 
-
-/* Migration selection types */
+/* Migration selection types. Do not change the order. */
 enum {
    MT_SMALLEST_VOL = 1,
    MT_OLDEST_VOL,
 enum {
    MT_SMALLEST_VOL = 1,
    MT_OLDEST_VOL,
@@ -110,18 +113,20 @@ enum {
 
 #define job_waiting(jcr) \
  (jcr->job_started &&    \
 
 #define job_waiting(jcr) \
  (jcr->job_started &&    \
-  (jcr->JobStatus == JS_WaitFD       || \
-   jcr->JobStatus == JS_WaitSD       || \
-   jcr->JobStatus == JS_WaitMedia    || \
-   jcr->JobStatus == JS_WaitMount    || \
-   jcr->JobStatus == JS_WaitStoreRes || \
-   jcr->JobStatus == JS_WaitJobRes   || \
-   jcr->JobStatus == JS_WaitClientRes|| \
-   jcr->JobStatus == JS_WaitMaxJobs  || \
-   jcr->JobStatus == JS_WaitPriority || \
-   jcr->SDJobStatus == JS_WaitMedia  || \
-   jcr->SDJobStatus == JS_WaitMount  || \
-   jcr->SDJobStatus == JS_WaitDevice || \
+  (jcr->JobStatus == JS_WaitFD          || \
+   jcr->JobStatus == JS_WaitSD          || \
+   jcr->JobStatus == JS_WaitMedia       || \
+   jcr->JobStatus == JS_WaitMount       || \
+   jcr->JobStatus == JS_WaitStoreRes    || \
+   jcr->JobStatus == JS_WaitJobRes      || \
+   jcr->JobStatus == JS_WaitClientRes   || \
+   jcr->JobStatus == JS_WaitMaxJobs     || \
+   jcr->JobStatus == JS_WaitPriority    || \
+   jcr->SDJobStatus == JS_WaitMedia     || \
+   jcr->SDJobStatus == JS_WaitMount     || \
+   jcr->SDJobStatus == JS_WaitDevice    || \
+   jcr->SDJobStatus == JS_CloudUpload   || \
+   jcr->SDJobStatus == JS_CloudDownload || \
    jcr->SDJobStatus == JS_WaitMaxJobs))
 
 
    jcr->SDJobStatus == JS_WaitMaxJobs))
 
 
@@ -146,9 +151,10 @@ struct bpContext;
 
 
 #ifdef FILE_DAEMON
 
 
 #ifdef FILE_DAEMON
+class VSSClient;
 class htable;
 class htable;
-struct acl_ctx_t;
-struct xattr_ctx_t;
+class BACL;
+class BXATTR;
 class snapshot_manager;
 
 struct CRYPTO_CTX {
 class snapshot_manager;
 
 struct CRYPTO_CTX {
@@ -209,6 +215,7 @@ public:
    bool no_client_used() const {
       return (m_JobLevel == L_VIRTUAL_FULL);
    };
    bool no_client_used() const {
       return (m_JobLevel == L_VIRTUAL_FULL);
    };
+   bool can_be_stopped();                 /* in lib/jcr.c */
    const char *get_OperationName();       /* in lib/jcr.c */
    const char *get_ActionName(bool past); /* in lib/jcr.c */
    void setJobStatus(int JobStatus);      /* in lib/jcr.c */
    const char *get_OperationName();       /* in lib/jcr.c */
    const char *get_ActionName(bool past); /* in lib/jcr.c */
    void setJobStatus(int JobStatus);      /* in lib/jcr.c */
@@ -307,7 +314,10 @@ public:
    POOLMEM *comment;                  /* Comment for this Job */
    int64_t max_bandwidth;             /* Bandwidth limit for this Job */
    htable *path_list;                 /* Directory list (used by findlib) */
    POOLMEM *comment;                  /* Comment for this Job */
    int64_t max_bandwidth;             /* Bandwidth limit for this Job */
    htable *path_list;                 /* Directory list (used by findlib) */
-
+   int     job_uid;                   /* UID used during job session */
+   char   *job_user;                  /* Specific permission for a job */
+   char   *job_group;                 /* Specific permission for a job */
+   POOLMEM *StatusErrMsg;             /* Error message displayed in the job report */
    uint32_t getErrors() { return JobErrors + SDErrors; }; /* Get error count */
 
    /* Daemon specific part of JCR */
    uint32_t getErrors() { return JobErrors + SDErrors; }; /* Get error count */
 
    /* Daemon specific part of JCR */
@@ -369,6 +379,7 @@ public:
    POOLMEM *wstore_source;            /* Where write storage came from */
    POOLMEM *catalog_source;           /* Where catalog came from */
    POOLMEM *next_vol_list;            /* Volumes previously requested */
    POOLMEM *wstore_source;            /* Where write storage came from */
    POOLMEM *catalog_source;           /* Where catalog came from */
    POOLMEM *next_vol_list;            /* Volumes previously requested */
+   rblist  *bsr_list;                 /* Bootstrap that can be needed during restore */
    int32_t replace;                   /* Replace option */
    int32_t NumVols;                   /* Number of Volume used in pool */
    int32_t reschedule_count;          /* Number of times rescheduled */
    int32_t replace;                   /* Replace option */
    int32_t NumVols;                   /* Number of Volume used in pool */
    int32_t reschedule_count;          /* Number of times rescheduled */
@@ -404,6 +415,7 @@ public:
    bool RescheduleIncompleteJobs;     /* set if incomplete can be rescheduled */
    bool use_all_JobIds;               /* Use all jobids present in command line */
    bool sd_client;                    /* This job runs as SD client */
    bool RescheduleIncompleteJobs;     /* set if incomplete can be rescheduled */
    bool use_all_JobIds;               /* Use all jobids present in command line */
    bool sd_client;                    /* This job runs as SD client */
+   bool dummy_jobmedia;               /* Dummy JobMedia written */
 #endif /* DIRECTOR_DAEMON */
 
 
 #endif /* DIRECTOR_DAEMON */
 
 
@@ -414,8 +426,8 @@ public:
    POOLMEM *last_fname;               /* last file saved/verified */
    POOLMEM *job_metadata;             /* VSS job metadata */
    pthread_cond_t job_start_wait;     /* Wait for SD to start Job */
    POOLMEM *last_fname;               /* last file saved/verified */
    POOLMEM *job_metadata;             /* VSS job metadata */
    pthread_cond_t job_start_wait;     /* Wait for SD to start Job */
-   acl_ctx_t *acl_ctx;                /* ACLs for backup/restore */
-   xattr_ctx_t *xattr_ctx;            /* Extended Attributes for backup/restore */
+   BACL *bacl;                        /* ACLs for backup/restore */
+   BXATTR *bxattr;                    /* Extended Attributes for backup/restore */
    int32_t last_type;                 /* type of last file saved/verified */
    int incremental;                   /* set if incremental for SINCE */
    time_t last_stat_time;             /* Last time stats sent to Dir */
    int32_t last_type;                 /* type of last file saved/verified */
    int incremental;                   /* set if incremental for SINCE */
    time_t last_stat_time;             /* Last time stats sent to Dir */
@@ -453,6 +465,7 @@ public:
    uint64_t base_size;                /* compute space saved with base job */
    utime_t snapshot_retention;        /* Snapshot retention (from director) */
    snapshot_manager *snap_mgr;        /* Snapshot manager */
    uint64_t base_size;                /* compute space saved with base job */
    utime_t snapshot_retention;        /* Snapshot retention (from director) */
    snapshot_manager *snap_mgr;        /* Snapshot manager */
+   VSSClient *pVSSClient;             /* VSS handler */
 #endif /* FILE_DAEMON */
 
 
 #endif /* FILE_DAEMON */
 
 
@@ -499,6 +512,7 @@ public:
    bool Resched;                      /* Job may be rescheduled */
    bool bscan_insert_jobmedia_records; /*Bscan: needs to insert job media records */
    bool sd_client;                    /* Set if acting as client */
    bool Resched;                      /* Job may be rescheduled */
    bool bscan_insert_jobmedia_records; /*Bscan: needs to insert job media records */
    bool sd_client;                    /* Set if acting as client */
+   bool use_new_match_all;            /* TODO: Remove when the match_bsr() will be well tested */
 
    /* Parmaters for Open Read Session */
    BSR *bsr;                          /* Bootstrap record -- has everything */
 
    /* Parmaters for Open Read Session */
    BSR *bsr;                          /* Bootstrap record -- has everything */