1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-07 01:58:28 +03:00

206 Commits

Author SHA1 Message Date
Stefan Metzmacher
052a7d4f9a r4535: add full support for
typedef bitmap {
    FLAG1 = 0x01
} fooflags;

typedef struct {
    fooflags flags;
}

metze
2007-10-10 13:08:19 -05:00
Andrew Tridgell
1a24a50384 r4526: - much simpler (and more accurate!) ndr_size_*() code generation. It
is less efficient, but I really doubt that matters.

- use enum in epmapper.idl for protocol type

- added support for "enum8bit" flag, used in epmapper.idl
2007-10-10 13:08:18 -05:00
Andrew Tridgell
29955004aa r4519: added the enum print function in ndr_basic.c 2007-10-10 13:08:17 -05:00
Andrew Tridgell
3040cd6515 r4139: 2nd attempt at fixing the null ptr in size_is() problem. 2007-10-10 13:06:30 -05:00
Andrew Tridgell
e839b19ec5 r4110: fixed pidl to allow arrays to have size_is() and length_is() elements
that depend on variables that come after the array in the structure or function.

This has been something that has been problematic for a while, but the
winreg QueryValue problem finally prompted me to fix it properly. We
should now go back and fix up all the ugly workarounds we have used to
avoid this problem in other calls.

Unfortunately the solution is fairly complex, and involves the use of
the internal ndr token lists (similar to the solution for relative
pointers). I wonder if anyone else will be able to follow the logic if
I get run over by a bus :-)
2007-10-10 13:06:27 -05:00
Stefan Metzmacher
717454eb2f r4102: more uint64 vs HYPER_T fixes
NOTE:
 [u]int64 uses 4 Byte alignment
 and HYPER_T uses 8 Byte alignment

metze
2007-10-10 13:06:26 -05:00
Andrew Tridgell
c4c83f04f5 r4098: catch null guid string so RPC-DRSUAPI works against my server 2007-10-10 13:06:26 -05:00
Andrew Tridgell
80d15fa340 r4052: fixed a bunch of code to use the type safe _p allocation macros 2007-10-10 13:06:18 -05:00
Andrew Tridgell
90cdfd921e r4051: use talloc_array() instead of talloc() when allocating arrays in auto-generated ndr code 2007-10-10 13:06:18 -05:00
Stefan Metzmacher
623411f74e r3997: fix STR_CHARLEN pull case
metze
2007-10-10 13:06:12 -05:00
Stefan Metzmacher
56c66f4a09 r3984: success full parse the repsFrom/repsTo LDAP fields
metze
2007-10-10 13:06:11 -05:00
Stefan Metzmacher
523e6acf4f r3972: use GUID_* naming context and move GUID_* functions to one place
metze
2007-10-10 13:06:09 -05:00
Stefan Metzmacher
44f168c44d r3956: start to decode the repsFrom and repsTo fileds but not ready
metze
2007-10-10 13:06:07 -05:00
Stefan Metzmacher
db35f3b0f9 r3869: in the NDR encoded replPropertyMetaData attribute in ADS
I see a new 64 bit time field which are seconds since 1601,

this will be mapped to NTTIME by th eparsing code

+#define NTTIME_1sec NTTIME

metze
2007-10-10 13:05:59 -05:00
Jelmer Vernooij
a00bda88e1 r3861: - Put ndr and rpc client code in seperate files
- Add some const
2007-10-10 13:05:58 -05:00
Andrew Tridgell
f68a6b6b91 r3830: unified the query/set security descriptor code with the rest of the
queryfileinfo/setfileinfo logic, so querying/setting a security
descriptor is treated as just another file query/set operation.

This will allow NTVFS backends to see the query/set security
descriptor operations as RAW_FILEINFO_SEC_DESC and
RAW_SFILEINFO_SEC_DESC operations.
2007-10-10 13:05:57 -05:00
Stefan Metzmacher
b620bdd672 r3810: create a LIB_SECURITY subsystem
- move dom_sid, security_descriptor, security_* funtions to one place
  and rename some of them

metze
2007-10-10 13:05:56 -05:00
Stefan Metzmacher
8bd2e3cb4e r3787: a function to generate a random GUID
metze
2007-10-10 13:05:53 -05:00
Stefan Metzmacher
436da375a2 r3785: this strings are not const
metze
2007-10-10 13:05:53 -05:00
Jelmer Vernooij
8693344772 r3611: DCOM client support works!!
The torture test DCOM-SIMPLE now successfully does an
IStream_Read and a IStream_Write call.

This test can now be run successfully against the "Simple DCOM" Visual
Studio example.

(You have to quote out line 337 in pidl. pidl complains if the variable
 that contains the array size follows the array. I still need to fix this
 properly)

Next goals:
 - Clean up code
 - Server side support
 - Support custom marshalling
 - Support DCOM interfaces in files other then dcom.idl
2007-10-10 13:05:39 -05:00
Jelmer Vernooij
54e1e5edca r3606: More DCOM fixes:
- OXID tables work now. IOXIDResolver is used if there is used for getting a STRINGBINDING if none is known yet
 - Add custom dissectors for STRINGARRAY and DUALSTRINGARRAY. If there's a way to get rid of these later on (by supporting them thru pidl somehow), I'd be happy to use that instead of doing it manually.

I can now get to the point where we have created an object and are connected to
it. The only thing left to do is being able to set the Object UUID properly..
2007-10-10 13:05:38 -05:00
Stefan Metzmacher
07405f1c67 r3582: more gcc-4.0 signedness fixes
metze
2007-10-10 13:05:35 -05:00
Andrew Tridgell
bad6a88371 r3549: added support for DOS extended attribute lists (name/value pairs)
stored in posix xattrs
2007-10-10 13:05:31 -05:00
Andrew Tridgell
c54253ed1b r3545: initial support for using extended attributes to hold extended dos attributes of files.
I decided to use IDL/NDR to encode the attribute, as it gives us a
simple way to describe and extend the saved attributes.

The xattr code needs to hook into quite a few more places in the pvfs
code, but this at least gets the basics done. I will start encoding
alternate data streams streams, DOS EAs etc soon using the same basic
mechanism.

I'll probably stick to "version 1" for the xattr.idl for quite a while
even though it will be changing, as I don't expect anyone to be
deploying this in production just yet. Once we have production users
we will need to keep compatibility by supporting all the old version
numbers in xattr.idl.
2007-10-10 13:05:30 -05:00
Stefan Metzmacher
f631069582 r3512: - support DsCrackName GUID strings ('{faedf4f9-0de8-4582-b8b6-c475efefbe5a}')
- resolve the GUID's we got in DsGetDomainControllerInfo in the DsCrackNames test

metze
2007-10-10 13:05:23 -05:00
Stefan Metzmacher
8251d8b3e5 r3484: - add support for conformant string arrays at the end of a struct
- add support for strings where the length excludes the NULLTERM

metze
2007-10-10 13:05:21 -05:00
Andrew Tridgell
b97e395c81 r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ioctl.h) 2007-10-10 13:05:17 -05:00
Jelmer Vernooij
0873bf2cbe r3432: Support WERROR's in arguments (not just as return type). Some of
the DCOM calls are wrappers around several local calls, so you get things like:

WERROR foobar ( [in] int num_ifaces,
			   [in,size_is(num_ifaces)] IID *ifaces,
			   [out,size_is(num_ifaces)] WERROR *results);
2007-10-10 13:05:10 -05:00
Andrew Tridgell
b8f5fa8ac8 r3428: switched to using minimal includes for the auto-generated RPC code.
The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.

This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
2007-10-10 13:05:09 -05:00
Andrew Tridgell
e694aeefe7 r3424: don't run mkproto.pl on pidl generated code, instead rely on pidl generating the
prototypes itself
2007-10-10 13:05:08 -05:00
Andrew Tridgell
2cf35cb4d2 r3395: added support for "string32" type, to fix the fixed width string
problem that tim found.
2007-10-10 13:05:05 -05:00
Andrew Bartlett
224b59edba r3358: Try to put all the basic struct dom_sid manipulation functions in one
place.  (I always have trouble finding one half or the other).

Andrew Bartlett
2007-10-10 13:05:00 -05:00
Andrew Tridgell
02d5d0f685 r3322: fixed a bunch of warnings in the build, including one case where it was a real bug 2007-10-10 13:04:55 -05:00
Andrew Bartlett
8b38bffc70 r3073: Fix bug in the handling of null-terminated ASCII strings in RPC.
Because we didn't count the null terminator, we would not move past it
in the packet.

Andrew Bartlett
2007-10-10 13:01:55 -05:00
Tim Potter
e080a2483d r3036: Add function to pull an array of structures. Abstracts away the
individual routines in ndr_spoolss_buf.c.
2007-10-10 13:00:01 -05:00
Jelmer Vernooij
7c823f886a r2990: Add support to pidl for autogenerating ndr_size_*() functions. Adding
the [gensize] property to a struct or union will make pidl generate a
ndr_size_*() function.

(not all nasty bits of NDR are completely covered yet by the
 ndr_size*() functions, support for those will be added when necessary)

I also have a local patch (not applied now) that simplifies the pidl output
and eliminates the number of functions required. It would, however, make
pidl more complex.
2007-10-10 12:59:55 -05:00
Andrew Tridgell
d8152f8961 r2989: fix the printing of unions with negative cases when :print is used 2007-10-10 12:59:55 -05:00
Andrew Tridgell
24122eb93e r2987: added support for signed 32 bit integers in pidl 2007-10-10 12:59:54 -05:00
Andrew Tridgell
cc00f9b6b8 r2968: fixed the byte order problem with the new RHS parsing on ncacn_ip_tcp 2007-10-10 12:59:53 -05:00
Andrew Tridgell
dbe6430d78 r2948: added support for the [range(low,high)] attribute in pidl. This allows
range checking of any integer value, to help protect against denial of
service attacks (which could otherwise cause large memory allocations)
2007-10-10 12:59:50 -05:00
Andrew Tridgell
aad0e7e9d8 r2910: I noticed that the samr torture test was doing its own DOS->UNIX
string conversion. For RPC, all string conversions are supposed to be
done by the NDR layer, using string flags set in the IDL. The reason
this wasn't working is that I had been too lazy to do the STR_ASCII
string types properly at the NDR layer when initially writing
ndr_basic.c.

This commit fixes the ndr_basic code properly to do all ASCII
varients, by re-using the non-ascii code and a "byte_mul" local
variable. I have also removed the manual string conversion in the SAMR
torture test code.
2007-10-10 12:59:47 -05:00
Andrew Tridgell
814881f0e5 r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions.
The motivation for this change was to avoid having to convert to/from
ucs2 strings for so many operations. Doing that was slow, used many
static buffers, and was also incorrect as it didn't cope properly with
unicode codepoints above 65536 (which could not be represented
correctly as smb_ucs2_t chars)

The two core functions that allowed this change are next_codepoint()
and push_codepoint(). These functions allow you to correctly walk a
arbitrary multi-byte string a character at a time without converting
the whole string to ucs2.

While doing this cleanup I also fixed several ucs2 string handling
bugs. See the commit for details.

The following code (which counts the number of occuraces of 'c' in a
string) shows how to use the new interface:

size_t count_chars(const char *s, char c)
{
	size_t count = 0;

	while (*s) {
		size_t size;
		codepoint_t c2 = next_codepoint(s, &size);
		if (c2 == c) count++;
		s += size;
	}

	return count;
}
2007-10-10 12:59:39 -05:00
Andrew Tridgell
8dc23821c9 r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
dabc7ddd9f r2625: use talloc_p, not talloc when possible (when allocating a structure in particular), as it gives us type checking. 2007-10-10 12:59:13 -05:00
Andrew Bartlett
dfecb01506 r2552: Character set conversion and string handling updates.
The intial motivation for this commit was to merge in some of the
bugfixes present in Samba3's chrcnv and string handling code into
Samba4.  However, along the way I found a lot of unused functions, and
decided to do a bit more...

The strlen_m code now does not use a fixed buffer, but more work is
needed to finish off other functions in str_util.c.  These fixed
length buffers hav caused very nasty, hard to chase down bugs at some
sites.

The strupper_m() function has a strupper_talloc() to replace it (we
need to go around and fix more uses, but it's a start).  Use of these
new functions will avoid bugs where the upper or lowercase version of
a string is a different length.

I have removed the push_*_allocate functions, which are replaced by
calls to push_*_talloc.  Likewise, pstring and other 'fixed length'
wrappers are removed, where possible.

I have removed the first ('base pointer') argument, used by push_ucs2,
as the Samba4 way of doing things ensures that this is always on an
even boundary anyway.  (It was used in only one place, in any case).
2007-10-10 12:59:05 -05:00
Tim Potter
6c1a72c5d6 r2247: talloc_destroy -> talloc_free 2007-10-10 12:58:34 -05:00
Andrew Tridgell
e909bfa708 r2209: patch from volker to add EnumPorts spoolss IDL and test code
the ndr->offset=0; stuff is ugly. We need a better way to handle this.
2007-10-10 12:58:31 -05:00
Volker Lendecke
ef5414676e r2208: little attempt to (almost) fix spoolss relative 2007-10-10 12:58:31 -05:00
Andrew Tridgell
8ffe136ad2 r2206: another (untested) attempt to make RELATIVE_CURRENT work for volker,
plus removed unused ndr_pull_relative() function

once volker commits a test for this I'll be able to ensure it really works as expected
2007-10-10 12:58:31 -05:00
Andrew Tridgell
d2d3433de1 r2205: fixed an incorrect cast that broke relative strings in spoolss 2007-10-10 12:58:31 -05:00