summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-12 22:15:06 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-12 22:15:06 +0100
commit7c5c3844b8451d5990688df4d576cc39a043e5b0 (patch)
treee82988f307829da9dbeb52f7987021d2aafe4d82
parent04aef38453ff977bf260546545e968fce3ddd599 (diff)
parentbe25cdebcbdd0c26050076629d4edfbababe2852 (diff)
downloadsamba-7c5c3844b8451d5990688df4d576cc39a043e5b0.tar.gz
samba-7c5c3844b8451d5990688df4d576cc39a043e5b0.tar.bz2
samba-7c5c3844b8451d5990688df4d576cc39a043e5b0.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-trivial
(This used to be commit 842b4969cd08a8acc5584cfdcf1aaf8a751e4fa3)
-rw-r--r--source4/librpc/idl/idl_types.h12
-rw-r--r--source4/librpc/idl/nbt.idl2
-rw-r--r--source4/librpc/idl/spoolss.idl4
-rw-r--r--source4/librpc/ndr/libndr.h2
-rw-r--r--source4/librpc/ndr/ndr_string.c45
-rw-r--r--source4/ntvfs/cifs/vfs_cifs.c20
6 files changed, 20 insertions, 65 deletions
diff --git a/source4/librpc/idl/idl_types.h b/source4/librpc/idl/idl_types.h
index f21f3e660d..01524c2984 100644
--- a/source4/librpc/idl/idl_types.h
+++ b/source4/librpc/idl/idl_types.h
@@ -5,8 +5,6 @@
#define STR_NOTERM LIBNDR_FLAG_STR_NOTERM
#define STR_NULLTERM LIBNDR_FLAG_STR_NULLTERM
#define STR_BYTESIZE LIBNDR_FLAG_STR_BYTESIZE
-#define STR_FIXLEN32 LIBNDR_FLAG_STR_FIXLEN32
-#define STR_FIXLEN15 LIBNDR_FLAG_STR_FIXLEN15
#define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT
#define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN
#define STR_UTF8 LIBNDR_FLAG_STR_UTF8
@@ -22,16 +20,6 @@
#define nstring [flag(STR_NULLTERM)] string
/*
- fixed length 32 character UCS-2 string
-*/
-#define string32 [flag(STR_FIXLEN32)] string
-
-/*
- fixed length 16 character ascii string
-*/
-#define astring15 [flag(STR_ASCII|STR_FIXLEN15)] string
-
-/*
an ascii string prefixed with [offset] [length], both 32 bits
null terminated
*/
diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl
index d4c2bf1ad0..17304bfa0d 100644
--- a/source4/librpc/idl/nbt.idl
+++ b/source4/librpc/idl/nbt.idl
@@ -143,7 +143,7 @@ interface nbt
} nbt_statistics;
typedef struct {
- astring15 name;
+ [charset(DOS)] uint8 name[15];
nbt_name_type type;
nb_flags nb_flags;
} nbt_status_name;
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index 114c06a00d..33b4dba7b2 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -58,7 +58,7 @@ import "security.idl", "winreg.idl";
} spoolss_PrinterInfo0;
typedef [public,gensize] struct {
- string32 devicename;
+ [charset(UTF16)] uint16 devicename[32];
uint16 specversion;
uint16 driverversion;
uint16 size;
@@ -77,7 +77,7 @@ import "security.idl", "winreg.idl";
uint16 yresolution;
uint16 ttoption;
uint16 collate;
- string32 formname;
+ [charset(UTF16)] uint16 formname[32];
uint16 logpixels;
uint32 bitsperpel;
uint32 pelswidth;
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 1ecc6f3c38..731ef0f60b 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -109,11 +109,9 @@ struct ndr_print {
#define LIBNDR_FLAG_STR_NULLTERM (1<<6)
#define LIBNDR_FLAG_STR_SIZE2 (1<<7)
#define LIBNDR_FLAG_STR_BYTESIZE (1<<8)
-#define LIBNDR_FLAG_STR_FIXLEN32 (1<<9)
#define LIBNDR_FLAG_STR_CONFORMANT (1<<10)
#define LIBNDR_FLAG_STR_CHARLEN (1<<11)
#define LIBNDR_FLAG_STR_UTF8 (1<<12)
-#define LIBNDR_FLAG_STR_FIXLEN15 (1<<13)
#define LIBNDR_STRING_FLAGS (0x7FFC)
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c
index 69a7eca1a8..79548f81bc 100644
--- a/source4/librpc/ndr/ndr_string.c
+++ b/source4/librpc/ndr/ndr_string.c
@@ -259,24 +259,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
*s = as;
break;
- case LIBNDR_FLAG_STR_FIXLEN15:
- case LIBNDR_FLAG_STR_FIXLEN32:
- len1 = (flags & LIBNDR_FLAG_STR_FIXLEN32)?32:15;
- NDR_PULL_NEED_BYTES(ndr, len1*byte_mul);
- ret = convert_string_talloc(ndr->current_mem_ctx,
- ndr->iconv_convenience,
- chset, CH_UNIX,
- ndr->data+ndr->offset,
- len1*byte_mul,
- (void **)&as);
- if (ret == -1) {
- return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad character conversion");
- }
- NDR_CHECK(ndr_pull_advance(ndr, len1*byte_mul));
- *s = as;
- break;
-
case LIBNDR_FLAG_STR_NOTERM:
if (!(ndr->flags & LIBNDR_FLAG_REMAINING)) {
return ndr_pull_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x (missing NDR_REMAINING)\n",
@@ -349,10 +331,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags,
flags &= ~LIBNDR_FLAG_STR_CONFORMANT;
- if (!(flags &
- (LIBNDR_FLAG_STR_NOTERM |
- LIBNDR_FLAG_STR_FIXLEN15 |
- LIBNDR_FLAG_STR_FIXLEN32))) {
+ if (!(flags & LIBNDR_FLAG_STR_NOTERM)) {
s_len++;
}
d_len = convert_string_talloc(ndr, ndr->iconv_convenience, CH_UNIX, chset, s, s_len, (void **)&dest);
@@ -399,21 +378,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags,
NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
break;
- case LIBNDR_FLAG_STR_FIXLEN15:
- case LIBNDR_FLAG_STR_FIXLEN32: {
- ssize_t fix_len = (flags & LIBNDR_FLAG_STR_FIXLEN32)?32:15;
- uint32_t pad_len = fix_len - d_len;
- if (d_len > fix_len) {
- return ndr_push_error(ndr, NDR_ERR_CHARCNV,
- "Bad character conversion");
- }
- NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
- if (pad_len != 0) {
- NDR_CHECK(ndr_push_zero(ndr, pad_len));
- }
- break;
- }
-
default:
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
@@ -439,13 +403,6 @@ _PUBLIC_ size_t ndr_string_array_size(struct ndr_push *ndr, const char *s)
unsigned byte_mul = 2;
unsigned c_len_term = 1;
- if (flags & LIBNDR_FLAG_STR_FIXLEN32) {
- return 32;
- }
- if (flags & LIBNDR_FLAG_STR_FIXLEN15) {
- return 15;
- }
-
c_len = s?strlen_m(s):0;
if (flags & (LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_UTF8)) {
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c
index 910401f157..901dd2cf7c 100644
--- a/source4/ntvfs/cifs/vfs_cifs.c
+++ b/source4/ntvfs/cifs/vfs_cifs.c
@@ -64,12 +64,16 @@ struct async_info {
#define SETUP_PID private->tree->session->pid = req->smbpid
-#define SETUP_FILE do { \
- struct cvfs_file *f; \
+#define SETUP_FILE_HERE(f) do { \
f = ntvfs_handle_get_backend_data(io->generic.in.file.ntvfs, ntvfs); \
if (!f) return NT_STATUS_INVALID_HANDLE; \
io->generic.in.file.fnum = f->fnum; \
-} while (0)
+} while (0)
+
+#define SETUP_FILE do { \
+ struct cvfs_file *f; \
+ SETUP_FILE_HERE(f); \
+} while (0)
#define SETUP_PID_AND_FILE do { \
SETUP_PID; \
@@ -484,6 +488,7 @@ static void async_open(struct smbcli_request *c_req)
req->async_states->status = ntvfs_handle_set_backend_data(f->h, cvfs->ntvfs, f);
if (!NT_STATUS_IS_OK(req->async_states->status)) goto failed;
file->ntvfs = f->h;
+ DLIST_ADD(cvfs->files, f);
failed:
req->async_states->send_fn(req);
}
@@ -526,6 +531,7 @@ static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs,
status = ntvfs_handle_set_backend_data(f->h, private->ntvfs, f);
NT_STATUS_NOT_OK_RETURN(status);
file->ntvfs = f->h;
+ DLIST_ADD(private->files, f);
return NT_STATUS_OK;
}
@@ -752,6 +758,7 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
+ struct cvfs_file *f;
SETUP_PID;
@@ -759,7 +766,12 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
private->map_generic) {
return ntvfs_map_close(ntvfs, req, io);
}
- SETUP_FILE;
+ SETUP_FILE_HERE(f);
+ /* Note, we aren't free-ing f, or it's h here. Should we?
+ even if file-close fails, we'll remove it from the list,
+ what else would we do? Maybe we should not remove until
+ after the proxied call completes? */
+ DLIST_REMOVE(private->files, f);
if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
return smb_raw_close(private->tree, io);