svn commit: samba r13216 - in branches/SAMBA_3_0: . source/libsmb

derrell at samba.org derrell at samba.org
Sun Jan 29 04:57:43 GMT 2006


Author: derrell
Date: 2006-01-29 04:57:42 +0000 (Sun, 29 Jan 2006)
New Revision: 13216

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

Log:
 r12422 at cabra:  derrell | 2006-01-28 23:57:35 -0500
 Fix cli_setpathinfo() to actually do what it's supposed to.
 
 Also, get rid of some apparently drug-induced code to deal with create time
 which isn't being manipulated anyway.
 

Modified:
   branches/SAMBA_3_0/
   branches/SAMBA_3_0/source/libsmb/clirap.c
   branches/SAMBA_3_0/source/libsmb/libsmbclient.c


Changeset:

Property changes on: branches/SAMBA_3_0
___________________________________________________________________
Name: svk:merge
   - 3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba3:12420
   + 3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba3:12422

Modified: branches/SAMBA_3_0/source/libsmb/clirap.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clirap.c	2006-01-29 00:12:20 UTC (rev 13215)
+++ branches/SAMBA_3_0/source/libsmb/clirap.c	2006-01-29 04:57:42 UTC (rev 13216)
@@ -471,7 +471,6 @@
 	char *rparam=NULL, *rdata=NULL;
 	int count=8;
 	BOOL ret;
-        void (*date_fn)(struct cli_state *, char *buf,int offset,time_t unixdate);
 	char *p;
 
 	memset(param, 0, sizeof(param));
@@ -480,7 +479,7 @@
         p = param;
 
         /* Add the information level */
-	SSVAL(p, 0, SMB_INFO_STANDARD);
+	SSVAL(p, 0, SMB_FILE_BASIC_INFORMATION);
 
         /* Skip reserved */
 	p += 6;
@@ -492,26 +491,27 @@
 
         p = data;
 
-	if (cli->win95) {
-		date_fn = cli_put_dos_date;
-	} else {
-		date_fn = cli_put_dos_date2;
-	}
+        /*
+         * Add the create, last access, modification, and status change times
+         */
+        
+        /* Don't set create time, at offset 0 */
+        p += 8;
 
-        /* Add the create, last access, and modification times */
-        (*date_fn)(cli, p, 0, c_time);
-        (*date_fn)(cli, p, 4, a_time);
-        (*date_fn)(cli, p, 8, m_time);
-        p += 12;
-
-        /* Skip DataSize and AllocationSize */
+        put_long_date(p, a_time);
         p += 8;
+        
+        put_long_date(p, m_time);
+        p += 8;
+        
+        put_long_date(p, c_time);
+        p += 8;
 
         /* Add attributes */
-        SSVAL(p, 0, mode);
-        p += 2;
+        SIVAL(p, 0, mode);
+        p += 4;
 
-        /* Add EA size (none) */
+        /* Add padding */
         SIVAL(p, 0, 0);
         p += 4;
 

Modified: branches/SAMBA_3_0/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2006-01-29 00:12:20 UTC (rev 13215)
+++ branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2006-01-29 04:57:42 UTC (rev 13216)
@@ -1523,39 +1523,6 @@
         int ret;
 
         /*
-         * Get the create time of the file (if not provided); we'll need it in
-         * the set call.
-         */
-        if (! srv->no_pathinfo && c_time == 0) {
-                if (! cli_qpathinfo(&srv->cli, path,
-                                    &c_time, NULL, NULL, NULL, NULL)) {
-                        /* qpathinfo not available */
-                        srv->no_pathinfo = True;
-                } else {
-                        /*
-                         * We got a creation time.  Some OS versions don't
-                         * return a valid create time, though.  If we got an
-                         * invalid time, start with the current time instead.
-                         */
-                        if (c_time == 0 || c_time == (time_t) -1) {
-                                c_time = time(NULL);
-                        }
-
-                        /*
-                         * We got a creation time.  For sanity sake, since
-                         * there is no POSIX function to set the create time
-                         * of a file, if the existing create time is greater
-                         * than either of access time or modification time,
-                         * set create time to the smallest of those.  This
-                         * ensure that the create time of a file is never
-                         * greater than its last access or modification time.
-                         */
-                        if (c_time > a_time) c_time = a_time;
-                        if (c_time > m_time) c_time = m_time;
-                }
-        }
-
-        /*
          * First, try setpathinfo (if qpathinfo succeeded), for it is the
          * modern function for "new code" to be using, and it works given a
          * filename rather than requiring that the file be opened to have its



More information about the samba-cvs mailing list