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

36066 Commits

Author SHA1 Message Date
Andrew Tridgell
f08ec2296e s3-charcnv: removed unused function
lp_failed_convert_char() is not needed any more
2011-03-25 04:37:06 +01:00
Andrew Bartlett
b5616adc8a lib/util/charset rename iconv_convenience to iconv_handle
This better reflects what this structure is

Andrew Bartlett
2011-03-25 04:37:06 +01:00
Andrew Tridgell
7824111d07 s3-charcnv: convert_string_internal() should not display errors
debug error display happens in the convert_string() outer function
2011-03-25 04:37:06 +01:00
Andrew Tridgell
d85dbfb3db s3-string: removed the conv_silent global
use convert_string_error() instead

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
232fb016a1 s3-string: removed last use of conv_silent
This replaces the push_ascii_nstring() implementation with a call to
convert_string_error()

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Bartlett
64258a300f s3-charcnv Add convert_string_error()
This function returns errors rather than printing them.

Andrew Bartlett
2011-03-25 04:37:06 +01:00
Andrew Tridgell
37261928be s3-includes: fixed CONST_DISCARD() to actually discard const
a cast is not enough

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
aaae4123b9 unistr: moved some UCS2 macros into util_unistr
we need to move towards eliminating smb_ucs2_t. This moves a couple of
the related macros into the only file they are used in

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
5a20325c86 libcli: created smb_constants.h
this starts the (long!) process of moving some of the SMB constants
into common files. This just moves the FLAGS2_ defines, which are
needed for common string routines (for FLAGS2_UNICODE_STRINGS)
2011-03-25 04:37:06 +01:00
Andrew Tridgell
2588e71809 s3-libsmb: work our correct length for EA strings 2011-03-25 04:37:06 +01:00
Andrew Tridgell
5ed2039e1e s3-string: sec_len==-1 support is no longer needed
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
4d47493368 s3-dfs: removed the last user of sec_len==-1 in pull_*_base_talloc()
hopefully there aren't any others lurking in the code
2011-03-25 04:37:06 +01:00
Andrew Tridgell
3ceb353939 s3-lib: make pull_ucs2_base_talloc static
it is local to charcnv.c
2011-03-25 04:37:06 +01:00
Andrew Tridgell
980064b76d lib: remove unused pieces of string_wrappers.h 2011-03-25 04:37:06 +01:00
Andrew Tridgell
8cd4a38d72 lib: move the string wrappers from source3/include to common lib/util
this will allow the common charcnv library to use the string wrappers

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
f705fc9002 s3-string: moved fstring functions into their own file
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Michael Adam
8812148e24 s3:dbwrap_ctdb: fix non-locked fetch on persistent db's causing corruption
When doing a non-locking fetch on a record of a persistent db when no
transaction is running, the old behaviour was to fetch locally and
do a ctdb call when the record was not found in the local db.
The call is useless for persistent dbs anyway since they are only
written to using transactions and hence kept in sync, but it is
also harmful, because a ctdb call will bump the record RSN when it
does actually migrate the record from one node to another.

Recently, ctdb has been changed to make all calls do a migration.
This uncovered the client misbehaviour for persistent dbs, because
now _each_ non-locking fetch will render the persistent db inconsistent:
A subsequent transaction which touches the record in question will
fail because the RSNs are out of sync.

This patch fixes this old bug.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Mar 25 01:26:32 CET 2011 on sn-devel-104
2011-03-25 01:26:32 +01:00
Günther Deschner
68529bc14e s3-charcnv: remove unused labels.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Mar 24 23:54:25 CET 2011 on sn-devel-104
2011-03-24 23:54:25 +01:00
Günther Deschner
4a4efc20b4 s3-rpc_server: remove two uneeded include registry/reg_parse_prs.h
Guenther
2011-03-24 23:08:22 +01:00
Günther Deschner
ba510fae23 s3-ldapsam: fix ldapsam_create_user() with existing posix accounts.
We were not taking into account the existing posix attributes and thus failed
while trying to add a 2nd uid attribute.

Found by Sumit.

Guenther
2011-03-24 23:08:22 +01:00
Günther Deschner
63bb64d531 s3-netapi: use cli_get_session_key() in netapi.
Guenther
2011-03-24 23:08:22 +01:00
Volodymyr Khomenko
042aafb87d Fix bug 8021 - Incorrect string termination in volume/volume_name for TRANS2-QUERY_FS_INFO/Info Volume.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 24 23:07:09 CET 2011 on sn-devel-104
2011-03-24 23:07:09 +01:00
Jeremy Allison
5176a0b2af Fix is_myname_or_ipaddr() to be robust against strange DNS setups.
If IPv6 DNS names are turned on, but Samba isn't configured to
listen on an IPv6 interface, then is_myname_or_ipaddr() can return
false on a valid DNS name that it should detect is our own. If the
IPv6 addr is returned by preference, then looking at the first addr
only causes is_myname_or_ipaddr() to fail. We need to look at all the
addresses returned by the DNS lookup and check all of them against
our interface list. This is an order N^2 lookup, but there shouldn't
be enough addresses to make this a practical problem.

Jeremy.
2011-03-24 13:07:36 -07:00
Simo Sorce
72bd60b2fe s3-epmapper: fix vars init and return errors
Properly initialize variables at each cycle.
Convert to the right error when returning EPMAPPER ones.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Thu Mar 24 20:43:49 CET 2011 on sn-devel-104
2011-03-24 20:43:49 +01:00
Simo Sorce
dbe957e48f s3-epmapper: Fix allocation of data on the wrong context
p->mem_ctx is the short-lived per request context, while this data is long
lived, allocate on p instead.
2011-03-24 14:57:12 -04:00
Andreas Schneider
5ebf007233 s3-epmapper: Make sure we work on a description duplicate. 2011-03-24 14:57:12 -04:00
Andreas Schneider
e8912b9ad3 s3-epmapper: Refactor the cleanup of endpoints. 2011-03-24 14:57:12 -04:00
Andreas Schneider
fd89e29e7e s3-epmapper: Use strcmp instead of strequal and check IPv6. 2011-03-24 14:57:12 -04:00
Andreas Schneider
bf1e330f69 s3-epmapper: Increase debug levels. 2011-03-24 14:57:11 -04:00
Volker Lendecke
155c4fbc10 s3: Fix some errno assignments in SMBC_opendir_ctx
Do the assignment as the last action to make sure it's not overwritten

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar 24 17:31:57 CET 2011 on sn-devel-104
2011-03-24 17:31:57 +01:00
Volker Lendecke
9db92bb7f9 s3: Fix Coverity ID 2325: RESOURCE_LEAK 2011-03-24 16:05:53 +01: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
Günther Deschner
2639f0b3ab s3-prototypes: remove protos of some dead functions.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Mar 24 00:52:01 CET 2011 on sn-devel-104
2011-03-24 00:52:01 +01:00
Günther Deschner
b903c28939 librpc: bring more librpc prototypes in common.
Guenther
2011-03-23 23:59:11 +01:00
Günther Deschner
d2d3ac66ec s3-rpc_client: actually call lsa_open_policy2() in rpccli_lsa_open_policy2().
Found by Sumit Bose <sbose@redhat.com>, thanks!

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar 23 20:12:38 CET 2011 on sn-devel-104
2011-03-23 20:12:38 +01:00
Günther Deschner
48c604a3b7 s3-smbta-util: fix some buildwarnings.
Guenther
2011-03-23 19:24:35 +01:00
Günther Deschner
6c8b820b9b s3-globals: silence build warning in smbd_messaging_context().
Guenther
2011-03-23 19:24:35 +01:00
Günther Deschner
d53aac5baa s3-proto: remove some duplicate prototypes.
Guenther
2011-03-23 19:24:35 +01:00
Günther Deschner
8fe4a68da7 s3-includes: remove unused cmdline_lp_ctx.
Guenther
2011-03-23 19:24:35 +01:00
Andreas Schneider
7f1fd07fbe s3-epmapper: Log error if we can't register the endpoint.
Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Wed Mar 23 18:06:54 CET 2011 on sn-devel-104
2011-03-23 18:06:54 +01:00
Andreas Schneider
b38517bbdc s3-epmapper: Setup epm in smbd to forward np requests. 2011-03-23 17:19:22 +01:00
Andreas Schneider
73e985fe4b s3-epmapper: Remove unregister on shutdown.
This is done automatically now.
2011-03-23 17:19:22 +01:00
Andreas Schneider
da1a18cd03 s3-epmd: Cleanup endpoints on service pipe disconnect. 2011-03-23 17:19:22 +01:00
Andreas Schneider
0d97741b9b s3-epmapper: Added function to delete endpoint entries. 2011-03-23 17:19:22 +01:00
Andreas Schneider
e69d922367 s3-rpc_server: Added disconnect callback function. 2011-03-23 17:19:22 +01:00
Andreas Schneider
044eabe425 s3-rpc_server: Rename req to subreq. 2011-03-23 17:19:22 +01:00
Andreas Schneider
73faa82bf9 s3-rpc_server: Implement an endpoint monitor loop. 2011-03-23 17:19:22 +01:00
Andreas Schneider
b2bdc20f65 s3-rpc_server: Added a memory context to the ep regsiter state. 2011-03-23 17:19:22 +01:00
Andreas Schneider
81a2046879 s3-librpc: Leave the epm registration connection open. 2011-03-23 17:19:22 +01:00
Andreas Schneider
d6a1469f43 s3-epmd: Cleanup endpoint mapper correctly. 2011-03-23 17:19:22 +01:00
Andreas Schneider
de775244a9 s3-epmapper: Shutdown the embedded epmapper cleanly. 2011-03-23 17:19:22 +01:00
Andreas Schneider
661ac49794 s3-epmapper: Added a cleanup function. 2011-03-23 17:19:22 +01:00
Andreas Schneider
da718a5961 s3-epmapper: Use DCERPC_AUTH_LEVEL_CONNECT for ep ncalrpc. 2011-03-23 17:19:22 +01:00
Andreas Schneider
3766f3ec0e s3-rpc_server: Rename system_user to ncalrpc_as_system. 2011-03-23 17:19:22 +01:00
Volker Lendecke
177df3c25b s3: Fix a shadowed declaration warning
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 23 17:19:01 CET 2011 on sn-devel-104
2011-03-23 17:19:01 +01:00
Volker Lendecke
67fa593ade s3: Include prctl where it is actually used 2011-03-23 16:30:28 +01:00
Volker Lendecke
da8d36ce96 s3: Attempt to fix the build on FreeBSD 2011-03-23 16:30:27 +01:00
Volker Lendecke
cfa8b36632 s3: Fix Coverity ID 2201, NULL_RETURNS
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 23 13:06:20 CET 2011 on sn-devel-104
2011-03-23 13:06:20 +01:00
Volker Lendecke
e88b9df78b s3: Fix Coverity ID 2202, NULL_RETURNS 2011-03-23 12:19:57 +01:00
Volker Lendecke
e6d76ba832 s3: Fix Coverity ID 2203, NULL_RETURNS 2011-03-23 12:19:56 +01:00
Volker Lendecke
429e84f0d4 s3: Fix a (invalid) uninitialized variable warning
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 23 11:13:14 CET 2011 on sn-devel-104
2011-03-23 11:13:14 +01:00
Andrew Bartlett
41051fd3d3 lib/util: Merge basic string length and comparison functions
These functions now use the codepoints for more accurate string
handling and now form common code.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Mar 23 08:21:54 CET 2011 on sn-devel-104
2011-03-23 08:21:54 +01:00
Andrew Bartlett
89fd1cb767 s3-lib prepare Samba3 to use common codepoint based string functions
This patch changes the source3 util_str.c functions so that the next
patch just contains the move into common code, without code changes.

Andrew Bartlett
2011-03-23 17:32:44 +11:00
Andrew Bartlett
d73db405f7 s3-safe_string: Add checked_strlcpy()
This is strlcpy, just with an extra check of the parameters with
sizeof(), use only where that works.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Mar 23 03:39:35 CET 2011 on sn-devel-104
2011-03-23 03:39:35 +01:00
Andrew Bartlett
1d22c3919d s3-safe_str: Futher simplify the macros by removing indirection
Now that we don't need to pass in the function name and string,
another level of indirection can be safely removed, and the operation
of these macros made much clearer.

Andrew Bartlett
2011-03-23 12:49:39 +11:00
Andrew Bartlett
1923b78209 s3-lib Remove the clobber_region() code.
This code wrote to the full buffer in fstrcpy(), pstrcpy() and other
fixed-length string manipulation functions.

The hope of this code was to find out at run time if we were mixing up
pstring and fstring etc, and to record where this came from.  It has a
runtime performance impact (particularly if compiled with
--enable-developer).

It is being removed because of the complexity it adds, and the
distinct lack of bugs that this complexity has been credited in
finding.

The macro-based compile-time checking of string sizes remains.

Andrew Bartlett
2011-03-23 12:49:39 +11:00
Andrew Tridgell
7aef9c3fe0 s3-config: say which config file we failed to open
saves having to strace it to work that out
2011-03-23 12:19:29 +11:00
Andrew Tridgell
6e8b6358ec fault: fixed smb_panic() prototypes
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Mar 23 01:51:44 CET 2011 on sn-devel-104
2011-03-23 01:51:44 +01:00
Andrew Tridgell
580997ede0 fault: get fault.c ready for use by s4
this moves the s3 specific dumpcore code into source3/lib/dumpcore.c,
and uses a function pointer to setup which smb_panic call to use
2011-03-23 11:03:57 +11:00
Andrew Tridgell
058c3bb923 fault: moved s3 fault.c to top level 2011-03-23 11:03:57 +11:00
Michael Adam
f50a25cc8d s3:idmap: make sure that the id mapping system is initialized for first access 2011-03-22 22:49:58 +01:00
Michael Adam
0109604f53 s3:loadparm: set the default "idmap config * : backend" in initialize_globals(). 2011-03-22 22:49:58 +01:00
Michael Adam
ac8836e77f s3:loadparm: deprecate "idmap uid/gid/backend" and have them set "idmap config * : range/backend" 2011-03-22 22:49:57 +01:00
Michael Adam
474f6a0f75 s3:loadparm: remove unused parameter "idmap read only".
This has not been released yet and is now useless since we
use the "idmap config * : read only = ..." syntax.
2011-03-22 22:49:57 +01:00
Michael Adam
ae5d35b09e s3:idmap: remove (now) unneeded function parse_idmap_module() 2011-03-22 22:49:57 +01:00
Michael Adam
efc1d38b32 s3:idmap: simply call idmap_init_named_domain for "*" in idmap_init_default_domain
The default domain "*" is now treated exactly the same as other explicitly
configured domains.
2011-03-22 22:49:57 +01:00
Michael Adam
ca8c493bfd s3:idmap: remove passdb argument from idmap_init_domain() 2011-03-22 22:49:57 +01:00
Michael Adam
82853a613b s3:idmap: remove the params argument from the init function 2011-03-22 22:49:56 +01:00
Michael Adam
98854207fe s3:idmap: remove special treatment of domain "*" from idmap_ldap_init.
The default config via domain "*" is now treated just as the explicit
domain configs.
2011-03-22 22:49:56 +01:00
Michael Adam
7511f080b4 s3:idmap: remove use of params from idmap_ldap_init - it is not used any more 2011-03-22 22:49:56 +01:00
Michael Adam
0a3627d249 s3:idmap: remove the special treatment of the default domain "*" from idmap_init_domain 2011-03-22 22:49:56 +01:00
Andrew Tridgell
c8297073db s3-fault: removed the cont_fn from fault_setup()
cont_fn() was supposed to be a way to continue after a seg fault. It
could never be called however, as smb_panic() from fault_report()
could never return, as dump_core() never returns at the end of
smb_panic()

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Mar 22 05:07:58 CET 2011 on sn-devel-104
2011-03-22 05:07:58 +01:00
Stefan Metzmacher
f0ec69b535 s3:smbd: access checks should not depend on share mode flags
metze
2011-03-21 22:35:19 +01:00
Volker Lendecke
16155812e0 s3: Fix Coverity ID 1048, CHECKED_RETURN
This is a real bug: tevent_req_set_endtime already calls tevent_req_nomem.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Mar 21 16:29:22 CET 2011 on sn-devel-104
2011-03-21 16:29:22 +01:00
Volker Lendecke
8dc93bed09 s3: Fix Coverity ID 770, REVERSE_INULL
We dereference "res" in various places, no point in checking. All current
callers send "res!=NULL".
2011-03-21 15:40:10 +01:00
Volker Lendecke
4828feddb7 s3: Fix early tldap_search cancels
A callback of tldap_search_send might not interested in the rest of the results
and could do a TALLOC_FREE of the search request. In this case, "subreq" is
already free'ed. So we have to set it to pending before the callback is called.
The TALLOC_FREE of the search request will set it to non-pending again via
tldap_msg_destructor.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Mar 20 11:26:57 CET 2011 on sn-devel-104
2011-03-20 11:26:57 +01:00
Stefan Metzmacher
daddccb514 s3:smbd: remove uses of "./" in unlink_internals()
Commit 78b931ce6c tried to do that,
but didn't have any effect.

metze
2011-03-19 10:10:25 +01:00
Christian Ambach
ed46dfc4f1 s3: use getgrset() when it is available
When getgrouplist() is not defined, use getgrset() if it is defined
instead of using the initgroups() + getgroups() combo

Major contributions from Yannick Bergeron <yaberger@ca.ibm.com>

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Mar 19 10:09:38 CET 2011 on sn-devel-104
2011-03-19 10:09:38 +01:00
Günther Deschner
33b8d0a6ff s3-waf: use HAVE_ADS env to decide whether to build libads.so
Guenther
2011-03-19 00:11:18 +01:00
Günther Deschner
c53e7f8d58 s3-build: use HAVE_ADS define in some more places.
Guenther
2011-03-19 00:11:18 +01:00
Jeremy Allison
89b6af0982 SMB2 renames return SHARING_VIOLATION if there is any existing oplock on a file.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar 18 23:39:49 CET 2011 on sn-devel-104
2011-03-18 23:39:49 +01:00
Volker Lendecke
4b347a1b17 s3: Add "print notify backchannel" parameter to prevent us doing the reverse print notify connection.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar 18 21:34:30 CET 2011 on sn-devel-104
2011-03-18 21:34:30 +01:00
Christian Ambach
8ae1f32229 s3:autorid make sure we set the mapping status correct on early exit
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Mar 18 16:30:36 CET 2011 on sn-devel-104
2011-03-18 16:30:36 +01:00
Volker Lendecke
5006dcff4e idmap-autorid: Slightly simplify idmap_autorid_get_domainrange
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:37 +01:00
Volker Lendecke
3947845041 idmap-autorid: Slightly simplify idmap_autorid_get_domainrange
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:37 +01:00
Volker Lendecke
6e9fb07958 idmap-autorid: Remove an unused variable
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:37 +01:00
Volker Lendecke
10953c60bd idmap-autorid: Use talloc_tos() in idmap_autorid_id_to_sid
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
6ba85beeec idmap-autorid: Remove an else branch
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
6ab0d8b998 idmap-autorid: Remove an unused variable
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00
Volker Lendecke
d1970a8da9 idmap-autorid: Remove an unused parameter
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2011-03-18 15:46:36 +01:00