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
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
Andrew Bartlett
8fcda44a1f s3-lib: Remove unused _w functions.
In general we don't manipulate UTF16 strings internally, particularly
as they are also multibyte, so are no easier to work with than UTF8.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
5cfb0bdfd8 s3-lib Correct comment in strlen_w()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
43deb9745b s3-lib Remove more unused fstring.c functions
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
c8a5fa3fa9 s3-charcnv: make pull_ucs2 static
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
b6a8418ff6 s3-lib: Remove unused pull_ucs2_fstring()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:06 +10:00
Günther Deschner
510e61871c s3-util: separate out cmdline helpers.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Apr 12 13:06:27 CEST 2011 on sn-devel-104
2011-04-12 13:06:27 +02:00
Günther Deschner
7ea03840fc s3-netapi: use dcerpc_try_samr_connects().
Guenther
2011-04-12 12:20:43 +02:00
Günther Deschner
3acd6bde58 s3-netapi: use libnetapi_get_binding_handle().
Guenther
2011-04-12 12:20:43 +02:00
Günther Deschner
0eece6202c s3-netapi: add libnetapi_get_binding_handle().
Guenther
2011-04-12 12:20:43 +02:00
Volker Lendecke
0958695022 s3: Fix timeout calculation in event_add_to_poll_args
In the initial phase nmbd does not yet have timed events. This led to nmbd
not correctly registering its names in make test and certainly everywhere
else.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Apr 11 14:35:45 CEST 2011 on sn-devel-104
2011-04-11 14:35:45 +02:00
Sumit Bose
3626579cc2 s3: Fix tldap_make_mod_blob_int() debug messages
Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Apr  6 13:10:30 CEST 2011 on sn-devel-104
2011-04-06 13:10:30 +02:00
Sumit Bose
f3b1a68f5f s3-smbldap: make octet_strings/DATA_BLOBs const.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-04-06 11:53:56 +02:00
Günther Deschner
c4974eec01 s3-smbldap: support storing octet_strings/DATA_BLOBs.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
2011-04-06 11:53:56 +02:00
Gregor Beck
8fc8c88007 s3: add function srprs_quoted to parse strings written with cbuf_print_quoted 2011-04-04 15:57:36 +02:00
Gregor Beck
9272614d9d s3: add function cbuf_print_quoted 2011-04-04 15:57:36 +02:00
Gregor Beck
340f20ddb0 s3: add function dbwrap_traverse 2011-04-04 15:57:35 +02:00
Gregor Beck
84019ea528 s3: add function dbwrap_trans_traverse 2011-04-04 15:57:35 +02:00
Gregor Beck
10cec2f0ec s3: fix cbuf_swapptr 2011-04-04 15:57:35 +02:00
Michael Adam
3a3c118a7e s3:dbwrap_ctdb: in ctdb_delete, send a SCHEDULE_FOR_DELETION control to local ctdbd
This way, the record will be scheduled for fast vacuuming.

This is sent with the NOREPLY flag, so ctd should not sent
a reply packet and samba does not expect one. Hence, it
is not important for the success of the db_ctdb_delete command
whether or not the ctdbd we are running against supports the
SCHEDULE_FOR_DELETION control.
2011-03-31 18:10:22 +02:00
Michael Adam
0e240bd6a9 s3:ctdb: pass the ctdb control flags to the ctdb daemon when sending the control
The only flag that is currently used is the NOREPLY flag to indicate that
the client expects no reply packet. This needs to get passed down to the
ctdb daemon so that it really does not send a reply.
2011-03-31 18:10:22 +02:00
Michael Adam
6cc8457cd5 s3:ctdb: samba can now handle the NOREPLY flag
Revert "samba3 can't handle NOREPLY yet"

This reverts commit 9bf211db6d.
2011-03-31 18:10:22 +02:00
Michael Adam
fd41b4f1a6 s3:ctdb: correctly handle cstatus if CTDB_CTRL_FLAG_NOREPLY is set. 2011-03-31 18:10:22 +02:00
Günther Deschner
a730dff783 s3-libndr: add ../librpc/ndr/libndr.h include in some places.
Guenther
2011-03-31 00:14:01 +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
d546adeab5 Change convert_string_internal() and convert_string_error() to bool return.
Move closer to makeing all convert_string_XXX functions return bool.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Mar 30 20:58:10 CEST 2011 on sn-devel-104
2011-03-30 20:58:10 +02:00
Jeremy Allison
048471d14b Fix the nstring calls to use the correct sizes. 2011-03-30 10:13:01 -07:00
Volker Lendecke
8f4e39f6f7 s3: Fix g_lock_lock after the select/poll conversion
Without clustering we don't have an fd to listen on, and sys_poll
needs one element of space

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 30 18:36:50 CEST 2011 on sn-devel-104
2011-03-30 18:36:50 +02:00
Günther Deschner
6206156465 s3-winbind: try to fix the build on hosts w/o winbind support.
Guenther
2011-03-30 15:14:54 +02:00
Andrew Bartlett
a64958a880 lib/util Move base64 functions into lib/util/base64.c
Andrew Bartlett
2011-03-30 12:17:05 +02:00
Andrew Bartlett
48d0abe0b5 s3:lib make lazy_initialize_conv() static 2011-03-30 12:17:05 +02:00
Günther Deschner
fbd0ff69ec s3: try to fix the build on some non-linux buildfarm machines.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar 30 11:39:31 CEST 2011 on sn-devel-104
2011-03-30 11:39:31 +02:00
Günther Deschner
72833e416f s3-ctdb_wrap: remove unused variable from db_ctdb_fetch_persistent().
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar 30 02:00:50 CEST 2011 on sn-devel-104
2011-03-30 02:00:50 +02:00
Günther Deschner
c2d6260f10 s3: only include lib/privileges.h where needed.
This finally removes the global lsa.h inclusion.

Guenther
2011-03-30 01:13:10 +02:00
Günther Deschner
643b08dd25 s3: include ../librpc/gen_ndr/lsa.h where needed.
Guenther
2011-03-30 01:13:10 +02:00
Günther Deschner
ab36d597e7 s3-messages: make ndr_messaging.h part of messages.h.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
7e73214ebf s3-auth: use auth.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
8560c00a50 s3: move filename_util.c out of source3/smbd to source3/lib.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
6b76909f5e s3-build: only include intl protos where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
235f148590 s3-passdb: use passdb headers where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
a22a53ea44 s3-passdb: move util_builtin.c out of passdb.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
7d798ac485 s3-passdb: move util_unixsids.c out of passdb.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
bcee6c1fe2 s3-passdb: move util_wellknown.c out of passdb.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
9bd06f6bc7 s3-build: only include transfer_file.h where needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
0a250f4946 registry: create and use shared libcli/registry/util_reg.h header.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
49fcf653b1 s3-includes: only include system/passwd.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
21a78b88cc s3-includes: only include system/capability.h when needed.
Guenther
2011-03-30 01:13:06 +02:00
Günther Deschner
739ca0e7db s3-includes: only include system/glob.h when needed.
Guenther
2011-03-30 01:13:06 +02:00
Günther Deschner
89ca4875cd s3-includes: only include system/syslog.h when needed.
Guenther
2011-03-30 01:13:06 +02:00
Günther Deschner
d85f140826 s3-winbind: remove global inclusion of libwbclient.
Guenther
2011-03-30 01:13:06 +02:00
Günther Deschner
96487959e9 lib/util/util_pw: share more code between lib/util/util_pw.c and source3/lib/username.c
Guenther
2011-03-30 01:13:06 +02:00
Günther Deschner
64421129b6 lib/util/util_pw: share sys_get{pw,gr} group of calls.
Guenther
2011-03-30 01:13:06 +02:00
Volker Lendecke
1e50f9a5c2 charconv: Fix the slow-path character conversions
This reverts a part of 0189087e25. That one might have fixed the fast path,
but it broke the slow path. convert_string_internal returns 0/-1 despite the
size_t result type and the misleading comment. If you follow the path to
smb_iconv and for example iconv_copy(), you will see that this routine returns
0 even after it copied something.

How to check: Use German locale, and do an smbclient "allinfo" on a file
modified in march (März in German). Notice the "ä". Before 0189087 this printed
correctly, after 0189087 it cut off the fields after the M for März.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Mar 29 19:17:41 CEST 2011 on sn-devel-104
2011-03-29 19:17:41 +02:00
David Disseldorp
db966efe8a =?UTF-8?q?alpha=5Fstrcpy()=20is=20a=20utility=20function=20which=20reportedly:
=20Strips=20out=20all=20but=20'a-Z0-9'=20and=20the=20character=20in=20other=5Fsafe=5Fchars=20and
=20replaces=20with=20'=5F'.
=20This=20statement=20does=20not=20currently=20hold=20true=20in=20all=20cases=20(e.g.=20src=20=3D
=20"=D0=A2=D0=90=D0=9D=D0=A6=D0=95=D0=92=D0=90=D0=A2=D0=AC").?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
2011-03-29 01:35:23 +02:00
Volker Lendecke
1a1675bbfe s3: Fix Coverity ID 590: DEADCODE 2011-03-27 22:22:10 +02:00
Jeremy Allison
ad2e243f8d Fix bug 8040 - smbclient segfaults when a Cyrillic netbios name or workgroup is configured.
As discovered by David Disseldorp <ddiss@suse.de>, convert_string_talloc()
doesn't always return consistent results for a zero length string. The
API states an incoming string must *always* contain the terminating null,
but unfotunately too much code expects passing in a zero source length
to return a null terminated string, so at least ensure we return a
correct null string in the required character set and return the
correct length.

Also ensure we cannot return a zero length for a converted string
(we ensure that the returned buffer is always allocated and zero
terminated anyway) as calling code depends on the fact that returning
true from this function will *always* return a non-zero length (as
it must include the terminating null).

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar 25 23:25:40 CET 2011 on sn-devel-104
2011-03-25 23:25:40 +01:00
Günther Deschner
5779460f3f s3-netapi: fix memoryleak while not using talloc_tos() in cli_get_session_key() usage.
Thanks Volker!

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Mar 25 18:21:18 CET 2011 on sn-devel-104
2011-03-25 18:21:18 +01:00
Andrew Tridgell
0189087e25 s3-charcnv: fixed converted_size return in fast paths 2011-03-25 04:37:06 +01:00
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
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
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
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
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
63bb64d531 s3-netapi: use cli_get_session_key() in netapi.
Guenther
2011-03-24 23:08:22 +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
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
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
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
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
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
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
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
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
c53e7f8d58 s3-build: use HAVE_ADS define in some more places.
Guenther
2011-03-19 00:11:18 +01:00
Günther Deschner
1d516f0d76 s3-username: rename static getpwnam_alloc to getpwnam_alloc_cached.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Mar 17 00:32:40 CET 2011 on sn-devel-104
2011-03-17 00:32:40 +01:00
Günther Deschner
3aa9d3005a s3-build: only include asn1 headers where actually needed.
Guenther
2011-03-16 23:46:18 +01:00
Volker Lendecke
ab37eae79c s3: Fix Coverity ID 2231, REVERSE_INULL
No point in checking for !ctx after dereferencing it

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 16 22:51:52 CET 2011 on sn-devel-104
2011-03-16 22:51:52 +01:00
Günther Deschner
9f9e195124 s3-packet: only include packet.h where needed.
Guenther
2011-03-16 16:56:47 +01:00
Günther Deschner
1f6aecb5cf s3-interfaces: only include interfaces.h where needed.
Guenther
2011-03-16 16:56:46 +01:00
Günther Deschner
fad0112373 s3-build: stop including ldap and lber headers everywhere in the code.
Instead use new header smb_ldap.h where all LDAP API related things are handled,
while smbldap.h only deals with our smbldap_X() API.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar 16 10:54:51 CET 2011 on sn-devel-104
2011-03-16 10:54:50 +01:00
Volker Lendecke
831ff4519e s3: Use jenkins hash for str_checksum, fix bug 8010
From the bugreport:

I have a folder with ~90 photos: IMG_XXXX.JPG where XXXX is a four digit
number, almost consecutive (photos from camera for one day).
Current implementation gives about 30 different checksums for this set of
files.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Mar 16 01:15:41 CET 2011 on sn-devel-104
2011-03-16 01:15:41 +01:00
Volker Lendecke
b0667f7fda s3: Remove some unused code 2011-03-15 09:15:36 +01:00
Volker Lendecke
a4d7b3a1df s3: "hex_encode" does the same as "binary_string" 2011-03-15 09:15:35 +01:00
Jeremy Allison
e59a950c04 Fix bug #8005 - smbtorture4 BASE-TCONDEV fails when tested on Samba
When pulling non-aligned ucs2 strings, we neglected to add in the
pad byte to the buffer length we've eaten. This caused the device
string in TCONX (which seems to be one of the few places that uses
non-aligned ucs2 strings) to be incorrectly read.

Volker please check.

Jeremy.
2011-03-14 16:12:31 -07:00
Volker Lendecke
8dfa224c13 s3: Change tldap_entry_attributes to the "array,count" convention
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Mar 14 22:02:35 CET 2011 on sn-devel-104
2011-03-14 22:02:35 +01:00
Volker Lendecke
16b007c223 Quite some callers of sid_split_rid do not care about the rid 2011-03-10 18:48:34 +01:00
Andreas Schneider
b181cd8465 s3-smbd: Increase debug level von context messages. 2011-03-09 09:28:42 +01:00
Volker Lendecke
7b139a49dc s3: Use dom_sid_string_buf in sid_to_fstring
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar  3 22:56:57 CET 2011 on sn-devel-104
2011-03-03 22:56:56 +01:00
Günther Deschner
93db9489fd s3-libds: use already existing ../libds/common/flag_mapping.h header.
Guenther
2011-03-02 22:17:17 +01:00
Michael Adam
d9945e9369 s3:idmap_cache: remove an leftover wip comment
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Mar  2 14:55:20 CET 2011 on sn-devel-104
2011-03-02 14:55:20 +01:00
Gregor Beck
8aa69c1f81 s3: adjust loglevel for idmap_cache
Signed-off-by: Michael Adam <obnox@samba.org>
2011-03-02 14:10:22 +01:00
Günther Deschner
ea29261186 s3-sessionid: avoid global include of sessionid.h
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar  2 12:58:12 CET 2011 on sn-devel-104
2011-03-02 12:58:12 +01:00
Günther Deschner
8643683dd8 s3-server_id: only include server_id where needed.
Guenther
2011-03-02 12:12:31 +01:00
Andrew Bartlett
5f5ca913b7 lib/util: new merged debug system
This is the s3 debug system, with a number of changes to tidy it up
for common use.  The debug class system is simplified by the removal of the
ISSET table, the system no longer attempts to cope with assignment of
DEBUGLEVEL, and the full class table is always available (rather than
just DEBUGLEVEL_CLASS[DBCG_ALL]) from startup.  It is also no longer
confusingly described as a hack, but as the initial table.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Mar  1 04:32:12 CET 2011 on sn-devel-104
2011-03-01 04:32:12 +01:00
Andrew Bartlett
ec1009f7a0 s3-debug Always use C99 true/false rather than True and False
This will help with the merge into the common code.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Mar  1 02:58:55 CET 2011 on sn-devel-104
2011-03-01 02:58:55 +01:00
Andrew Bartlett
608c8e7872 lib/util/time: Merge time functions from source3/lib/time.c 2011-03-01 02:13:22 +01:00
Andreas Schneider
bf18403c81 s3-rpc_client: Move client pipe functions to own header. 2011-02-28 18:15:04 +01:00
Volker Lendecke
a2970dfaef s3: Eliminate sys_select_intr from read_fd_with_timeout 2011-02-28 16:40:19 +01:00
Volker Lendecke
884984ae0a s3: Add poll_intr_one_fd 2011-02-28 16:40:19 +01:00
Volker Lendecke
81bdaafab3 s3: Eliminate sys_select from g_lock_lock 2011-02-28 16:40:19 +01:00
Volker Lendecke
2b0057c2cb s3: Eliminate select from packet_fd_read_sync 2011-02-28 16:40:19 +01:00
Volker Lendecke
deb58b2e94 s3: Add poll_one_fd() 2011-02-28 16:40:19 +01:00
Volker Lendecke
cf7d331511 s3: Remove select-based s3 event backend 2011-02-28 16:40:19 +01:00
Volker Lendecke
ea5e1c5ecb s3: Use poll for the event loop 2011-02-28 16:40:19 +01:00
Volker Lendecke
5e93e3e88f s3: Add timeval_to_msec 2011-02-28 16:40:19 +01:00
Gregor Beck
42a4a9cbc3 s3: add functions to remove entries from idmap cache 2011-02-28 12:58:43 +01:00
Volker Lendecke
fec0baacb6 s3: Make is_zero_addr take a sockaddr_storage
All callers had to cast this anyway

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Feb 27 11:02:53 CET 2011 on sn-devel-104
2011-02-27 11:02:53 +01:00
Jeremy Allison
c8a242d9fc dirfd doesn't exist in some platforms.
Hack that should get the buildfarm back to green.
Ensure dirfd() needs to be defined before we properly return fdopendir.
This will do until we get a proper dirfd() defined in libreplace.

From http://www.gnu.org/software/hello/manual/gnulib/dirfd.html

This function is missing on some platforms: AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 10, mingw.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 26 04:19:55 CET 2011 on sn-devel-104
2011-02-26 04:19:55 +01:00
Jeremy Allison
ebb2fb7efb Removed unused code check_dos_char_slowly. 2011-02-25 17:49:26 -08:00
Justin Maggard
6141b6a49f Detect Mac OS X as a separate client type. 2011-02-25 01:57:04 +01:00
Stefan Metzmacher
d7fa349052 s3:auth: change num_groups to from size_t to uint32_t
This will help with the change from UNIX_USER_TOKEN to security_unix_token

metze
2011-02-22 16:20:11 +11:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11:00
Volker Lendecke
e99d1de3c4 s3: Protect tldap_errstr against a NULL ld 2011-02-20 15:59:48 +01:00
Volker Lendecke
88f5215560 s3: Slightly simplify Get_Pwnam_alloc 2011-02-20 10:23:29 +01:00
Volker Lendecke
13bfae95e7 s3: Fix some nonempty blank lines 2011-02-20 10:23:28 +01:00
Andrew Bartlett
1ad8e5229f lib/util/charset Add back setlocale(), but only when called from binaries
When called from a library, we don't want to call this, as we may
overwrite some of our calling program's context.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Feb 18 09:29:35 CET 2011 on sn-devel-104
2011-02-18 09:29:35 +01:00
Andrew Bartlett
2a3a86a86f lib/util/charcnv Move iconv handle setup in common
We now use the struct smb_iconv_convenience at the core of all our
iconv code, and use global_iconv_convenience for the callers that
don't specify one.

Andrew Bartlett
2011-02-18 18:41:01 +11:00
Andrew Bartlett
5155a5f5c1 s3-charcnv Don't genreate valid_table on the fly, rely on valid.dat
This file is always installed, and is only even required for the old,
depricated mangle hash method.

Andrew Bartlett
2011-02-18 18:41:01 +11:00
Andrew Bartlett
8afc271e2a lib/util/charset Use top level iconv.c in source3
The two files were very similar already, the only change required was
to adopt the s3 module registration fucntion name.

(NTSTATUS wasn't used as the charset code does not otherwise use that
type).

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-18 18:41:00 +11:00
Andrew Bartlett
92faeaeea8 charset Remove use of {isupper,islower,toupper,tolower}_w functions
These now call the common _m functions that consider UTF16 code points.

This removes the code which will make up a 'lame' table in memory, as
this can just as correctly be handled by running the algorithm at runtime (which is to call toupper() and tolower() on characters < 128).

When used, a top level waf build will always locate the correct table
- in the build tree or outside - due to relinking the installed
binary.

Andrew Bartlett
2011-02-18 17:00:34 +11:00
Andrew Bartlett
09c4a5cd9b s3-cluster Always fill in the clustering vnn element
This avoids this structure being partially uninitialised.

Adnrew Bartlett
2011-02-17 16:02:19 +01:00
Günther Deschner
bc83400d81 nsswitch: make wb_reqtrans a common subsystem.
Guenther
2011-02-17 00:52:42 +01:00
Günther Deschner
80b4e1e985 s3: move some defines to a better place.
Guenther
2011-02-14 11:47:19 +01:00
Volker Lendecke
26051b8aaa s3: Use tlap_simple_recv in tldap_sasl_bind_recv 2011-02-13 12:11:53 +01:00
Volker Lendecke
f6df16d9d2 s3: Add error checking to asn1_read_OctetString_talloc 2011-02-13 12:11:53 +01:00
Volker Lendecke
80accd3946 Fix typos 2011-02-13 12:11:53 +01:00
Volker Lendecke
fe551d6815 s3: Convert tldap_entry_values args to "array, count" 2011-02-13 12:11:53 +01:00
Volker Lendecke
84abb428f6 s3: Add an explicit counter to tldap_add_mod_[blobs|str] 2011-02-13 12:11:53 +01:00
Volker Lendecke
158c1e315b s3: Convert tldap_make_mod_fmt args to "array, count" 2011-02-13 12:11:52 +01:00
Volker Lendecke
6375e6993e s3: Convert tldap_make_mod_blob args to "array, count" 2011-02-13 12:11:52 +01:00
Volker Lendecke
67e6874651 s3: Convert tldap_make_mod_blob_int args to "array, count" 2011-02-13 12:11:52 +01:00
Volker Lendecke
3363bab875 s3: Convert tldap_add_blob_vals args to "array, count" 2011-02-13 12:11:52 +01:00
Volker Lendecke
6b492a1741 s3: Convert tldap_add_mod_blobs args to "array, count" 2011-02-13 12:11:52 +01:00
Volker Lendecke
90c8de54a0 s3: Add more checks and better fallback to addrchange
From http://netsplit.com/2011/02/09/the-proc-connector-and-socket-filters/ I
learned a bit more about netlink...

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Feb 11 10:47:09 CET 2011 on sn-devel-104
2011-02-11 10:47:09 +01:00
Volker Lendecke
efa460e291 s3: Align the args in tldap_modify
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Feb 10 23:20:05 CET 2011 on sn-devel-104
2011-02-10 23:20:05 +01:00
Volker Lendecke
b524e58f9a s3: Align tldap_add and tldap_add_send 2011-02-10 22:34:01 +01:00
Günther Deschner
fa0c6c1a9e s3-system: fix malloc/talloc mismatch in sys_popen().
Guenther
2011-02-10 18:37:18 +01:00
Andrew Bartlett
2b05ba77b4 s3-auth Rename cryptic 'ptok' to security_token
This will allow the auth_serversupplied_info struct to be migrated
to auth_session_info easier.

Adnrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-10 06:51:06 +01:00
Jeremy Allison
c377b0e718 Fix up some buildfarm warnings. 2011-02-09 21:21:04 +01:00
Michael Adam
015b47fa14 s3:popt: add POPT_COMMON_OPTION to provide only the "--option" feature 2011-02-09 14:00:34 +01:00
Jeremy Allison
1911d483e5 Add fdopendir(). 2011-02-08 15:05:59 -08:00
Volker Lendecke
5a0ee95b95 s3: Fix some nonempty blank lines and some typos
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Feb  9 00:01:45 CET 2011 on sn-devel-104
2011-02-09 00:01:45 +01:00
Günther Deschner
34722c72f6 pam: share pam errors in a common location.
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
Stefan Metzmacher
e9c45a3973 s3:lib/addrchange: set ctx->sock to -1 after close
The makes the code more consistent with similar destructors.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Feb  4 15:52:55 CET 2011 on sn-devel-104
2011-02-04 15:52:55 +01:00
Stefan Metzmacher
d8d5a3fb3a s3:lib/addrchange: remove unused pointer
metze
2011-02-04 15:04:58 +01:00
Stefan Metzmacher
ff935ddf8b s3:lib/addrchange: let addrchange_done() retry and ignore unknown message types
Messages like RTM_NEWLINK should be just ignored.

metze
2011-02-04 15:04:58 +01:00
Stefan Metzmacher
91e1c8dc38 s3:lib: allow_trailing_dollar should only allow '$'
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Feb  3 00:33:48 CET 2011 on sn-devel-104
2011-02-03 00:33:48 +01:00
Günther Deschner
e32b50894b s3-libnetapi: prefer dcerpc_lsa_X functions.
Guenther
2011-02-02 19:02:09 +01:00
Günther Deschner
50be0b2c1e s3: Remove superfluous ;
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Feb  2 15:44:21 CET 2011 on sn-devel-104
2011-02-02 15:44:21 +01:00
Volker Lendecke
1c9cf16c95 s3: Fix the build on sles8
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Feb  1 18:34:33 CET 2011 on sn-devel-104
2011-02-01 18:34:33 +01:00
Volker Lendecke
80acca1ebf s3: Add support for AF_NETLINK addr notifications
Via an AF_NETLINK socket, the Linux kernel can inform us when IP addresses are
added or dropped.

This will first be used in winbind, it was triggered by clustering with ctdb.
When winbind is connected to a domain controller and ctdb decides to move away
the IP address that winbind used locally for the connection to the DC, the next
request will run into a timeout. winbind sends out its request, but the
response will never arrive: The IP is gone.

It will also be interesting for more reliable online/offline detection, but
this is something for future winbind refactoring.
2011-02-01 15:11:06 +01:00
Günther Deschner
f9af242886 s3-libnetapi: prefer dcerpc_samr_X functions in lib/netapi/user.c.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Feb  1 13:41:42 CET 2011 on sn-devel-104
2011-02-01 13:41:42 +01:00
Günther Deschner
32fb4f5206 s3-libnetapi: prefer dcerpc_samr_X functions in lib/netapi/samr.c.
Guenther
2011-02-01 12:49:58 +01:00
Günther Deschner
b76657f8d9 s3-libnetapi: prefer dcerpc_samr_X functions in lib/netapi/localgroup.c.
Guenther
2011-02-01 12:49:52 +01:00
Günther Deschner
7f63018117 s3-libnetapi: prefer dcerpc_samr_X functions in lib/netapi/group.c.
Guenther
2011-02-01 12:49:44 +01:00
Stefan Metzmacher
ad10289ebc s3:lib/events: use DLIST_DEMOTE() for fd events
This makes sure that fd events doesn't dry out,
because a fd with a lower number is busy.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jan 31 16:59:44 CET 2011 on sn-devel-104
2011-01-31 16:59:44 +01:00
Stefan Metzmacher
1f2be10ebf s3:lib/events: don't loop over fd events is select gave -1
metze
2011-01-31 16:16:09 +01:00
Stefan Metzmacher
19d3779274 Revert "s3:events: Call all ready fd event handlers on each iteration of the main loop"
This reverts commit 455fccf86b.

I'll add a more generic fix for this problem.

metze
2011-01-31 16:16:09 +01:00
Günther Deschner
1232fb5a1e s3-rpc_client: remove some more obsolete cli_X.h header files.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Jan 28 11:18:44 CET 2011 on sn-devel-104
2011-01-28 11:18:44 +01:00
Andreas Schneider
2c47368d68 s3-lib: Fixed a missing return value in tldap.
s3-lib: Fixed a missing return value in tldap.
2011-01-26 14:20:37 -08:00
Kai Blin
278c6f8fc5 errormap: Add unix_to_werror() function
While this function technically is closest to the
map_nt_status_from_unix() function, I think it is better to keep the new
function in line with our usual fooerror_to_barerror() naming scheme.

Signed-off-by: Kai Blin <kai@samba.org>

Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Wed Jan 26 23:07:24 CET 2011 on sn-devel-104
2011-01-26 23:07:24 +01:00
Stefan Metzmacher
0dc1eee0b8 libcli/ldap: use lib/ldb_compat.h for the s3 build
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jan 24 14:55:50 CET 2011 on sn-devel-104
2011-01-24 14:55:50 +01:00
Volker Lendecke
509dd57d68 Revert "s3: Fix an infinite loop"
This reverts commit 61f7d7cdec.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jan 24 10:10:43 CET 2011 on sn-devel-104
2011-01-24 10:10:43 +01:00
Volker Lendecke
61f7d7cdec s3: Fix an infinite loop
If select returns EBADF (which should NEVER happen), then we loop infinitely
because the select masks seem all active.

I've been given an strace where smbd floods syslog with inotify-related
error messages. The strace shows that select returns EBADF, and we're calling
the inotify event callback. It then complains there's no data on the inotify
fd.

Metze, please check!

We might need to fix this in 3.4 and 3.5 as well. And we need to find the
deeper reason where we close a file descriptor and don't tell the events
system about it.

Volker

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jan 23 10:05:39 CET 2011 on sn-devel-104
2011-01-23 10:05:39 +01:00
Volker Lendecke
46a3019d36 s3: Fix the code to immediately disconnect from a non-working ctdbd 2011-01-21 10:10:02 +01:00
Günther Deschner
1ef94dffe6 s3-libnetapi: prefer dcerpc_srvsvc_X functions.
Guenther

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-01-13 14:11:16 +01:00
Günther Deschner
425753ebe3 s3-libnetapi: prefer dcerpc_netr_X functions.
Guenther

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-01-13 12:21:08 +01:00
Günther Deschner
415a390ba8 s3-libnetapi: add missing error check after switchting to dcerpc_wkssvc_X functions.
Guenther
2011-01-12 13:32:10 +01:00
Günther Deschner
d1954ce8e7 s3-initshutdown: prefer dcerpc_initshutdown_X functions.
Guenther
2011-01-11 17:12:04 +01:00
Günther Deschner
4920390913 s3-wkssvc: prefer dcerpc_wkssvc_X functions.
Guenther
2011-01-11 17:09:25 +01:00
Stefan Metzmacher
f1d15ea54c s3:lib/netapi: don't set SAMR_FIELD_FULL_NAME if we just want to set the account name (bug #7896)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Dec 30 18:09:13 CET 2010 on sn-devel-104
2010-12-30 18:09:13 +01:00
Jeremy Allison
30d29e64cb All calls to event_add_to_select_args() call GetTimeOfDay() and
pass this in as the &now parameter. Push this call inside of
event_add_to_select_args() to the correct point so it doesn't
get called unless needed.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Dec 23 01:08:11 CET 2010 on sn-devel-104
2010-12-23 01:08:11 +01:00
Volker Lendecke
03b8b8e199 s3: Remove unused open_any_socket_out
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Dec 22 17:27:29 CET 2010 on sn-devel-104
2010-12-22 17:27:29 +01:00
Stefan Metzmacher
d9be7e9368 s3:lib/gencache: fix memory leak in error path
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Dec 22 15:08:30 CET 2010 on sn-devel-104
2010-12-22 15:08:30 +01:00
Jeremy Allison
8998f4b013 Added call out to a Linux-compatible fallocate() when we need to extend a file
allocation extent without changing end-of-file size.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 21 02:41:24 CET 2010 on sn-devel-104
2010-12-21 02:41:23 +01:00
Volker Lendecke
a881d6ab86 wb_reqtrans is not used in libwbclient 2010-12-19 23:25:06 +01:00
Volker Lendecke
d39fedaa69 s3: FreeBSD has getpeereid(), use it 2010-12-19 23:25:06 +01:00
Volker Lendecke
43e42b4e77 s3: Fix some typos 2010-12-19 23:25:06 +01:00
Volker Lendecke
d60d49efb0 s3: Fix serverid_exists
In the cluster case it can happen that a node just died and we did not yet have
the time to clean up serverid.tdb. If the corresponding serverid.tdb record
that represented a process was migrated away from the dead record, it
represents existence of a process where it is already dead.
2010-12-19 23:25:06 +01:00
Jeremy Allison
e071fd711d Fix read/write calls over sockets to cope with EAGAIN/EWOULDBLOCK for non-blocking sockets. 2010-12-15 01:38:16 +01:00
Volker Lendecke
1a91fe90b6 s3: Add gencache_iterate_blobs 2010-11-28 14:19:19 +01:00
Volker Lendecke
62afdb9cc0 s3: Convert gencache_get_data_blob to gencache_parse 2010-11-28 14:19:19 +01:00
Volker Lendecke
9843103b7d s3: Add gencache_parse 2010-11-28 14:19:19 +01:00
Andrew Bartlett
6ead7fbae5 s3-libnetapi Load case tables earlier
If we don't load the case tables as the 'first' thing we do, we will
segfault on the first case insensitive string comparison.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Nov 24 09:21:05 CET 2010 on sn-devel-104
2010-11-24 09:21:05 +01:00
Andrew Bartlett
11b060d345 s3-libnetapi Add function header comments
Andrew Bartlett
2010-11-24 08:37:04 +01:00