1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

27377 Commits

Author SHA1 Message Date
Jelmer Vernooij
d3199276ea Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-01-21 14:24:16 +01:00
Jelmer Vernooij
11a25f9050 Allow calling DCE/RPC server implementations directly using
rpc_pipe_client.
2009-01-21 14:05:51 +01:00
Stefan Metzmacher
bc42f251c3 merged-build: propare to fix make test4
metze
2009-01-21 13:35:36 +01:00
Volker Lendecke
2bb1266796 Fix a typo 2009-01-21 11:21:00 +01:00
Volker Lendecke
55dfad40af "userdom_struct" does not need "full_name" anymore -- unused 2009-01-20 23:10:16 +01:00
Volker Lendecke
d7d251f8c7 Fix some nonempty blank lines 2009-01-20 23:10:16 +01:00
Volker Lendecke
520f88143b Remove some unused code 2009-01-20 16:41:32 +01:00
Volker Lendecke
b8b6cddb29 Remove some smb fsp knowledge from rpc_server/
np_open/read/write don't have to know about files_struct
2009-01-20 16:41:14 +01:00
Volker Lendecke
bd4718d281 Make use of TALLOC_FREE 2009-01-20 14:34:51 +01:00
Stefan Metzmacher
930b3c15da s3:messaging: also recreate the local messaging backend in messaging_reinit()
This prepares the change to use signal events in the tdb backend.

metze
2009-01-20 00:41:45 +01:00
Stefan Metzmacher
26e863e6dd s3: reinit_after_fork() should reinit the event context before the messaging context
Because messaging_reinit() may add events to the event context, which will
removed by event_context_reinit().

metze
2009-01-20 00:41:20 +01:00
Stefan Metzmacher
8d203d3cab s3:events: add support for signal events
metze
2009-01-20 00:41:09 +01:00
Stefan Metzmacher
fcf9f72e04 s3:smbd: call message_dispatch() before processing incoming PDUs
This is a hack to fix races which happen with the RAW-RENAME and RAW-OPLOCK
tests. We should try to remove it later.

metze
2009-01-20 00:40:56 +01:00
Stefan Metzmacher
4feafd7c7b s3:idmap_tdb: convert to the dbwrap api
metze
2009-01-19 17:06:41 +01:00
Stefan Metzmacher
535311d187 s3:dbwrap: add dbwrap_delete(), dbwrap_store() and dbwrap_fetch()
The _bystring function are now just tiny wrappers.

metze
2009-01-19 17:06:03 +01:00
Stefan Metzmacher
a83b327f1b s3:dbwrap: add get_flags() hook to db_context
metze
2009-01-19 17:06:02 +01:00
Volker Lendecke
e58a8c169c Fix the same bug as 8b618d0 fixes, this time in winbindd_passdb.c 2009-01-19 11:49:18 +01:00
Volker Lendecke
fe9dd8710d Remove unused tdb_search_keys() 2009-01-19 00:05:56 +01:00
Volker Lendecke
eaec865148 simplify gencache_iterate a bit, fix nonempty blank lines 2009-01-19 00:05:56 +01:00
Volker Lendecke
a9542ddcb7 libnetapi_open_pipe does not need to return cli_state
The user session key is also available in rpccli->auth->user_session_key

Guenther, please check!

Thanks,

Volker
2009-01-18 20:10:06 +01:00
Volker Lendecke
0dbd396862 Add a macro async_req_setup()
This streamlines setting up a multi-step async request a bit
2009-01-18 16:45:07 +01:00
Volker Lendecke
c45b6ec29a Add code to torture the fragmentation code a bit 2009-01-18 15:40:45 +01:00
Volker Lendecke
a158ebbe49 Remove unused functions 2009-01-18 15:40:45 +01:00
Volker Lendecke
28c35b4c04 Make rpc_pipe_bind async 2009-01-18 15:40:45 +01:00
Volker Lendecke
ecb5184ce5 Fix an uninitialized variable 2009-01-18 15:40:45 +01:00
Volker Lendecke
3f9f188877 Remove sync rpc_api_pipe_req 2009-01-18 15:40:45 +01:00
Volker Lendecke
396ed3b363 Add async rpc_api_pipe_req 2009-01-18 15:40:45 +01:00
Volker Lendecke
8a1c6c2c99 Tiny simplification of prs_set_offset 2009-01-18 15:40:44 +01:00
Volker Lendecke
c655f19e1f Add rpc_write_send/recv 2009-01-18 15:40:44 +01:00
Volker Lendecke
f96335afc0 Remove unused sync functions 2009-01-18 15:40:44 +01:00
Volker Lendecke
f6740aa7ad Make rpc_api_pipe async 2009-01-18 15:40:44 +01:00
Volker Lendecke
761d164420 Rename the async version of get_complete_pdu to get_complete_frag 2009-01-18 15:40:44 +01:00
Volker Lendecke
5e6f3eaae9 Move initialization of the reply prs_struct to rpc_api_pipe 2009-01-18 15:40:44 +01:00
Volker Lendecke
5987c82697 Always check the max send sizein rpc_api_pipe, not just with DEVELOPER 2009-01-18 15:40:44 +01:00
Volker Lendecke
6d47418bc1 Make cli_api_pipe async
Also move the transport switch to this routine
2009-01-18 15:40:43 +01:00
Volker Lendecke
173d6c84a6 Remove sync rpc_read wrapper 2009-01-18 15:40:43 +01:00
Volker Lendecke
5d71fe8043 Make cli_pipe_get_current_pdu async, rename it to get_current_pdu 2009-01-18 15:40:43 +01:00
Volker Lendecke
30413f12b9 Make rpc_read async 2009-01-18 15:40:43 +01:00
Volker Lendecke
8b618d0ba9 Fix some real bugs found by "type-punned" gcc warnings
Type-casting does not the right thing if used the way it used to be. The
function arguments have not been uint32_t's, but the type cast made the calling
routine believe so. Not good...

The assignment xxx=account_policy_temp does however type-convert properly,
potentially cutting off the top-bits.
2009-01-18 13:26:21 +01:00
Derrell Lipman
6d300399b5 Determine case sensitivity based on file system attributes.
- Most of the time, we can determine from the file system we're connecting to
  whether it supports case sensitivity. In those cases, we now set the
  internal case sensitivity flag automatically. For those cases where the
  request to retrieve file system attributes fails, we'll use the
  user-specified option value.

Derrell
2009-01-17 13:33:39 -05:00
Volker Lendecke
9b3c38f4af Slightly simplify the paths after rpc_api_pipe() 2009-01-17 11:27:32 +01:00
Derrell Lipman
c6b4f3526a [Bug 6022] smbc_urlencode and smbc_urldecode were not exported
- Since the revamp of libsmbclient, there has still been an external
  declaration for smbc_urlencode and smbc_urldecode in libsmbclient.h, yet
  those functions were renamed and made private. The two choices were to
  remove the function names from libsmbclient.h or to make them public
  again. The reported requested that they be public. This commit makes it so.

Derrell
2009-01-16 20:26:46 -05:00
Derrell Lipman
1c77c7f3d5 Treat file names in POSIX-like case-sensitive fashion by default
*** THIS COMMIT CAUSES A CHANGE OF DEFAULT BEHAVIOR IN libsmbclient!!! ***

- libsmbclient now calls cli_set_case_sensitive() for a new CLI. By default,
  it requests case-sensitive, but the old behavior of case-insensitive can be
  requested with smbc_setOptionCaseSensitive(context, False);

  The change of behavior is considered a bug fix, as it was previously
  possible to accidentally overwrite a file that had the same case-insensitive
  name but a different case-sensitive name as a previously-existing file,
  while creating a new file.

Derrell
2009-01-16 16:41:36 -05:00
Andreas Schneider
3fe974c4fe Fix a segfault if ? is there but the options are NULL. This is the case if SMBC_parse_path is called by SMBC_stat_ctx. 2009-01-16 12:26:46 -08:00
Jeremy Allison
d03133e696 Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba 2009-01-16 12:25:35 -08:00
Jeremy Allison
fb904194c9 "First thing, kill all the language lawyers" :-). Ensure possible insane compilers
can't kill us later.
Jeremy.
2009-01-16 11:55:01 -08:00
Gerald (Jerry) Carter
073e9f42f0 ads_connect: Return immediately on a failed GC connection.
ads_connect_gc() feeds an explicit server to ads_connect().  However, if the
resulting connection fails, the latter function was attempting to find a DC
on its own and continuing the connection.  This resulting in GC searches being
sent over a connection using port 389 which would fail when using the base
search suffix outside of the domain naming context.

The fix is to fail immediately in ads_connect() since the GC lookup ordering
is handled already in ads_connect_gc().
2009-01-16 12:15:33 -06:00
Stefan Metzmacher
dc6edf1ab4 s3:cluster: fix ctdb ipv6 support
We need to use CTDB_CONTROL_TCP_CLIENT instead of CTDB_CONTROL_TCP_ADD.

CTDB_CONTROL_TCP_CLIENT has support for 2 modes in newer ctdb versions:

- with struct ctdb_control_tcp it only supports ipv4.
- with struct ctdb_control_tcp_addr it supports ipv4 and ipv6.

You need new header files which defines struct ctdb_control_tcp_addr,
but at runtime it should be fine to work against older
ctdb versions (<= 1.0.68).

metze
2009-01-16 15:16:59 +01:00
Stefan Metzmacher
554a89df0c s3:vfs_fileid: readd "fileid:algorithm" as option.
"fileid:mapping" is still supported as fallback.

metze
2009-01-16 15:16:58 +01:00
Volker Lendecke
0d7ca8e89e remove the old chain_reply code 2009-01-16 13:00:45 +01:00
Volker Lendecke
ddaa65ef6e Correctly calculate the offset for read&x 2009-01-16 13:00:44 +01:00
Volker Lendecke
ba981128ac Add a new implementation of chain_reply
This the global variable "orig_inbuf" in the old chain_reply code. This global
variable was one of the reasons why we had the silly restriction to not allow
async requests within a request chain.
2009-01-16 13:00:28 +01:00
Günther Deschner
740c5ce081 s3-eventlog: fix _eventlog_CloseEventLog.
Guenther
2009-01-16 11:52:49 +01:00
Tim Prouty
abf37b3e23 s3: Remove an incorrect const 2009-01-15 21:59:20 -08:00
Michael Adam
584da3fea3 s3: put the gpo cache dir under cache_dir instead of lock_dir
Michael
2009-01-16 01:02:25 +01:00
Michael Adam
166ffc0d0d s3: put printing/ under cache_dir, not lock_dir
Michael
2009-01-16 01:02:24 +01:00
Michael Adam
0cea990d75 s3: put netsamlogon_cache.tdb into cache_dir instead of lock_dir
Michael
2009-01-16 01:02:24 +01:00
Michael Adam
99ef38c84f s3:put the browse list into cache_dir, not lock_dir.
Michael
2009-01-16 01:02:23 +01:00
Michael Adam
edbc7efa35 s3:winbindd: put winbindd_cache.tdb into cache_dir, not lock_dir.
Michael
2009-01-16 01:02:23 +01:00
Michael Adam
62e7849ddc s3:passdb: put login_cache.tdb into cache_dir, not lock_dir.
Michael
2009-01-16 01:02:22 +01:00
Michael Adam
0b87f210f1 s3:libads: use lock_path for creating paths to local krb5.conf files
instead of manually doing an asprintf with lp_lockdir()

Michael

squash
2009-01-16 01:02:22 +01:00
Michael Adam
37c77643f9 s3:libads: give create_local_private_krb5_conf_for_domain() a common exit point
Michael
2009-01-16 01:02:22 +01:00
Michael Adam
2fb694df23 s3:vfs_xattr_tdb: don't leak state_path() to talloc_tos in xattr_tdb_init().
Michael
2009-01-16 01:02:21 +01:00
Michael Adam
26e5e4f6fd s3:nmbd: don't leak state_path() to talloc_tos() in wins_write_database()
Michael
2009-01-16 01:02:21 +01:00
Michael Adam
2f06192523 s3:vfs_acl_tdb: don't leak state_path() to talloc_tos() in acl_tdb_init()
Michael
2009-01-16 01:02:21 +01:00
Jeremy Allison
660d7794b6 Fix bug #6040 - Missing <th> header in Status page.
Based on a patch from pkg-samba-maint@lists.alioth.debian.org.
Jeremy.
2009-01-15 15:55:17 -08:00
Jeremy Allison
6fd867f036 Allow reinit_after_fork to be called safely from within swat and other binaries that don't have
an event context or a msg context. Fixes crash bug in swat.
Jeremy.
2009-01-15 15:52:41 -08:00
Günther Deschner
9361c73c2f winreg: fix winreg_EnumValue callers.
Guenther
2009-01-16 00:28:46 +01:00
Günther Deschner
64d8eb0cee s3-util: for convenience, provide format comments in tdb_unpack().
Guenther
2009-01-16 00:28:45 +01:00
Günther Deschner
0d2c0da7d2 s3-eventlog: remove whitespace.
Guenther
2009-01-16 00:28:45 +01:00
Günther Deschner
6dc18f2cab s3-eventlog: some minor code cleanup in eventlog server.
Guenther
2009-01-16 00:28:45 +01:00
Michael Adam
39ec8791f8 s3: make better use of ccache by not including version.h in every C-file.
version.h changes rather frequently. Since it is included via includes.h,
this means each C file will be a cache miss. This applies to the following
situations:

* When building a new package with a new Samba version

* building in a git branch after calling mkversion.sh
  after a new commit (i.e. virtually always)

This patch improves the situation in the following way:

* remove inlude "version.h" from includes.h

* Use samba_version_string() instead of SAMBA_VERSION_STRING
  in files that use no other macro from version.h instead of
  SAMBA_VERSION_STRING.

* explicitly include "version.h" in those files that use more
  macros from "version.h" than just SAMBA_VERSION_STRING.

Michael
2009-01-15 22:56:01 +01:00
Jeremy Allison
354a2e03ab Fix bug #6040 - Calling Samba print server with an aliased DNS-name fails.
Jeremy.
2009-01-15 10:29:34 -08:00
Jeremy Allison
907f085296 Remove smbclient globals that bled into clidfs.c. Now we only have
the connections list and authentication structures to worry about.
Jeremy
2009-01-14 16:08:19 -08:00
Jeremy Allison
592ee76341 Fix build of netapi.
Jeremy.
2009-01-14 14:33:46 -08:00
Jeremy Allison
2c0a802cf8 Remove another global from clidfs that is only used in client.c.
Jeremy.
2009-01-14 14:26:56 -08:00
Jeremy Allison
b3e6247a9e Fix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery.
Jeremy.
2009-01-14 13:17:38 -08:00
Bo Yang
e3ef19b9b9 Fix bug in get_dc_name_via_netlogon(), null pointer refrence. 2009-01-14 11:47:45 -08:00
Jeremy Allison
9aa385a090 Clean up comments a little.
Jeremy.
2009-01-14 11:12:52 -08:00
Bo Yang
54325f7ed5 Don't send message to any other child in child process.
Signed-off-by: Bo Yang <boyang@novell.com>
2009-01-14 10:42:02 -08:00
Volker Lendecke
8c983af56d Make rpc_read look like a real read call
It doesn't really need to know about prs_structs
2009-01-14 17:08:40 +01:00
Volker Lendecke
e1aeb486e8 Make rpc_read() match the control flow normally used in Samba
Replace do { .. } while () with a while () { .. }
2009-01-14 17:08:40 +01:00
Volker Lendecke
11e3388083 Simplify rpc_read a bit
rpc_read always reads the whole bytes it was asked to read. So it is not really
necessary for it to update the current_pdu_offset, for clarity this can better
be done in the caller.
2009-01-14 17:08:39 +01:00
Volker Lendecke
15dd11b31e Remove an unnecessary size check
rpc_read is only ever called with at most fraglen-RPC_HEADER_SIZE length
2009-01-14 17:08:39 +01:00
Volker Lendecke
274f575b24 Check the fragment size the server has sent us 2009-01-14 17:08:39 +01:00
Volker Lendecke
583d7913c8 Slightly simplify rpc_read: It should not do the resize 2009-01-14 17:08:39 +01:00
Volker Lendecke
87f9f0b01a Always read with offset 0 from a named pipe 2009-01-14 17:08:39 +01:00
Günther Deschner
990491d187 s3-eventlog: fix ps struct removal leftover.
Guenther
2009-01-14 10:53:04 +01:00
Günther Deschner
a950242143 s3-rpcclient: always parse the full eventlog entry.
Guenther
2009-01-14 10:18:14 +01:00
Günther Deschner
df8b724819 s3-eventlog: use main talloc context in eventlog read call.
Guenther
2009-01-14 10:18:14 +01:00
Jeremy Allison
58b680446f From boyang - ensure we never "return" from a forked child, always _exit().
Jeremy.
2009-01-13 15:42:56 -08:00
Jeremy Allison
da2dd1406f Only call sendfile_short_read() if we need it.
Jeremy.
2009-01-13 15:36:09 -08:00
Jeremy Allison
0f450623c5 Fix bug noticed by Volker - if sendfile returns zero then
we might have to handle a short send by filling with zeros.
Jeremy.
2009-01-13 13:02:44 -08:00
Jeremy Allison
83c3b28096 Fix bug #6019 File corruption in Clustered SMB/NFS environment managed via CTDB
Jeremy.
2009-01-13 11:19:11 -08:00
Steven Danneman
4a578ec50b Covert several persistant tdb files to use state_path() instead of lock_path() 2009-01-12 17:46:15 -08:00
Steven Danneman
7b02e05eb6 Audit usage of get_dyn_STATEDIR() and replace with state_path()
The state directory is now run-time configurable through loadparm, so all
references to it should be done through state_path() or lp_statedir().
2009-01-12 17:46:14 -08:00
Jeremy Allison
f497a79f28 Deprecate the "share modes" parameter to address bug #6024, swat disagrees with smbstatus as to share mode with share modes = No set in samba.
Jeremy.
2009-01-12 16:25:03 -08:00
Günther Deschner
4561721cc3 s3-rpcclient: some cleanup for eventlog client.
Guenther
2009-01-12 18:04:03 +01:00
Stefan Metzmacher
7d9fd64f38 s3:libsmb: handle the smb signing states the same in the krb5 and ntlmssp cases
SMB signing works the same regardless of the used auth mech.

We need to start with the temp signing ("BSRSPYL ")
and the session setup response with NT_STATUS_OK
is the first signed packet.

Now we set the krb5 session key if we got the NT_STATUS_OK
from the server and then recheck the packet.

All this is needed to make the fallback from krb5 to
ntlmssp possible. This commit also resets the cli->vuid
value to 0, if the krb5 auth didn't succeed. Otherwise
the server handles NTLMSSP packets as krb5 packets.

The restructuring of the SMB signing code is needed to
make sure the krb5 code only starts the signing engine
on success. Otherwise the NTLMSSP fallback could not initialize
the signing engine (again).

metze
2009-01-12 13:22:40 +01:00
Steven Danneman
19a05bf2f4 Make STATEDIR and CACHEDIR configurable through ./configure and loadparm.c
If they are not explicitely set in either place both will default to LOCKDIR.

Signed-off-by: Michael Adam <obnox@samba.org>
2009-01-12 12:16:03 +01:00