[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2638-g5f6b301

Derrell Lipman derrell at samba.org
Fri May 30 14:40:18 GMT 2008


The branch, v3-3-test has been updated
       via  5f6b301f92e9e9d5ee1dab9ef8eca2cc77e12941 (commit)
       via  e4060ad864ec9d4e9092a832c3c664ee31b6125a (commit)
      from  3b31f8cce3703645a57778bc752bc9b9e853df5d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 5f6b301f92e9e9d5ee1dab9ef8eca2cc77e12941
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Fri May 30 10:38:35 2008 -0400

    Working on bug #5475
    
    - Add code to test whether smbc_stat() munges future smbc_getxattr() results.
    
    Derrell

commit e4060ad864ec9d4e9092a832c3c664ee31b6125a
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Fri May 30 10:24:55 2008 -0400

    Update libsmbclient examples to match new libraries
    
    - talloc and tdb have been moved to separate libraries.  Link with those.
    
    Derrell

-----------------------------------------------------------------------

Summary of changes:
 examples/libsmbclient/Makefile            |    2 +-
 examples/libsmbclient/smbwrapper/Makefile |    2 +-
 examples/libsmbclient/testacl.c           |   48 ++++++++++++++++++++--------
 3 files changed, 36 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/libsmbclient/Makefile b/examples/libsmbclient/Makefile
index a50e80a..7415f4f 100644
--- a/examples/libsmbclient/Makefile
+++ b/examples/libsmbclient/Makefile
@@ -13,7 +13,7 @@ CFLAGS = -O0 -g $(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS)
 LDFLAGS = -L/usr/local/samba/lib \
 	  -lldap -lkrb5 -lgssapi_krb5
 #LIBSMBCLIENT = /usr/local/samba/lib/libsmbclient.so
-LIBSMBCLIENT = -lwbclient -lsmbclient -ldl -lresolv
+LIBSMBCLIENT = -lwbclient -lsmbclient -ltalloc -ltdb -ldl -lresolv
 
 TESTS=	testsmbc \
 	testacl \
diff --git a/examples/libsmbclient/smbwrapper/Makefile b/examples/libsmbclient/smbwrapper/Makefile
index 7264353..7f5c17c 100644
--- a/examples/libsmbclient/smbwrapper/Makefile
+++ b/examples/libsmbclient/smbwrapper/Makefile
@@ -1,4 +1,4 @@
-LIBS = -lwbclient -lsmbclient -ldl
+LIBS = -lwbclient -lsmbclient -ltalloc -ltdb -ldl
 DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
 CFLAGS = -I$(SAMBA_INCL) $(EXTLIB_INCL)
diff --git a/examples/libsmbclient/testacl.c b/examples/libsmbclient/testacl.c
index 00e1c2c..a57dd4a 100644
--- a/examples/libsmbclient/testacl.c
+++ b/examples/libsmbclient/testacl.c
@@ -24,6 +24,7 @@ int main(int argc, const char *argv[])
     int flags;
     int debug = 0;
     int numeric = 0;
+    int stat_and_retry = 0;
     int full_time_names = 0;
     enum acl_mode mode = SMB_ACL_LIST;
     static char *the_acl = NULL;
@@ -33,6 +34,7 @@ int main(int argc, const char *argv[])
     char path[1024];
     char value[1024];
     poptContext pc;
+    struct stat st;
     struct poptOption long_options[] =
         {
             POPT_AUTOHELP
@@ -78,6 +80,10 @@ int main(int argc, const char *argv[])
                 'g', "Get a specific acl attribute", "ACL"
             },
             {
+                "stat_and_retry", 'R', POPT_ARG_NONE, &stat_and_retry,
+                1, "After 'get' do 'stat' and another 'get'"
+            },
+            {
                 NULL
             }
         };
@@ -175,26 +181,40 @@ int main(int argc, const char *argv[])
         break;
 
     case SMB_ACL_GET:
-        if (the_acl == NULL)
+        do
         {
-            if (numeric)
+            if (the_acl == NULL)
             {
-                the_acl = "system.*";
+                if (numeric)
+                {
+                    the_acl = "system.*";
+                }
+                else
+                {
+                    the_acl = "system.*+";
+                }
             }
-            else
+            ret = smbc_getxattr(path, the_acl, value, sizeof(value));
+            if (ret < 0)
             {
-                the_acl = "system.*+";
+                printf("Could not get attributes for [%s] %d: %s\n",
+                       path, errno, strerror(errno));
+                return 1;
             }
-        }
-        ret = smbc_getxattr(path, the_acl, value, sizeof(value));
-        if (ret < 0)
-        {
-            printf("Could not get attributes for [%s] %d: %s\n",
-                   path, errno, strerror(errno));
-            return 1;
-        }
         
-        printf("Attributes for [%s] are:\n%s\n", path, value);
+            printf("Attributes for [%s] are:\n%s\n", path, value);
+
+            if (stat_and_retry)
+            {
+                if (smbc_stat(path, &st) < 0)
+                {
+                    perror("smbc_stat");
+                    return 1;
+                }
+            }
+
+            --stat_and_retry;
+        } while (stat_and_retry >= 0);
         break;
 
     case SMB_ACL_ADD:


-- 
Samba Shared Repository


More information about the samba-cvs mailing list