]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/xattr.h
Add xattr seg fault protection suggested by Marco for bug #1610
[bacula/bacula] / bacula / src / filed / xattr.h
index 8044c42d0a2cff6af942b754456af6b454174a35..ff2587ed9d53e1cc6c4818195d2ac6689004c141 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2009 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.
@@ -26,8 +26,8 @@
    Switzerland, email:ftf@fsfeurope.org.
 */
 
-#ifndef _BACULA_XATTR_
-#define _BACULA_XATTR_
+#ifndef __XATTR_H
+#define __XATTR_H
 
 /*
  * Magic used in the magic field of the xattr struct.
 /*
  * Internal representation of an extended attribute.
  */
-typedef struct xattr {
+struct xattr_t {
    uint32_t magic;
    uint32_t name_length;
    char *name;
    uint32_t value_length;
    char *value;
-} xattr_t;
+};
+
+/*
+ * Internal representation of an extended attribute hardlinked file.
+ */
+struct xattr_link_cache_entry_t {
+   uint32_t inum;
+   char target[PATH_MAX];
+};
+
+/*
+ * Internal tracking data.
+ */
+struct xattr_data_t {
+   POOLMEM *content;
+   uint32_t content_length;
+   uint32_t nr_errors;
+   uint32_t nr_saved;
+   alist *link_cache;
+};
+
+/*
+ * Maximum size of the XATTR stream this prevents us from blowing up the filed.
+ */
+#define MAX_XATTR_STREAM  (1 * 1024 * 1024) /* 1 Mb */
+
+/*
+ * Upperlimit on a xattr internal buffer
+ */
+#define XATTR_BUFSIZ   1024
 
 #endif