1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

269 Commits

Author SHA1 Message Date
Günther Deschner
8b75b65b36 librpc/ndr/ndr_spoolss_buf.h: fix licence/copyright
Guenther
2011-06-10 15:11:53 +02:00
Günther Deschner
4dadee3adf librpc/ndr/ndr_dns.h: fix licence/copyright
Guenther
2011-06-10 15:11:52 +02:00
Günther Deschner
e9e2f3034e librpc/ndr/ndr_compression.h: fix licence/copyright
Guenther
2011-06-10 15:11:49 +02:00
Günther Deschner
cfa1507610 librpc/ndr/ndr_backupkey.h: fix licence/copyright
Guenther
2011-06-10 15:11:48 +02:00
Jeremy Allison
db46a9d634 Fix type mixing warnings. 2011-06-01 23:53:07 +02:00
Andrew Bartlett
00577e9a3a librpc/ndr: Use converted_size to determine if NULL termination was sent
This is better than doing a strlen() on the string, as that huristic
only worked for ASCII strings.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Jun  1 01:42:22 CEST 2011 on sn-devel-104
2011-06-01 01:42:21 +02:00
Sean Finney
08abd1f5e8 librpc/ndr: add new LIBNDR_FLAG_STR_RAW8 for ndr_pull_string
Introduce a new flag, LIBNDR_FLAG_STR_RAW8, which indicates that libndr
should not attempt to convert the corresponding byte sequence, and place
the responsibility on the caller to do so later.

This is needed in cases where the string is known to be 8-bit and either
NULL terminated or of known length, but in an unspecified character set.
For example, when pulling PT_STRING8 properties from an exchange server
via libmapi + libndr, the codepage is neither known nor in the control
of the caller, and is determined by subsequent properties requested from
the server.  Therefore the client would like to fetch all properties in
one large batch, and convert the resulting strings locally.

This commit also includes some (basic) tests of each of the flags'
respective behaviors with the ndr push/pull string functions, in a new
source4 torture test suite ndr.ndr_string.

Signed-off-by: Sean Finney <seanius@seanius.net>
2011-06-01 00:30:40 +02:00
Sean Finney
c51795c747 librpc/ndr: consolidate string conversion logic in ndr_pull_string
Reduce the amount of duplicate code in ndr_pull_string by moving the
almost duplicate conversion calls and their corresponding NDR pulls and
checks to a single location.  In the place of the removed calls is logic
allowing the conversion to be generalized, and and any specific
pulls/checks that do not apply to the general case.

This is similar to what has already been done in the switch statement
for ndr_push_string.

Signed-off-by: Sean Finney <seanius@seanius.net>
2011-06-01 00:30:40 +02:00
Andrew Bartlett
41b3c38587 librpc/ndr Merge ndr_print_sockaddr_storage() into common code
There is no longer a reason to leave this source3 specific, and this
brings it into a library (avoiding duplicate symbols).

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Andrew Bartlett
663dc94e63 auth: Move auth_session_info into IDL
This changes auth_session_info_transport to just be a wrapper, rather
than a copy that has to be kept in sync.

As auth_session_info was already wrapped in python, this required
changes to the existing pyauth wrapper and it's users.

Andrew Bartlett
2011-04-05 23:46:04 +02:00
Jeremy Allison
c109a70531 Fix convert_string() to take a *converted_size arg. and return a bool.
Makes these interfaces much harder to misuse and easier to ensure error
checking.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Mar 30 23:59:37 CEST 2011 on sn-devel-104
2011-03-30 23:59:37 +02:00
Jeremy Allison
c964744001 This doesn't look like it has anything to do with character set conversion, but it does :-).
Turns out one of the *really* significant differences between
convert_string() in source4 and source3, is that the one in
source3 will return 0 for byte length converted when called
with dest_len = 0 whereas the one in source4 returns (size_t)-1
and sets errno to E2BIG.

Allow the ndr_string code to cope with the (arguably correct)
way that the source4 implementation works. This code only gets
excercised in the print spooler tests, which aren't run in source4,
which is why this bug has lasted for so long.

You don't want to know how long it took me to find this :-).

Jeremy.
2011-03-30 09:58:22 -07:00
Jeremy Allison
0c5214e2eb Ensure convert_string_XXX is always called with a valid converted_size pointer.
Preparation for cleaning up this API.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Mar 29 21:01:49 CEST 2011 on sn-devel-104
2011-03-29 21:01:49 +02:00
Andrew Tridgell
15e84a9a09 charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-24 01:47:26 +01:00
Stefan Metzmacher
2a47ed8106 librpc/ndr: add ndr_push_pipe_chunk_trailer() and ndr_check_pipe_chunk_trailer()
metze
2011-03-10 14:31:15 +01:00
Stefan Metzmacher
eceea8641e librpc/ndr: add ndr_interface_call_pipe
metze
2011-03-10 14:31:14 +01:00
Andrew Bartlett
9728b5a0d5 librpc/ndr use hyper for uid_t/gid_t rather than udlong
This has 8 byte alignment, which is what was specified in pidl for
these types.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Mar  9 09:03:09 CET 2011 on sn-devel-104
2011-03-09 09:03:09 +01:00
Stefan Metzmacher
56df34a6aa librpc/rpc: let ndr_pull_spoolss_EnumPrinterDataEx() use a subcontext
This is not strictly needed, but it's good to have the logic
in common with the other Enum* calls.

This also allows us to play with the NDR_RELATIVE_REVERSE flag.

metze
2011-03-02 13:13:02 +01:00
Stefan Metzmacher
ef224aa004 librpc/ndr: handle NOALIGN flag for relative pointers and alignment DATA_BLOBs
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Mar  1 17:11:03 CET 2011 on sn-devel-104
2011-03-01 17:11:03 +01:00
Andrew Bartlett
646aefd998 pidl Add support for uid_t and gid_t types
These are mapped to uint64_t, which should be big enough.  This is
proposed to be used for internal Samba representations, where it would
be more painful to convert all the callers to an uint64_t calling
convention.

Andrew Bartlett
2011-03-01 06:29:03 +01:00
Stefan Metzmacher
341330600a spoolss.idl: align spoolss_PrinterEnumValues 'data' based on the type
metze
2011-02-28 15:54:13 -08:00
Stefan Metzmacher
23f6f44979 TODO test/review librpc/ndr: remove align2 hack for relative pointers
metze
2011-02-28 15:54:13 -08:00
Stefan Metzmacher
84b884eb4b librpc/ndr: ndr align relative pointers based on the given flags
We used to do this only for the reverse relative pointers
and now we always do it.

metze
2011-02-28 15:54:13 -08:00
Stefan Metzmacher
6c3a49ced3 TODO test/review librpc/ndr: let ndr_push/pull_DATA_BLOB() look at LIBNDR_FLAG_REMAINING before LIBNDR_ALIGN_FLAGS
metze
2011-02-28 15:54:13 -08:00
Andrew Tridgell
5debcb1027 idl: naming a structure 'VERSION' is not a good idea!
this renames it to ntlmssp_VERSION

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-17 00:55:23 +01:00
Günther Deschner
0aed229710 libndr: remove prototype for nonexisting function ndr_print_ipv4_addr().
Guenther
2011-02-17 00:54:16 +01:00
Günther Deschner
ad0a3185ce librpc: move preg.idl to main directory.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Feb 10 13:56:49 CET 2011 on sn-devel-104
2011-02-10 13:56:49 +01:00
Günther Deschner
947ba448a4 libndr: apply some const and make is_valid_policy_hnd a callback to policy_handle_empty.
Guenther
2011-02-08 14:05:36 +01:00
Günther Deschner
be5edba117 libndr: share some uuid helpers.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Feb  8 09:52:56 CET 2011 on sn-devel-104
2011-02-08 09:52:56 +01:00
Günther Deschner
84dbc2a82d ndr: merge ndr_map_error2string and ndr_errstr.
Guenther
2011-02-08 08:58:31 +01:00
Günther Deschner
8b55ae1785 ndr: move null_ndr_syntax_id to the common libndr location.
Guenther
2011-02-08 08:58:21 +01:00
Günther Deschner
724c982131 ndr: merge duplicate ndr_map_error2ntstatus() functions.
Guenther
2011-02-08 08:58:11 +01:00
Günther Deschner
7eac3100ea libndr: move ndr_print_bool to ndr_basic.c
Guenther
2011-01-25 11:42:46 +01:00
Matthieu Patou
25ae380fab idl: Add IDL for remote key backup protocol (rkbp)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-01-12 09:08:06 +01:00
Jelmer Vernooij
9529fdab26 wmi: Remove unnecessary noprint statements. 2011-01-01 02:54:05 +01:00
Andrew Tridgell
e7b1acaddf dns: cope with trailing '.' in dns_name 2010-12-21 11:18:20 +01:00
Matthias Dieter Wallnöfer
464b8fa317 librpc/ndr/ndr_*.c - remove "const" from OIDs 2010-12-21 15:10:37 +11:00
Andrew Tridgell
4820c97e9e dns: fixed the padding for dnsp_name fields in LDAP
all names are NUL terminated, but may have additional padding as well

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Dec 21 03:26:26 CET 2010 on sn-devel-104
2010-12-21 03:26:26 +01:00
Andrew Tridgell
b9a2852fdd dnsp: fixed parsing of dns_name structures
its not a pad byte, its a trailing zero
2010-12-21 02:42:37 +01:00
Kai Blin
af3414feb6 ndr: Another try to support the build on non-IPv6 systems
Signed-off-by: Matthieu Patou <mat@matws.net>

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Dec  8 10:26:00 CET 2010 on sn-devel-104
2010-12-08 10:26:00 +01:00
Björn Jacke
e52ba1fb87 librpc: fix builds without IPv6 suport (HP-UX 11.00)
Kai, please check.

Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Fri Nov 26 03:07:21 CET 2010 on sn-devel-104
2010-11-26 03:07:21 +01:00
Michael Adam
7e382a0496 librpc/ndr: use new strlen_m_ext_term() in ndr_charset_length(): fix bug #7594
This fixes the calculation of needed space for destination unicode charset.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Nov  3 23:28:07 UTC 2010 on sn-devel-104
2010-11-03 23:28:07 +00:00
Kamen Mazdrashki
717b1158a6 idl: Use DRSUAPI_ATTID_ prefix instead of DRSUAPI_ATTRIBUTE_ for ATTID values
Those values are actually ATTID values and such, they are used
for ATTIDs for Attributes, Classes and Syntaxes.
2010-10-31 23:54:04 +00:00
Kai Blin
6486733049 ndr: Make sure ndr_dns.c has no lines wider than 80 chars
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Wed Oct 27 21:17:50 UTC 2010 on sn-devel-104
2010-10-27 21:17:50 +00:00
Matthias Dieter Wallnöfer
14a3d4d7f0 librpc/ndr/ndr.c - fix some counter types
The "depth" is "uint32_t"

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed Oct 27 08:13:40 UTC 2010 on sn-devel-104
2010-10-27 08:13:40 +00:00
Andrew Bartlett
d9b7123cb7 librpc Make ndrdump use printf() rather than having to mess with DEBUG()
This means it no longer needs to force the debug level etc.

(this builds on the fine work by Volker to create dump_data_cb())

Andrew Bartlett
2010-10-27 04:42:06 +00:00
Kai Blin
a6305c4a16 s4 dns: Better error handling when parsing invalid or unknown records 2010-10-23 10:17:06 +00:00
Kai Blin
eb4f101200 s4 dns: Allow more components as part of a domain name 2010-10-23 10:17:06 +00:00
Kai Blin
80f30889e9 s4 dns: Fix a data corruption in the dns_string parsing 2010-10-23 10:17:05 +00:00
Kai Blin
a7b833ec7e s4 dns: Reply to a name request with an A record.
The first real answer to a DNS request. Still uses hardcoded reply.
2010-10-23 10:17:05 +00:00
Kai Blin
719a6bbfed ndr dns: Add simple parser 2010-10-23 10:17:05 +00:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Günther Deschner
b75674c2eb Revert "libndr: fix "excess elements in struct initializer" warning."
This reverts commit a416ff26d6.
2010-10-05 22:55:30 +02:00
Günther Deschner
a416ff26d6 libndr: fix "excess elements in struct initializer" warning.
Guenther
2010-10-05 13:09:05 +00:00
Matthieu Patou
83f3f5e15a ndr: Handle the case of string array with all null terminated strings 2010-10-05 11:19:40 +04:00
Kai Blin
65d2cfdcf1 dnsp: Parse TXT records 2010-10-04 20:59:59 +02:00
Kai Blin
ee7ee2c4c2 ndr: Implement push function for IPv6 addresses
Thanks to Julien Kerihuel for providing the patch that pushed me to
finish my own IPv6 patches.
2010-10-04 20:59:59 +02:00
Kai Blin
013780b1e1 ndr: Add support for pulling/printing an ipv6address type 2010-10-04 20:59:59 +02:00
Stefan Metzmacher
bffa192bfe librpc/ndr: remove 'async' from ndr_interface_call
metze
2010-09-28 23:06:47 +02:00
Andrew Tridgell
83a24ff2ef pidl: prevent ndr_print_*() dying on NULL pointers
when using ndrdump you can get uninitialised structures containing
pointers. Don't segfault when trying to print them
2010-09-16 21:09:17 +10:00
Stefan Metzmacher
11a3d78951 librpc/ndr: correctly implement ndr_charset_length()
Before we ignored the charset type.

metze
2010-08-30 08:44:38 +02:00
Günther Deschner
e2f15d2a25 s4-trusts: fix trustDomainPasswords drsblobs IDL and server side support.
Also remove bogus trustCurrentPasswords struct which we just had because our IDL
was incorrect.

Guenther
2010-08-25 13:27:50 +02:00
Kamen Mazdrashki
7e936e3122 s4-ndr_basic.c: Fix ndr_*_hyper() when [bigendian] data is processed 2010-08-21 00:33:52 +03:00
Kamen Mazdrashki
26efea195a s4-drsuapi: Implement custom printing for drsuapi protocol for
drsuapi_DsReplicaAttribute and drsuapi_DsAttributeValueCtr objects

This makes tracing what data has been transferred much easier
2010-08-21 00:33:52 +03:00
Andrew Tridgell
3828c76c76 ndr: allow ndr_print to print DATA_BLOB
this prints DATA_BLOB structures using the ndr->print() calls

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-08-14 11:58:13 +10:00
Andrew Tridgell
7bb5d353e8 dnsp: dnsp_name is 2 byte aligned
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-08-14 11:58:12 +10:00
Andrew Tridgell
1946ab5a1b s4-dns: ndr_dnsp helper functions
these handle the dnsp_name type
2010-08-05 17:31:29 +10:00
Andreas Schneider
e52f3d8637 s3-librpc: Fixed GUID_from_data_blob() with length of 32.
If we hit the case that the blob length is 32. The code goes to the end
of the function and generates a GUID with garbage.
So try to convert the blob to the GUID and return.
2010-06-29 11:12:12 +02:00
Andreas Schneider
dc2e41a16a librpc: Use switch in GUID_from_data_blob(). 2010-06-28 10:18:12 +02:00
Günther Deschner
bcd4077be6 s3: remove unused librpc/ndr/sid.c.
Guenther
2010-06-03 01:07:17 +02:00
Günther Deschner
7bcd9c5583 libndr: add support for relative_rap_convert.
Will not harm anyone, is only used for rare short (2byte) relative pointers, and
relative_rap_convert is always 0 so far (as all init functions using struct
ndr_pull will zero the struct).

Guenther
2010-05-27 23:25:15 +02:00
Günther Deschner
b75384546a librpc: finally merge ndr_string.c.
Guenther
2010-05-20 13:57:22 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Günther Deschner
566418f1a1 ntprinting: add ntprinting.idl.
This generates convenient unmarshalling routines for pulling out spoolss related
information out of ntprinters.tdb, ntforms.tdb and ntdrivers.tdb.

Guenther
2010-05-14 14:12:57 +02:00
Günther Deschner
3bfceafed7 rap: add rap_status to IDL.
Guenther
2010-04-30 13:44:41 +02:00
Günther Deschner
6a13c028a9 rap: let the rap print function be autogenerated again.
Guenther
2010-04-30 01:27:59 +02:00
Günther Deschner
f85a4ab778 s4-rap: add rap print helpers.
Guenther
2010-04-29 12:05:41 +02:00
Günther Deschner
440075247d spoolss: pretty-print a struct spoolss_Time.
Guenther
2010-04-22 11:53:41 +02:00
Andrew Tridgell
fae84f98e3 libutil: moved the networking defines to util_net.h
These were causing thousands of warnings on solaris8
2010-03-26 17:36:02 +11:00
Kamen Mazdrashki
aa572a4334 s4/drs: Pretty print for drsuapi_SecBufferType
It is a type and mask combined in one DRS field so
we have to make a custom ndr_print implementation for this type
2010-03-24 17:34:44 +02:00
Kamen Mazdrashki
fbaf3b3799 s4/drs: pretty print for drsuapi_DsAddEntry_AttrErrListItem_V1 2010-03-24 17:34:38 +02:00
Andrew Tridgell
55c45110e6 charset: fixed a problem with the global use of the iconv_convenience structure
We had a crash bug where a cached copy of a iconv convenience pointer
was used after being freed when loadparm asked for iconv to
reload. This could happen if a python module used a iconv based
function before loadparm was completed.

The fix is to ensure that any use of this pointer remains valid, by
reusing the pointer itself when it has already been initialised, but
filling in the child elements with the updated values.
2010-03-18 14:18:41 +11:00
Günther Deschner
0e779b573b spoolss: rollback GetPrinterData[Ex] IDL.
Guenther
2010-03-05 15:17:59 +01:00
Günther Deschner
0528515be4 spoolss: rollback SetPrinterData{Ex} IDL.
Guenther
2010-03-05 15:17:58 +01:00
Andrew Bartlett
a7036a9e47 librpc/ndr Remove unused macros
Since the change to the way we pull these OIDs from the wire, these
macros are unused.

Andrew Bartlett
2010-02-20 17:59:13 +11:00
Stefan Metzmacher
76aa37f653 librpc/ndr: don't overwrite the content in ndr_push_relative_ptr2_end()
metze
2010-02-19 08:12:42 +01:00
Günther Deschner
0a8011aa98 spoolss: use ndr_push_spoolss_PrinterInfo2 hand-marshalled version (moves devmode relative pointer down to sd).
Guenther
2010-02-18 15:47:59 +01:00
Günther Deschner
2881742493 spoolss: add spoolss_security_descriptor.
Guenther
2010-02-18 15:47:59 +01:00
Stefan Metzmacher
2059a165ee ndr_spoolss_buf: use LIBNDR_FLAG_NO_NDR_SIZE in NDR_SPOOLSS_SIZE_*
metze
2010-02-18 15:47:57 +01:00
Stefan Metzmacher
a4c3aeb793 spoolss: use subcontext in NDR_SPOOLSS_PUSH_ENUM_OUT macro.
metze
2010-02-18 15:47:56 +01:00
Stefan Metzmacher
8310f02414 libndr: fix ndr_size_* calculation with relative reverse buffers
metze
2010-02-18 15:47:52 +01:00
Stefan Metzmacher
4a76d29374 libndr: for now align reverse relative pointers to 2 bytes by default.
This is just a hack and we should let the callers use FLAG_ALIGN2
explicit in future.

metze
2010-02-18 13:44:04 +01:00
Stefan Metzmacher
31c7780c16 libndr: implement LIBNDR_RELATIVE_REVERSE handling
This is based on Guenther's initial code.

metze
2010-02-18 13:44:03 +01:00
Günther Deschner
05347754ee libndr: store a subcontext buffer size in ndr_push_subcontext_start.
Guenther
2010-02-18 13:44:03 +01:00
Stefan Metzmacher
b5f9c44da5 libndr: give an error when ndr_push_relative_ptr2_start()/_end() is used with the RELATIVE_REVERSE flag
metze
2010-02-18 13:44:03 +01:00
Günther Deschner
a2c34296fa libndr: add LIBNDR_FLAG_NO_RELATIVE_REVERSE so that relative reverse processing
can be disabled for single structure elements.

Guenther
2010-02-18 13:44:02 +01:00
Günther Deschner
ee13a51b05 libndr: add LIBNDR_FLAG_RELATIVE_REVERSE flag.
Guenther
2010-02-18 13:44:02 +01:00
Günther Deschner
c9fa97b017 libndr: change subcontext buffer allocation to allocate on subcontext_start.
Guenther
2010-02-18 13:44:01 +01:00
Stefan Metzmacher
98e143cd31 librpc/ndr: make ndr_push_relative_ptr2() static
metze
2010-02-18 13:44:01 +01:00
Stefan Metzmacher
e03591111a librpc/ndr_krb5pac: use ndr_push_relative_ptr2_start()/_end()
metze
2010-02-18 13:44:01 +01:00