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

5686 Commits

Author SHA1 Message Date
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
Andreas Schneider
e1f0b91c5f libsmbconf: Convert smbconf_transaction_*() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:22 +02:00
Andreas Schneider
72d15f0c03 libsmbconf: Convert smbconf_delete_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:22 +02:00
Andreas Schneider
d911bafea6 libsmbconf: Convert smbconf_set_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:22 +02:00
Andreas Schneider
9f9711490a libsmbconf: Convert smbconf_get_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:21 +02:00
Andreas Schneider
e19c4f278b libsmbconf: Convert smbconf_delete_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:21 +02:00
Andreas Schneider
ff5838d97a libsmbconf: Convert smbconf_get_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:21 +02:00
Andreas Schneider
ddc28a683f libsmbconf: Convert smbconf_set_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:21 +02:00
Andreas Schneider
fbd7626656 libsmbconf: Convert smbconf_delete_share() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:21 +02:00
Andreas Schneider
7f355e05f9 libsmbconf: Convert smbconf_get_share() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:21 +02:00
Andreas Schneider
7af2876e45 libsmbconf: Convert smbconf_create_share() to smbErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:20 +02:00
Andreas Schneider
823cd472b4 libsmbconf: Convert smbconf_get_share_names() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:20 +02:00
Andreas Schneider
720ba8e7e7 libsmbconf: Convert smbconf_drop() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:20 +02:00
Andreas Schneider
9082c7cee8 libsmbconf: Convert smbconf_open() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:20 +02:00
Andreas Schneider
29eea4b09a libsmbconf: Convert smbconf_init() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
2011-05-10 19:13:20 +02:00
Andrew Tridgell
628fcd111a s3-events: tevent_internal.h is not a public header
We need to use the "foo.h" form instead of the <foo.h> form for
headers that are not installed publicly. Otherwise when an external
version of tevent is used we won't find the header and the build will
fail.

Note that this creates a structure dependency between the
tevent structures in the external library and the headers in our
source tree. That is not ideal, but is currently OK as the waf build
will only use the external library if it is at least the same version
as the internal tree, which means it will actually be the same
version, as we release the external version from our tree.

We should come up with a better solution, but for now this allows
openchange to build again.

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue May 10 16:06:40 CEST 2011 on sn-devel-104
2011-05-10 16:06:40 +02:00
Rusty Russell
7deeacae2b gencache: don't use CLEAR_IF_FIRST as fallback.
CLEAR_IF_FIRST only works if *all* openers use that flag.

So just truncate the file: it's racy, but that's what we're doing anyway.

We'd really need a TDB_OPENCHECK_OR_CLEAR flag to do this properly (or in
TDB2, a open hook at the right point).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-04-19 12:06:05 +09:30
Andrew Bartlett
897ef820a4 s3-lib Use common lib/socket code for get_interfaces() et al 2011-05-08 12:57:04 +02:00
Andrew Bartlett
f946668b7a Improve debug messages when creating socket directories
This makes clear what the permissions error and directory name actually is

Andrew Bartlett
2011-05-08 10:56:28 +02:00
Günther Deschner
27022587e3 s3-libsmb: move protos to libsmb/proto.h
Guenther
2011-05-06 16:37:18 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Andrew Bartlett
8f1810362d lib/util Use lib/util/ms_fnmatch.c in common for gen_fnmatch()
gen_fnmatch was a duplicate symbol in the top level build.

gen_fnmatch() used for simple non-CIFS pattern matching, so selecting
the lib/util implementation should not be a concern.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
cad704e836 errors: Remove unused unix_to_werror() 2011-05-06 07:51:24 +02:00
Andrew Bartlett
fa289e8982 s3-lib Remove unused dos error codes from errmap_unix
This also makes unix_nt_errmap private to errmap_unix.c and errormap.c
so the tables themselves cannot be duplicate symbols until merged.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
1475013963 lib/util Move source3 tdb_wrap_open() into the common code.
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in
the top level build, these options are not available for these
databases.  However, having two different tdb_wrap lists is a worse
fate, so this will do for now.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Jeremy Allison
a5a84415e2 Fix broken interface to set_namearray() - don't modify incoming string. 2011-05-06 01:44:07 +02:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Jeremy Allison
02af307585 More simple const fixes. 2011-05-05 23:56:07 +02:00
Jeremy Allison
e131c94ac1 More const fixes for compiler warnings from the waf build. 2011-05-05 23:56:07 +02:00
Jeremy Allison
9efea96d16 More const compiler warning fixes. 2011-05-05 11:29:01 -07:00
Jeremy Allison
4f41be356a Fix many const compiler warnings. 2011-05-05 10:41:59 -07:00
Günther Deschner
63ebc918e4 s3-lib: run minimal_includes.pl.
Guenther
2011-05-05 02:05:26 +02:00
Jeremy Allison
2938fe6f90 Fold null terminator into listlen length, change to strlcpy. 2011-05-04 12:12:14 -07:00
Günther Deschner
4fa2bac6e7 s3-system: move LOCK_ defines to lib/system.c
Guenther
2011-05-03 21:03:47 +02:00
Andrew Bartlett
f08250eb55 s3-ctdb Fix duplicate function name due to packet -> ctdb_packet rename.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-05-03 14:38:29 +02:00
Andrew Bartlett
2c32534d5b lib/util Use lib/util/util_str.c in common, including strequal()
strequal() is now implemented in terms of strcasecmp_m() which is
tested in smbtorture and which does not talloc() for ASCII or
non-ASCII comparions, and has an ASCII fast-path.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
80f1d49b61 lib/util/charset Use push_string and talloc_strupper/strlower from common code
The only caller of push_string() (not to be confused with
push_string_check()) in the common code was encode_pw_buffer(), and it
didn't use the alignment or STR_UPPER flags.

The talloc_strupper() and talloc_strlower() functions are tested in
smbtorture, and are next_codepoint() based.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
7c083caf74 s3-lib make push_ucs2() static 2011-05-03 07:37:07 +02:00
Andrew Bartlett
2742ec0e34 Remove strlower_m() and strupper_m() from source4 and common code.
This function is problematic because a string may expand in size when
changed into upper or lower case.  This will then push characters off
the end of the string in the s3 implementation, or panic in the former
s4 implementation.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
eea783e04c lib/util Move set_socket_options() into common code. 2011-05-03 07:37:07 +02:00
Andrew Bartlett
fbea52f74a lib/util Move more network utility functions from source3 into lib/util
This will help with the merge of the interfaces layer.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
85fa87ea82 s3-ctdb Rename packet file and files to ctdb_packet
This avoids a conflicts with the Samba4 packet.c, as these is only
used in CTDB

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Günther Deschner
c1f3ff7340 s3-util: move valid_share_pathname() to lib/util.c
Guenther
2011-05-02 15:03:43 +02:00
Andrew Bartlett
1018dd1826 s3-lib: Rely on uint64_t in conv_str_size()
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Apr 30 05:58:35 CEST 2011 on sn-devel-104
2011-04-30 05:58:35 +02:00
Günther Deschner
bc781bf7d9 s3-proto: remove duplicate prototypes.
Guenther
2011-04-29 21:01:05 +02:00
Günther Deschner
50883cfeb4 s3-tevent: only include ../lib/util/tevent wrappers where needed.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
2011-04-29 14:00:30 +02:00
Günther Deschner
12476223c6 s3-tsocket: only include ../lib/tsocket/tsocket.h where needed.
Guenther
2011-04-29 12:19:04 +02:00
Andrew Bartlett
93ace5cc24 lib/util Re-merge the string_sub() and all_string_sub() from source3
Andrew Bartlett
2011-04-29 16:38:15 +10:00
Andrew Bartlett
9a9124b087 lib/util/charset Move strstr_m() to the top level 2011-04-29 16:38:14 +10:00
Andrew Bartlett
6021af4fd3 libcli/smb Move attrib_string in common 2011-04-29 16:38:14 +10:00
Andrew Bartlett
724915f721 s3-client Add TALLOC_CTX argument to attrib_string().
This ensures the caller knows where the memory was allocated.

Andrew Bartlett
2011-04-29 16:38:14 +10:00
Andrew Bartlett
0520da2bbe s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
0eca33bbf6 s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
08c90d6f2d s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
0a3c84b554 s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
317e19aeb3 s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:12 +10:00
Andrew Bartlett
7f66ebde2e s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:12 +10:00
Andrew Bartlett
0df4061cff lib/util/charset Merge talloc-based pull and push charset functions
These were copied from source3/lib/charcnv.c

Andrew Bartlett
2011-04-28 05:30:20 +02:00
Volker Lendecke
a8a6433fec s3: Properly clean up in pthreadpool_init in case of failure
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Apr 27 23:57:19 CEST 2011 on sn-devel-104
2011-04-27 23:57:19 +02:00
Günther Deschner
66b26195d2 s3-waf: add pthreadpool support.
Volker, please check.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Apr 27 17:57:32 CEST 2011 on sn-devel-104
2011-04-27 17:57:32 +02:00
Günther Deschner
ee0b0dd3a1 s3-netapi: Fix Coverity CID #2302: FORWARD_NULL
Guenther
2011-04-27 16:51:02 +02:00
Volker Lendecke
dbc36befb5 s3: Allow unlimited parallelism in pthreadpool 2011-04-26 12:41:56 +02:00
Stefan Metzmacher
a3a38ee90a s3:lib/util_sock: listen on IPv6 addresses with IPV6_ONLY (bug #7383)
This avoids getting IPv4 addresses as mapped IPv6 addresses
(e.g. ::ffff:192.168.0.1).

Before the bahavior was inconsistent between operating system
and distributions. Some system have IPV6_ONLY as default.

Now we consistently get AF_INET for IPv4 addresses and AF_INET6
for IPv6 addresses.

It also makes it possible to listen only on IPv6 now
as "::" doesn't imply "0.0.0.0" anymore. Which also
avoids confusing log messages that we were not able to
bind to "0.0.0.0".

metze
2011-04-25 17:42:03 +02:00
Stefan Metzmacher
4bfe2d5655 s3:lib/access: normalize IPv4 mapped IPv6 addresses in both directions (bug #7383)
metze
2011-04-25 17:41:56 +02:00
Volker Lendecke
f4a0f856f3 s3: pthreadpool_sig_fd->pthreadpool_signal_fd 2011-04-25 09:50:32 +02:00
Volker Lendecke
3c405f5e1d s3: Tiny doc for pthreadpool 2011-04-25 09:50:32 +02:00
Volker Lendecke
62689d8166 s3: Many pthreadpool fixes
In particular, this makes it fork-safe
2011-04-25 09:50:32 +02:00
Stefan Metzmacher
f7bc84409a s3:rpc_client: map fault codes to NTSTATUS with dcerpc_fault_to_nt_status()
Most fault codes have a NTSTATUS representation, so use that.

This brings the fault handling in common with the source4/librpc/rpc code,
which make it possible to share more highlevel code, between source3 and
source4 as the error checking can be the same now.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Apr 24 10:44:53 CEST 2011 on sn-devel-104
2011-04-24 10:44:53 +02:00
Volker Lendecke
123e5c1a75 s3: Fix Coverity ID 2478, UNINIT
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Apr 23 14:11:22 CEST 2011 on sn-devel-104
2011-04-23 14:11:22 +02:00
Stefan Metzmacher
5186209277 s3:lib/sysquota: remove ugly LARGE_SMB_OFF_T ifdef's
We rely on uint64_t for a long time now...

metze
2011-04-23 10:44:16 +02:00
Volker Lendecke
3e8a8fad59 s3: Fix Coverity ID 2307, NULL_RETURNS 2011-04-22 10:06:35 +02:00
Volker Lendecke
7e7ad53cbd s3: Fix Coverity ID 1340, NULL_RETURNS 2011-04-22 10:06:33 +02:00
Andrew Bartlett
79e6fea774 lib/util/charset create _handle functions for convert_string() et al
This is now API compatible with the existing code in lib/util/charset

lazy_initialize_conv() is no longer called as init_iconv() is called
when the smb.conf is processed, and get_conv_handle() will auto-init
with defaults if required.

load_case_tables_library() is no longer requried as all binaries and
libraries already load these in their entry points, as otherwise all
the other string functions would fail.

Andrew Bartlett
2011-04-20 04:31:07 +02:00
Volker Lendecke
0bf7c96464 s3: Use \0 instead of NULL when 0-terminating a string
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Apr 17 12:26:15 CEST 2011 on sn-devel-104
2011-04-17 12:26:15 +02:00
Volker Lendecke
35c71231ac s3: Remove an unused variable 2011-04-16 15:35:05 +02:00
Günther Deschner
7ece43b15e s3-build: make sure we pick up system tdb and talloc via #include.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Apr 14 12:56:28 CEST 2011 on sn-devel-104
2011-04-14 12:56:27 +02:00
Andrew Bartlett
e1078b87de lib/util Move alpha_strcpy() from s3 into common code
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 14 09:21:59 CEST 2011 on sn-devel-104
2011-04-14 09:21:59 +02:00
Andrew Bartlett
3d7998bce1 s3-lib Remove very unused (#if 0) strncpyn
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 14 06:27:31 CEST 2011 on sn-devel-104
2011-04-14 06:27:31 +02:00
Andrew Bartlett
b1873be59b s3-lib Remove unused string_append 2011-04-14 12:47:45 +10:00
Andrew Bartlett
72dcf6d47c s3-lib Move unix_strlower and unix_strupper to their only users. 2011-04-14 12:42:52 +10:00
Andrew Bartlett
aad2c19da7 s3-lib Remove unused str_ascii_charnum() 2011-04-14 12:34:51 +10:00
Andrew Bartlett
9d62ee2a81 s3-lib Move strisnormal to it's only user in mangle_hash.c 2011-04-14 12:31:18 +10:00
Günther Deschner
321587e44a s3-includes: only include acl prototypes when needed.
Guenther
2011-04-14 00:47:57 +02:00
Günther Deschner
9824e2e5ee s3-rpc_client: add and use rpc_client/rpc_client.h.
Guenther
2011-04-13 22:23:59 +02:00
Günther Deschner
d2d976d835 s3-netapi: remove two shadowed variables.
Guenther
2011-04-13 22:23:59 +02:00
Günther Deschner
8b8014198c s3-util_sock: very brief documentation for open_socket_out().
The most important bit is to document that timeout is in MILLIseconds, not
seconds.

Guenther
2011-04-13 18:13:34 +02:00
Andrew Bartlett
4158e9a7e5 s3-charcnv: Move convert_string() et al to lib/util/charset
This is the first step to this being the common convert_string
implementation.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
17ccff973a lib/util: Make string_replace from s3 common
The s4 implementation didn't do multibyte strings, so was only good
for '/' which is known to be safe in all multibyte charsets.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
b2e37d9ce1 lib/util ucs2_align is identical, put it in common
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
2eea91957c lib/util Move simple string routines into common code.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
9941dfe9f6 lib/util/charset Move source3/lib/util_unistr.c to the common code.
This file (largely) contains functions to deal with UTF16 strings.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
ce2f217bd2 s3-lib Move strdup_w to it's only user in mangle_hash.c
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
e3138f2ffe s3-lib Move isvalid83_w to mangle_hash.c
This means that there is no need for the 'valid.dat' table to be
loaded by anything other than smbd, so the unloader is also removed.

The concept of a 'valid dos character' has been replaced by the hash2
mangle method.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
d458f6b3bd s3-lib make static and remove more _w functions
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
a82fba3499 s3-lib Remove unused #define
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
ba2b7f72c0 s3-lib Remove unused skip_unibuf()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00