Convert all uint32/16/8 to _t in source3/libsmb.
[bbaumbach/samba-autobuild/.git] / source3 / libsmb / libsmb_file.c
index 32210b6c1abcbba6e3c2cfcbda2f5351fa5b6db4..11d6d82780966b72b8a5bbe15826da9c9f0617d3 100644 (file)
@@ -496,7 +496,7 @@ bool
 SMBC_getatr(SMBCCTX * context,
             SMBCSRV *srv,
             const char *path,
-            uint16 *mode,
+            uint16_t *mode,
             off_t *size,
             struct timespec *create_time_ts,
             struct timespec *access_time_ts,
@@ -558,11 +558,24 @@ SMBC_getatr(SMBCCTX * context,
                return True;
         }
 
+       srv->no_pathinfo2 = True;
+
+       if (!srv->no_pathinfo3 &&
+            NT_STATUS_IS_OK(cli_qpathinfo3(targetcli, targetpath,
+                           create_time_ts,
+                           access_time_ts,
+                           write_time_ts,
+                           change_time_ts,
+                          size, mode, ino))) {
+               TALLOC_FREE(frame);
+               return True;
+        }
+
+       srv->no_pathinfo3 = True;
+
        /* if this is NT then don't bother with the getatr */
        if (smb1cli_conn_capabilities(targetcli->conn) & CAP_NT_SMBS) {
-                errno = EPERM;
-               TALLOC_FREE(frame);
-                return False;
+               goto all_failed;
         }
 
        if (NT_STATUS_IS_OK(cli_getatr(targetcli, targetpath, mode, size, &write_time))) {
@@ -581,11 +594,17 @@ SMBC_getatr(SMBCCTX * context,
                 if (change_time_ts != NULL) {
                         *change_time_ts = w_time_ts;
                 }
-               srv->no_pathinfo2 = True;
+               if (ino) {
+                       *ino = 0;
+               }
                TALLOC_FREE(frame);
                return True;
        }
 
+all_failed:
+       srv->no_pathinfo2 = False;
+       srv->no_pathinfo3 = False;
+
         errno = EPERM;
        TALLOC_FREE(frame);
        return False;
@@ -607,7 +626,7 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path,
             time_t access_time,
             time_t write_time,
             time_t change_time,
-            uint16 mode)
+            uint16_t mode)
 {
         uint16_t fd;
         int ret;
@@ -662,7 +681,7 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path,
                  * cli_setatr() for that, and with only this parameter, it
                  * seems to work on win98.
                  */
-                if (ret && mode != (uint16) -1) {
+                if (ret && mode != (uint16_t) -1) {
                         ret = NT_STATUS_IS_OK(cli_setatr(srv->cli, path, mode, 0));
                 }