]> git.sur5r.net Git - bacula/bacula/commitdiff
Merge branch 'master' into mvw/plugin-changes
authorMarco van Wieringen <mvw@planets.elm.net>
Sun, 27 Dec 2009 14:59:42 +0000 (15:59 +0100)
committerMarco van Wieringen <mvw@planets.elm.net>
Sun, 27 Dec 2009 14:59:42 +0000 (15:59 +0100)
bacula/LICENSE
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/src/baconfig.h
bacula/src/filed/xattr.c
bacula/src/filed/xattr.h

index c1ec1a3897421814f5e48dee953a1157f14fef95..f8ffd5b0a4bf3c9d6591e4bce07dbae7c03872f6 100644 (file)
@@ -11,7 +11,7 @@ The name Bacula is a registered trademark of Kern Sibbald.
 ===================================
 
 License:
-For the most part, Bacula is licensed under the GPL version 2 this
+For the most part, Bacula is licensed under the GPL version 2. This
 code is listed under Copyright Free Software Foundation Europe e.V.
 What follows is the addition(s) to the GPL version 2 license, that
 applies to code that is copyrighted by the Free Software Foundation
index 4224448f3d302de2e34d6603579bae800d7b3724..f773e60802f1668bc99978e3a5d2406458d81020 100644 (file)
    declares uintmax_t. */
 #undef HAVE_INTTYPES_H_WITH_UINTMAX
 
+/* Set if ioctl request is unsigned long int */
+#undef HAVE_IOCTL_ULINT_REQUEST
+
 /* Whether to enable IPv6 support */
 #undef HAVE_IPV6
 
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
+/* Set if socklen_t exists */
+#undef HAVE_SOCKLEN_T
+
 /* Define to 1 if you have the <stdarg.h> header file. */
 #undef HAVE_STDARG_H
 
index a81aa4617e5d619e4d5ddb236e177e282cdd7eb8..3b71cbf3e281c3caa2fdb63045d67b6252ca436c 100644 (file)
@@ -1900,7 +1900,31 @@ AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
        )
    ]
 )
-test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
+test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
+
+dnl --------------------------------------------------------------------------
+dnl Check for ioctl request type
+dnl --------------------------------------------------------------------------
+AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
+   [
+       AC_TRY_COMPILE(
+         [
+             #include <sys/types.h>
+             #include <sys/ioctl.h>
+         ], [
+             unsigned long int req;
+             int fd;
+             ioctl(fd, req);
+         ], [
+            ba_cv_header_ioctl_req_t=yes
+         ], [
+            ba_cv_header_ioct_req_t_t=no
+         ]
+       )
+   ]
+)
+test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
+
 
 dnl --------------------------------------------------------------------------
 dnl Check for typeof()
index 657830a09c467eb75e7c8b0224fbed81281f8634..f1f2f71ef5687f10639f630688260891b1138883 100644 (file)
 #define ETIME ETIMEDOUT
 #endif
 
-#define ioctl_req_t long unsigned int
+#ifdef HAVE_IOCTL_ULINT_REQUEST
+#define ioctl_req_t unsigned long int
+#else
+#define ioctl_req_t int
+#endif
 
 #ifdef PROTOTYPES
 # define __PROTO(p)     p
@@ -655,16 +659,9 @@ int  m_msg(const char *file, int line, POOLMEM *&pool_buf, const char *fmt, ...)
 /* take this 'shortcut' */
 #define fseeko fseek
 #define ftello ftell
-#undef  ioctl_req_t
-#define ioctl_req_t int
 #endif
 
 
-#ifdef HAVE_OSF1_OS
-#undef  ioctl_req_t
-#define ioctl_req_t int
-#endif
-
 #ifdef HAVE_SUN_OS
    /*
     * On Solaris 2.5, threads are not timesliced by default, so we need to
@@ -674,8 +671,6 @@ int  m_msg(const char *file, int line, POOLMEM *&pool_buf, const char *fmt, ...)
 #define set_thread_concurrency(x)  thr_setconcurrency(x)
 extern int thr_setconcurrency(int);
 #define SunOS 1
-#undef  ioctl_req_t
-#define ioctl_req_t int
 
 #else
 
@@ -729,17 +724,13 @@ extern int h_errno;
  */
 extern "C" int getdomainname(char *name, int namelen);
 extern "C" int setdomainname(char *name, int namelen);
-#undef  ioctl_req_t
-#define ioctl_req_t int
 #endif /* HAVE_HPUX_OS */
 
 
 #ifdef HAVE_OSF1_OS
 extern "C" int fchdir(int filedes);
 extern "C" long gethostid(void);
-extern "C" int mknod ( const char *path, int mode, dev_t device );
-#undef  ioctl_req_t
-#define ioctl_req_t int
+extern "C" int mknod(const char *path, int mode, dev_t device );
 #endif
 
 
index 6a839d201bd211aef99277f6f946b624706a2687..6227fd3b84c86ef159abec52da7a38c4ee3a7c26 100644 (file)
@@ -145,6 +145,8 @@ static void xattr_drop_internal_table(alist *xattr_value_list)
 
       if (current_xattr->value_length > 0)
          free(current_xattr->value);
+
+      free(current_xattr);
    }
 
    delete xattr_value_list;
@@ -649,7 +651,7 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt)
    unsigned int namespace_index;
    int attrnamespace;
    char *current_attrnamespace = NULL;
-   char current_attrname[BUFSIZ], current_attrtuple[BUFSIZ];
+   char current_attrname[XATTR_BUFSIZ], current_attrtuple[XATTR_BUFSIZ];
    xattr_t *current_xattr;
    alist *xattr_value_list = NULL;
    bxattr_exit_code retval = bxattr_exit_error;
@@ -1382,7 +1384,7 @@ static bxattr_exit_code solaris_save_xattr(JCR *jcr, int fd, const char *xattr_n
    char link_source[PATH_MAX];
    char *acl_text = NULL;
    char attribs[MAXSTRING];
-   char buffer[BUFSIZ];
+   char buffer[XATTR_BUFSIZ];
    bxattr_exit_code retval = bxattr_exit_error;
    berrno be;
 
index 329c32dec0a1995fba9e2ccf27bdb905d3c53bb5..ff2587ed9d53e1cc6c4818195d2ac6689004c141 100644 (file)
@@ -70,4 +70,9 @@ struct xattr_data_t {
  */
 #define MAX_XATTR_STREAM  (1 * 1024 * 1024) /* 1 Mb */
 
+/*
+ * Upperlimit on a xattr internal buffer
+ */
+#define XATTR_BUFSIZ   1024
+
 #endif