[gvfs] Require libsmbclient from Samba 3.4.0 or higher



commit ad521f604df7aad2dacf993942b257e93fda203b
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Thu Oct 17 09:21:48 2013 +0200

    Require libsmbclient from Samba 3.4.0 or higher
    
    Also remove the old libsmb-compat.h header file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=573837

 configure.ac                  |   19 +---
 daemon/gvfsbackendsmb.c       |    8 +--
 daemon/gvfsbackendsmbbrowse.c |    1 -
 daemon/libsmb-compat.h        |  200 -----------------------------------------
 4 files changed, 6 insertions(+), 222 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7cd23a6..5923b1d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -583,15 +583,6 @@ if test "x$enable_samba" != "xno"; then
                else
                        SAMBA_CFLAGS=""
                fi
-               
-               CPPFLAGS="$CPPFLAGS $with_samba_includes"
-               AC_CHECK_MEMBER(SMBCCTX.flags,
-                               [AC_DEFINE(HAVE_SAMBA_FLAGS,, [Defined if flags available in SMBCCTXT])],,
-                               [#include <libsmbclient.h>])
-               AC_CHECK_MEMBER(SMBCCTX.close,
-                               [AC_DEFINE(HAVE_SAMBA_OLD_CLOSE, , [Defined if old close is available in 
SMBCCTXT])],,
-                               [#include <libsmbclient.h>])
-               CPPFLAGS="$CPPFLAGS_save"
        else
                SAMBA_CFLAGS=""
        fi
@@ -602,28 +593,26 @@ if test "x$enable_samba" != "xno"; then
        LDFLAGS_save="$LDFLAGS"
        
        LDFLAGS="$LDFLAGS -L$with_samba_libs"
-       AC_CHECK_LIB(smbclient, smbc_option_get,samba_libs="yes", samba_libs="no")
+       AC_CHECK_LIB(smbclient, smbc_getFunctionStatVFS,samba_libs="yes", samba_libs="no")
        LDFLAGS="$LDFLAGS_save"
        if test "x${samba_libs}" != "xno"; then
-               AC_DEFINE(HAVE_SAMBA,, [Define to 1 if you have the samba 3.0 libraries])
+               AC_DEFINE(HAVE_SAMBA,, [Define to 1 if you have the samba libraries])
                msg_samba="yes"
                 if test x$with_samba_libs != x/usr/lib; then
                         SAMBA_LIBS="-L$with_samba_libs -lsmbclient"
                 else
                        SAMBA_LIBS="-lsmbclient"
                 fi
-                AC_CHECK_LIB(smbclient, smbc_getFunctionStatVFS, 
-                        AC_DEFINE(HAVE_SAMBA_STAT_VFS, , [Define to 1 if smbclient supports smbc_stat_fn]))
        else
                AC_CHECK_LIB(smbclient, smbc_new_context,samba_old_libs="yes", samba_old_libs="no")
                if test "x${samba_old_libs}" != "xno"; then
-                  msg_samba="Too old, need at least samba 3.0.22"
+                  msg_samba="Too old, need at least samba 3.4.0"
                fi
                SAMBA_CFLAGS=""
                SAMBA_LIBS=""
        fi
   fi
-  AC_MSG_CHECKING(for Samba 3.0 libraries)
+  AC_MSG_CHECKING(for Samba libraries)
   AC_MSG_RESULT($msg_samba)
 fi
 AM_CONDITIONAL(HAVE_SAMBA, test "$msg_samba" = "yes")
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index d24d00e..8a3fa8d 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -51,7 +51,6 @@
 #include "gvfskeyring.h"
 
 #include <libsmbclient.h>
-#include "libsmb-compat.h"
 
 
 #define PRINT_DEBUG
@@ -1709,15 +1708,13 @@ do_query_fs_info (GVfsBackend *backend,
                  GFileAttributeMatcher *attribute_matcher)
 {
   GVfsBackendSmb *op_backend = G_VFS_BACKEND_SMB (backend);
-
-  g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "cifs");
-
-#ifdef HAVE_SAMBA_STAT_VFS
   smbc_statvfs_fn smbc_statvfs;
   struct statvfs st = {0};
   char *uri;
   int res, saved_errno;
 
+  g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "cifs");
+
   if (g_file_attribute_matcher_matches (attribute_matcher,
                                        G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
       g_file_attribute_matcher_matches (attribute_matcher,
@@ -1757,7 +1754,6 @@ do_query_fs_info (GVfsBackend *backend,
           return;
         }
     }
-#endif
 
   g_vfs_job_succeeded (G_VFS_JOB (job));
 }
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 2fd0db4..1b4cf9e 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -46,7 +46,6 @@
 #include "gmounttracker.h"
 
 #include <libsmbclient.h>
-#include "libsmb-compat.h"
 
 /* The magic "default workgroup" hostname */
 #define DEFAULT_WORKGROUP_NAME "X-GNOME-DEFAULT-WORKGROUP"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]