svn commit: samba r22915 - in branches/SAMBA_3_0_25: examples/libsmbclient source/libsmb

derrell at samba.org derrell at samba.org
Tue May 15 19:14:34 GMT 2007


Author: derrell
Date: 2007-05-15 19:14:34 +0000 (Tue, 15 May 2007)
New Revision: 22915

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22915

Log:

- Fixes bug 4599.  A missing <code>if</code> statement forced subseqeuent
  attempts to set attributes to fail.

- I also noticed that missing attributes were setting an invalid return string
  by getxattr(), e.g. if there was not group, the return string had "GROUP:;"
  instead of excluding the GROUP attribute entirely as it should.  The big
  problem with the way it was, is that the string could not then be passed to
  setxattr() and parsed.

Modified:
   branches/SAMBA_3_0_25/examples/libsmbclient/Makefile
   branches/SAMBA_3_0_25/source/libsmb/libsmbclient.c


Changeset:
Modified: branches/SAMBA_3_0_25/examples/libsmbclient/Makefile
===================================================================
--- branches/SAMBA_3_0_25/examples/libsmbclient/Makefile	2007-05-15 19:10:29 UTC (rev 22914)
+++ branches/SAMBA_3_0_25/examples/libsmbclient/Makefile	2007-05-15 19:14:34 UTC (rev 22915)
@@ -17,6 +17,7 @@
 TESTS=	testsmbc \
 	tree \
 	testacl \
+	testacl2 \
 	testbrowse \
 	testbrowse2 \
 	teststat \
@@ -39,6 +40,10 @@
 	@echo Linking testacl
 	$(CC) `gtk-config --cflags` $(CFLAGS) $(LDFLAGS) -o $@ $< `gtk-config --libs` $(LIBSMBCLIENT) -lpopt
 
+testacl2: testacl2.o
+	@echo Linking testacl2
+	$(CC) `gtk-config --cflags` $(CFLAGS) $(LDFLAGS) -o $@ $< `gtk-config --libs` $(LIBSMBCLIENT) -lpopt
+
 testbrowse: testbrowse.o
 	@echo Linking testbrowse
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt

Modified: branches/SAMBA_3_0_25/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0_25/source/libsmb/libsmbclient.c	2007-05-15 19:10:29 UTC (rev 22914)
+++ branches/SAMBA_3_0_25/source/libsmb/libsmbclient.c	2007-05-15 19:14:34 UTC (rev 22915)
@@ -4556,7 +4556,7 @@
                                                 return -1;
                                         }
                                         n = strlen(p);
-                                } else {
+                                } else if (sidstr[0] != '\0') {
                                         n = snprintf(buf, bufsize,
                                                      ",OWNER:%s", sidstr);
                                 }
@@ -4601,7 +4601,7 @@
                                                 return -1;
                                         }
                                         n = strlen(p);
-                                } else {
+                                } else if (sidstr[0] != '\0') {
                                         n = snprintf(buf, bufsize,
                                                      ",GROUP:%s", sidstr);
                                 }
@@ -5327,7 +5327,9 @@
                 ipc_srv = smbc_attr_server(context, server, share,
                                            workgroup, user, password,
                                            &pol);
-                srv->no_nt_session = True;
+                if (! ipc_srv) {
+                        srv->no_nt_session = True;
+                }
         } else {
                 ipc_srv = NULL;
         }
@@ -5752,7 +5754,9 @@
                 ipc_srv = smbc_attr_server(context, server, share,
                                            workgroup, user, password,
                                            &pol);
-                srv->no_nt_session = True;
+                if (! ipc_srv) {
+                        srv->no_nt_session = True;
+                }
         } else {
                 ipc_srv = NULL;
         }



More information about the samba-cvs mailing list