Remove unused include param/param.h.
[bbaumbach/samba-autobuild/.git] / source4 / smb_server / blob.c
index 368b81d18e5cf9d29929aa04161c9e3d2d05f934..f72074898af2d46845279eaa77969e7aac7836dc 100644 (file)
 */
 
 #include "includes.h"
-#include "lib/util/dlinklist.h"
+#include "../lib/util/dlinklist.h"
 #include "smb_server/smb_server.h"
 #include "librpc/gen_ndr/ndr_misc.h"
 #include "ntvfs/ntvfs.h"
 #include "libcli/raw/libcliraw.h"
 #include "libcli/raw/raw_proto.h"
-#include "param/param.h"
 
 #define BLOB_CHECK(cmd) do { \
        NTSTATUS _status; \
@@ -35,7 +34,7 @@
 
 #define BLOB_CHECK_MIN_SIZE(blob, size) do { \
        if ((blob)->length < (size)) { \
-               return NT_STATUS_INFO_LENGTH_MISMATCH; \
+               return NT_STATUS_INVALID_PARAMETER; \
        } \
 } while (0)
 
@@ -140,10 +139,10 @@ size_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx,
                alignment = 1;
                if (dest_len > 0) {
                        SCVAL(blob->data + offset, 0, 0);
-                       ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset + 1, str, dest_len-1, flags);
+                       ret = push_string(blob->data + offset + 1, str, dest_len-1, flags);
                }
        } else {
-               ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset, str, dest_len, flags);
+               ret = push_string(blob->data + offset, str, dest_len, flags);
        }
 
        /* sometimes the string needs to be terminated, but the length
@@ -530,13 +529,14 @@ NTSTATUS smbsrv_pull_passthru_sfileinfo(TALLOC_CTX *mem_ctx,
 
        switch (level) {
        case SMB_SFILEINFO_BASIC_INFORMATION:
-               BLOB_CHECK_MIN_SIZE(blob, 36);
+               BLOB_CHECK_MIN_SIZE(blob, 40);
 
                st->basic_info.in.create_time = pull_nttime(blob->data,  0);
                st->basic_info.in.access_time = pull_nttime(blob->data,  8);
                st->basic_info.in.write_time =  pull_nttime(blob->data, 16);
                st->basic_info.in.change_time = pull_nttime(blob->data, 24);
-               st->basic_info.in.attrib =      IVAL(blob->data,        32);
+               st->basic_info.in.attrib      = IVAL(blob->data,        32);
+               st->basic_info.in.reserved    = IVAL(blob->data,        36);
 
                return NT_STATUS_OK;
 
@@ -581,6 +581,27 @@ NTSTATUS smbsrv_pull_passthru_sfileinfo(TALLOC_CTX *mem_ctx,
 
                return NT_STATUS_OK;
 
+
+       case RAW_SFILEINFO_LINK_INFORMATION:
+               if (!bufinfo) {
+                       return NT_STATUS_INTERNAL_ERROR;
+               }
+               BLOB_CHECK_MIN_SIZE(blob, 20);
+               st->link_information.in.overwrite = CVAL(blob->data, 0);
+               st->link_information.in.root_fid  = IVAL(blob->data, 8);
+               len                                 = IVAL(blob->data, 16);
+               ofs                                 = 20;
+               str_blob = *blob;
+               str_blob.length = MIN(str_blob.length, ofs+len);
+               smbsrv_blob_pull_string(bufinfo, &str_blob, ofs,
+                                       &st->link_information.in.new_name,
+                                       STR_UNICODE);
+               if (st->link_information.in.new_name == NULL) {
+                       return NT_STATUS_FOOBAR;
+               }
+
+               return NT_STATUS_OK;
+
        case RAW_SFILEINFO_RENAME_INFORMATION_SMB2:
                /* SMB2 uses a different format for rename information */
                if (!bufinfo) {