1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

5681 Commits

Author SHA1 Message Date
Volker Lendecke
2dfc898d1a s3: Follow the TALLOC_FREE convention in source3
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jul  6 11:01:05 CEST 2011 on sn-devel-104
2011-07-06 11:01:05 +02:00
Volker Lendecke
6fcb3bbdae s3: Fix Coverity ID 2586 -- NO_EFFECT
tsocket_address_bsd_sockaddr returns ssize_t, and on some systems socklen_t is
unsigned. So (len < 0) could never have turned true.

Volker
2011-07-06 09:50:02 +02:00
Christian Ambach
3d6dafcce1 s3:lib fix non-empty blank lines 2011-07-05 18:41:24 +02:00
Volker Lendecke
1c022d2e41 s3: Return "granted" from share_access_check
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-05 13:28:03 +02:00
Andrew Bartlett
c599d075cb s3-lib Move event_add_idle() to source3/lib/events.c
This allows libauth not to depend on smbd_base.

Andrew Bartlett
2011-07-04 18:53:59 +10:00
Andreas Schneider
c663dfff88 s3-util: Add a get_remote_hostname() function.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:27:55 +10:00
Volker Lendecke
80838491e6 s3: Make cli_cm_open return NTSTATUS
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jul  3 23:57:53 CEST 2011 on sn-devel-104
2011-07-03 23:57:53 +02:00
Andrew Bartlett
d4ef70a764 param: Finish conversion from lp_wins_support() -> lp_we_are_a_wins_server()
Jermey started this in 1997 with 0aa493cc03

(avoiding the duplicate function makes it easier to generate the
struct loadparm_globals).

Andrew Bartlett
2011-07-02 12:31:34 +10:00
Gregor Beck
1765833481 s3:smbldap: make smbldap_connect_system self contained
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul  1 12:37:50 CEST 2011 on sn-devel-104
2011-07-01 12:37:50 +02:00
Gregor Beck
6aff8b19fc s3:smbldap: add a destructor to smbldap_state, just in case
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-01 11:23:56 +02:00
Gregor Beck
796c7ab282 s3:smbldap: let smbldap_free_struct do what it claims to
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-01 11:23:49 +02:00
Gregor Beck
7eb9c70342 s3:smbldap: free the idle event scheduled in smbldap_open in smbldap_close
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-01 11:23:43 +02:00
Gregor Beck
343ef46b9b s3:smbldap: use smbldap_state as memory context for idle event
ensure the event is canceled if the smbldap_state gets freed
this fixes a panic of winbindd if verify_idpool fails

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-01 11:22:56 +02:00
Christian Ambach
2ff0d5882f s3:g_lock: g_lock.tdb should not be executable
TDBs are not executable, so do not create the file with
the execution bit set

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Mon Jun 27 17:09:12 CEST 2011 on sn-devel-104
2011-06-27 17:09:12 +02:00
Andrew Bartlett
b332743ddb s3-param Remove %(DomainSID) support
This also removes the now unused longvar support.  This experiment
never took off.

Fixing this allows me to resolve the the library loop between libsmbconf
and SECRETS3/passdb.

Andreas correctly points out that this loop originally comes from my
patch to obtain the domain sid from passdb
(25cfa29e29), but as I would prefer to
keep that feature, I'm hoping to break the loop here instead.

Andrew Bartlett
2011-06-24 03:52:05 +02:00
Andrew Bartlett
734e1b6812 s3-param Remove 'announce version' parameter
The only users I can find of this on the internet involve confused
users, and our own documentation recommends never setting this.  Don't
confuse our users any longer.

Andrew Bartlett
2011-06-23 13:47:27 +02:00
Andrew Tridgell
cfdeef4c11 s3-smbd: longer explanation of smbd_shim code
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Jun 21 09:05:37 CEST 2011 on sn-devel-104
2011-06-21 09:05:37 +02:00
Andrew Bartlett
b373d0e777 s3-build: Provide a run-time shim to work around duplicate symbols
The become_root() and similar 'smbd' functions that are used widely in
Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c.

These have been replaced by a runtime plugin mechanim, which ensures
that standlone binaries still do nothing, while in smbd the correct
function is used.

This avoids having these as duplicate symbols in the smbd binary,
which can cause unpredictable behaviour.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:51 +10:00
Andrew Bartlett
f83fca1c57 lib/util: Use common d_printf() in the whole codebase
This removes the lang_tdb based varient, the only user of the lang_tdb
code is SWAT, which calls that directly.

'net' and 'pam_winbind' are internationalised using gettext.

Andrew Bartlett
2011-06-21 09:35:34 +10:00
Andrew Bartlett
f3d6b742b1 lib/util Make unused d_vfprintf() static 2011-06-21 09:35:34 +10:00
Volker Lendecke
f0ff6f390a Use tevent_req_oom
This fixes a few Coverity errors
2011-06-20 12:33:24 +02:00
Rusty Russell
cd96271036 source3/lib/util_tdb.c: operation timeout support for TDB2.
TDB2 doesn't have (the racy) signal pointer; the new method is to
override the locking callbacks and do the timeout internally.

The technique here is to invalidate the struct flock when the timeout
occurs, so it works even if it happens before we enter the fcntl() call.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
9eaaf1fc67 tdb2: tdb_parse_record() returns negative errors, not -1.
Fixup callers to tdb_parse_record() to be compatible with tdb2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
61867eaa84 tdb_validate: TDB2 support for tdb_validate_child and tdb_backup.
We don't expose freelist or hash size for TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
4823262439 tdb2: #ifdef out TDB_ERR_NOLOCK and TDB_ERR_LOCK_TIMEOUT.
These don't exist in tdb2.  The former is used in one weird place in
tdb1, and the latter not at all.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
58f7cda1bc tdb_compat: use tdb_errorstr_compat()
Since TDB2 functions return the error directly, tdb_errorstr() taken an
error code, not the tdb as it does in TDB1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
5a7874e119 tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for < 0 instead of == -1.

Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
9850f25633 tdb_chainunlock: ignore return value.
TDB2 returns void here.  tdb_chainunlock will *always* return with the
chain unlocked, but it will complain via the log function if it wasn't
locked.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
868d77bc5b tdb_chainlock: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
d6251996fa tdb_transaction_cancel: ignore return value.
TDB2 returns void here.  tdb_transaction_cancel will *always* return
with the transaction cancelled, but it will complain via the log
function if a transaction wasn't in progress.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
2b1452b2fc tdb_transaction_commit: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
1078eb21c4 tdb_delete: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
058c4f8492 tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Rusty Russell
f72dd0cf0f source3/lib/util.c: str_checksum to use Jenkins hash from CCAN.
Rather than tdb's internal one.
2011-06-20 11:18:34 +02:00
Andrew Bartlett
4162c7b74a errors: reorder error codes for easier s3/s4 comparison 2011-06-17 17:09:00 +10:00
Volker Lendecke
396b646123 s3: Add wins_server_tag_ips()
For a given tag, return the list of all wins servers
2011-06-12 17:07:48 +02:00
Günther Deschner
5672d83b23 source3/lib/privileges.h: fix licence/copyright
Guenther
2011-06-10 15:12:15 +02:00
Günther Deschner
387ddc2c29 source3/lib/netapi/libnetapi.h: fix licence/copyright
Guenther
2011-06-10 15:12:13 +02:00
Richard Sharpe
de8eb77e91 Export init_stat_ex_from_stat for use in VFS modules.
Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Jun 10 13:23:37 CEST 2011 on sn-devel-104
2011-06-10 13:23:37 +02:00
Stefan Metzmacher
e3396cffec s3:lib/util: use %llu consitently (instead of %d) in interpret_pid() to parse the pid
metze
2011-06-09 14:46:22 +02:00
Andrew Bartlett
74eed8f3ed s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
0e95311c23 s3-lib Add myhostname_upper()
This varient always upper cases the hostname, which is needed for the
netbios name.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
daf79e33c7 server_id: Change format to vnn:pid.task_id, pid.task_id or pid
This helps ensure the string cannot be ambiguous, while also ensuring
that it remains simple in the non-cluster case.

The asymmetry of reading get_my_vnn() but writing based on
NONCLUSTER_VNN is acceptable because in the non-clustered case, they
are equal, and in the clustered case we will print the full string.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
f348d148b4 s3-param Remove special case for global_scope()
There is no reason this can't be a normal constant string in the
loadparm system.  (Past reasons were that we didn't have lp_set_cmdline())

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
3ccc760947 s3-param Remove special case for lp_workgroup()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
2077e0f903 s3-lib Use domain in credentials file for domain in credentials
This previously set the workgroup, which is a different thing, but
would have been the default if no domain was specified).  This more
clearly sets the information from the credentials file into the
matching field in the credentials structure.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
16b1c77644 lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
d01dbd6c3f s3-lib Read and write the full struct server_id (except the unique_id)
This is in preperation for making this code the common, only reader
and writer of this structure.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
cc3b75b807 s3-server_id Add task_id to server_id to match Samba4
This will allow this structure to be shared, and allow us to create a
common messaging system between all Samba processes.  Samba4 uses the
task_id to indicate the different tasks within a single unix process.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09 12:40:08 +02:00
Andrew Bartlett
8d4a8389bb s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()
Using the standard macro makes it easier to move code into common, as
TALLOC_MEMDUP isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
d5e6a47f06 s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Andrew Bartlett
8459391e31 s3-talloc Remove unused TALLOC zeronull functions and macro definitions
These have been under #if 0 for a long time now.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Andreas Schneider
8b02b78044 s3-waf: Fix pthreadpool build which needs librt now.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Jun  6 23:31:09 CEST 2011 on sn-devel-104
2011-06-06 23:31:09 +02:00
Volker Lendecke
411c52aba3 s3: Fix two debug messages
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jun  6 14:11:06 CEST 2011 on sn-devel-104
2011-06-06 14:11:06 +02:00
Björn Jacke
4778d35c34 s3/pthreadpool: replace bad portable gettimeofday by clock_gettime
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-06-06 11:48:10 +02:00
Andrew Bartlett
de46ad9084 lib/util use modules_path(), data_path() and shlib_ext() from source3
This brings these helpful utility functions in common, as they are not
based on either loadparm system.

(The 'modules dir' parameter from Samba4 will shortly be removed, so
there is no loss in functionality)

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Andrew Bartlett
876b1b3d19 s3-lib Remove unused lib_path() 2011-06-06 17:37:51 +10:00
Jeremy Allison
3c9b3b2bef Add the same fix to the S3 event backend as the previous commit added to the tevent poll backend.
Metze please check !

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Jun  4 00:27:37 CEST 2011 on sn-devel-104
2011-06-04 00:27:37 +02:00
Volker Lendecke
2ab34a5736 Revert "s3: Mark sockets in error state writable"
This reverts commit 5f6f719564.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jun  1 14:56:25 CEST 2011 on sn-devel-104
2011-06-01 14:56:25 +02:00
Rusty Russell
0204ae6229 lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Jeremy Allison
1cee71713f Change sys_getcd() to take no arguments and always return malloc'ed memory (or NULL).
Part of the efforts to remove PATH_MAX on modern systems.
2011-06-01 02:54:51 +02:00
Günther Deschner
f103e0c39f s3: fix more -Wunused-but-set-variable build warnings.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Jun  1 00:29:30 CEST 2011 on sn-devel-104
2011-06-01 00:29:30 +02:00
Volker Lendecke
5f6f719564 s3: Mark sockets in error state writable
Without this patch, when a socket only has a write event pending, we will never
detect an error condition. I've seen winbind doing

12:19:13.659964 gettimeofday({1306837153, 659984}, NULL) = 0 <0.000016>
12:19:13.660109 poll([{fd=35, events=POLLOUT}, {fd=32, events=POLLIN|POLLHUP}], 2, 9996) = 1 ([{fd=35, revents=POLLERR|POLLHUP}]) <0.000015>
12:19:13.660253 gettimeofday({1306837153, 660269}, NULL) = 0 <0.000013>
12:19:13.660298 poll([{fd=35, events=POLLOUT}, {fd=32, events=POLLIN|POLLHUP}], 2, 9996) = 1 ([{fd=35, revents=POLLERR|POLLHUP}]) <0.000015>

for a while when trying to connect to a DC when the socket had died already.

Volker

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue May 31 20:59:10 CEST 2011 on sn-devel-104
2011-05-31 20:59:10 +02:00
Michael Adam
c2887f0609 s3: add _LIB_IDMAP_CACHE_H_ guard to lib/idmap_cache.h 2011-05-31 18:37:29 +02:00
Michael Adam
2b8803d458 s3: add GPL/Copyright header to lib/idmap_cache.h 2011-05-31 18:37:29 +02:00
Michael Adam
36feb8a240 s3:lib/eventlog/proto.h: add _LIB_EVENTLOG_PROTO_H_ guard 2011-05-31 10:33:55 +02:00
Michael Adam
00530e3d01 s3:lib/eventlog/proto.h: add GPL/Copyright header 2011-05-31 10:33:54 +02:00
Andrew Bartlett
8c8ff2cd6b s3-lib Move source3-specific malloc replacements into a seperate file
This will make it easier to create a dep tree for otherwise simple
libraries.

Andrew Bartlett
2011-05-31 02:57:19 +02:00
Andrew Bartlett
52399f3177 lib/util Move sys_memalign into lib/util/system.c 2011-05-31 02:57:19 +02:00
Andrew Bartlett
9d5b53921d s3-lib Improve indentation of errmap_unix
This also makes it easier to compare and contrast with the source4
version, because the differences here matter, and need to be resolved
with care.

Andrew Bartlett
2011-05-31 02:57:19 +02:00
Andrew Bartlett
aa848c12eb s3-lib: Use ARRAY_SIZE() to walk the error mapping tables
This gives a constant termination condition, and may help the compiler.

Andrew Bartlett
2011-05-31 02:57:19 +02:00
Andrew Bartlett
caf0df2dde s3-build Specify more of the smbconf dependencies
This brings more functions into util_names.c, and util_names.c into
PARAM_WITHOUT_REG_SRC.

This is not yet a full list, that would formalise the implicit
dependency loop.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue May 31 01:43:37 CEST 2011 on sn-devel-104
2011-05-31 01:43:37 +02:00
Andrew Bartlett
0199100348 s3-build Create dbwrap_util subsystem
This contains the functions from dbwrap that don't require lp_
functions, and can therefore be put into a library (without dependency
loops).

Andrew Bartlett
2011-05-31 00:32:08 +02:00
Andrew Bartlett
702d8d5f87 s3-lib Move free_namearray() into it's own file
This makes it easier to have conn_smbd strictly depend on all it's
dependencies.

Andrew Bartlett
2011-05-31 00:32:08 +02:00
Andrew Bartlett
3b7e1ac31c s3-lib Move realloc based string substitution functions out of util_str.c
This makes the dependency set for source3/lib/util_str.c simpiler,
which in turn makes it easier to build a dependency tree.

Andrew Bartlett
2011-05-31 00:32:08 +02:00
Andrew Bartlett
a5a2373979 s3-lib Move sstring_sub() to it's only user and make static
This should not be used more generally, as it is specifically not for
multibyte strings, and uses malloc rather than talloc.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
8d639feed9 s3-param Move init_iconv() to loadparm.c
This assists with some dependency loops

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
381423b1bd libcli/security: move secdesc.c to the top level libcli/security
This code does not rely on lp_ or other source3 only functions, so can
be part of the common library.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
e5dd03d199 s3-globals Remove smbd_event_context() (use server_event_context())
This has been a wrapper around server_event_context() for some time
now, and removing this from dummmysmbd.c assists with library
dependencies.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
33e8126c3c s3-param split service.c into param and smbd components
The dependency chain of find_service can't be satisfied sensibly
outside smbd, so don't include this in the main 'param' subsystem.

Also remove the duplicate find_service() and conn_snum_used() from
dummysmbd.c: The WAF build does not need these dummies any more, but
file.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
53140724f1 s3-lib Move string_init functions into their own file
These have not been moved in common, as they are not talloc-based, but
it helps with dependencies if these are seperated from the rest of
util_str.c

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
8524924a46 s3-smbd provide struct smbd_server_connection * to conn_snum_used
This provides the 'sconn' parameter to this key functions, that
is currently duplicated in dummysmbd.c, which causes duplicate symbol
issues in the waf build.

This has natrually caused a number of consequential changes across the
codebase, includning not passing a messaging context into initial
reload_services():

This causes problems because the global smbd_server_connection isn't
yet set up, as there isn't a connection here, just the initial
process.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Günther Deschner
508e160776 s3: fix some -Wunused-but-set-variable build warnings.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon May 30 17:41:18 CEST 2011 on sn-devel-104
2011-05-30 17:41:18 +02:00
Volker Lendecke
af9afe9f4f s3: Fix Coverity ID 2573: UNUSED_VALUE
Andrew B., please check!
2011-05-20 13:26:04 +02:00
Christian Ambach
642c6ba2b9 Fix Bug 8152 - smbd crash in release_ip()
release_ip() needs the private_data, but it was never saved away
to feed it into release_ip() later

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Thu May 19 21:21:14 CEST 2011 on sn-devel-104
2011-05-19 21:21:14 +02:00
Andrew Bartlett
da662b82b8 s3-lib Replace StrnCaseCmp() with strncasecmp_m()
strncasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Jeremy Allison
9d9d7a7cfd is_my_ipaddr() should recognise loopback addresses as ours.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue May 17 20:05:42 CEST 2011 on sn-devel-104
2011-05-17 20:05:42 +02:00
Andrew Bartlett
ef2a7c6538 s3-netapi Initialise global variables in libnetapi
It is important to initalise the global variables when loading this
configuration for the potentially first time.

Andrew Bartlett
2011-05-13 18:50:23 +02:00
Andrew Bartlett
a37de9a959 s3-libnetapi Don't create a talloc_stackframe() in a global variable
This also ensures that libnetapi_free() invalidates the global
stat_ctx variable, and changes the API so that the behaviour of the
error string routines is to consistently return a allocated string.

Pair-Programmed-With: Günther Deschner <gd@samba.org>

Andrew Bartlett
2011-05-13 18:50:23 +02:00
Günther Deschner
04c101e873 s3-libnetapi/libnetjoin: fix uninitialized variables after the libsmbconf changes.
Guenther
2011-05-13 00:18:49 +02:00
Günther Deschner
7da530e1e4 s3-lib/smbconf: fix uninitialized error code in smbconf_reg_init().
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu May 12 18:09:16 CEST 2011 on sn-devel-104
2011-05-12 18:09:16 +02:00