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

2631 Commits

Author SHA1 Message Date
Derrell Lipman
a13ba4347f What to do about debugging in a multi-threaded application?
- For now, punt. Any thread that requests debug to stderr will establish that
  for all threads.

Derrell
2009-05-13 14:51:43 -04:00
Derrell Lipman
636fbd1028 Thread-safe protection: libsmbclient initialization
- Begin converting init functions to use SMB_THREAD_ONCE. libsmbclient
  module-wide initialization is now moved into a separate function and called
  via SMB_THREAD_ONCE.

- libsmbclient counts users (contexts) so that it can release global resources
  when the last context is closed. That count of contexts is now protected by
  a mutex.

Derrell
2009-05-13 14:37:28 -04:00
Stefan Metzmacher
b9f3a78169 s3:libsmb: move read_smb_send/recv() static in async_smb.c
metze
2009-05-13 18:27:50 +02:00
Stefan Metzmacher
ca6ec5ecd7 s3:libsmb: let cli_smb_chain_send() also return NTSTATUS
metze
2009-05-13 18:27:50 +02:00
Bo Yang
6ff09b323e s3:libsmb: return NT_STATUS_CONNECTION_INVALID if the fd is -1
This way we can destinguish between requests which failed
because the connection broke after they were triggered
and the requests which are started on an already broken
connection.

This also moves the check to cli_smb_req_iov_send()
where it really belongs.

metze
2009-05-13 18:27:41 +02:00
Bo Yang
05379f0125 s3: return proper error code in cli_smb_req_send
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-13 18:47:00 +08:00
Jeremy Allison
ad9d64ee1b Clean up assignments to iov_base, ensure it's always cast to void *. This should quieten some warnings with picky compilers on the buildfarm.
Jeremy.
2009-05-12 11:45:37 -07:00
Derrell Lipman
db69ebcbce Provide a libsmbclient interface for programs requiring threads
- This adds two functions: smbc_thread_posix() which provides access to the
  internal threading implementation using pthread; and smbc_thread_impl()
  where the user provides each of the functions required by Samba, to give
  access to the thread implementation's native capabilities.

Derrell
2009-05-10 22:45:12 -04:00
Stefan Metzmacher
5c76472491 s3:libsmb: fix layering of cli_ntrename_internal and its callers
It's easier to have cli_ntrename_internal as a semetric async
tevent_req function. cli_ntrename() and cli_nt_hardlink() should
be callers on top of cli_ntrename_internal().

metze
2009-05-09 09:26:15 +02:00
Jeremy Allison
bb8aff6ffa Async API needs all parameters to be kept around until sent,
ensure they're attached to the state structure. Thanks to Metze
for pointing this out.
Jeremy.
2009-05-07 10:01:28 -07:00
Volker Lendecke
d52b0a25ad Make cli_tcon_andx chainable 2009-05-07 16:37:54 +02:00
Volker Lendecke
b35967edba Make cli_session_setup_guest chainable 2009-05-07 16:37:54 +02:00
Günther Deschner
8e490d2fa1 s3-credentials: protect netlogon_creds_server_step() against NULL creds.
Found by SCHANNEL torture tests.

Guenther
2009-05-07 13:32:41 +02:00
Jeremy Allison
606edf0f35 Make cli_setatr async.
Jeremy.
2009-05-06 16:13:42 -07:00
Jeremy Allison
512879a69b Make cli_setattrE async.
Jeremy.
2009-05-06 15:07:05 -07:00
Jeremy Allison
4cbd0c77e4 Make cli_getatr() async.
Jeremy.
2009-05-05 20:59:22 -07:00
Jeremy Allison
e091fdc565 Make cli_getattrE async.
Jeremy.
2009-05-05 16:28:44 -07:00
Jeremy Allison
d34651f9d2 Fix the async calls for the posix_unlink and posix_rmdir.
Jeremy.
2009-05-04 15:50:35 -07:00
Jeremy Allison
f3af298e5b Cause cli_close to return an NTSTATUS.
Jeremy.
2009-04-30 16:57:42 -07:00
Jeremy Allison
8cf78ff553 Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
Convert all uses of cli_open(), cli_nt_createXXX to NTSTATUS versions.
This is smaller than it looks, it just fixes a lot of old code.
Next up, ensure all cli_XX functions return NTSTATUS.
Jeremy.
2009-04-30 15:26:43 -07:00
Jeremy Allison
370e7209db Make cli_unlink async.
Jeremy.
2009-04-29 18:26:02 -07:00
Jeremy Allison
edd25980b0 More async calls in libsmb/clifile.c
Jeremy.
2009-04-29 10:48:16 -07:00
Bo Yang
f8cc0e88fb s3: fix crash in winbindd 2009-04-29 09:50:41 +08:00
Jeremy Allison
c732e9446f Doh ! Don't need "int dummy" when we have state :-).
Jeremy.
2009-04-28 16:45:13 -07:00
Jeremy Allison
bd6447dcf2 Convert cli_rename to async.
Jeremy.
2009-04-28 16:43:16 -07:00
Jeremy Allison
06e404f574 Convert cli_posix_unlink() and cli_posix_rmdir()
to async. First trans calls I've done.
Jeremy.
2009-04-28 13:18:51 -07:00
Volker Lendecke
251c220f91 Fix a type-punned warning 2009-04-28 11:58:44 +02:00
Derrell Lipman
641e12561a [FIX Bug 6235] domain enumeration breaks if master browser has space in name
Jeremy: please review to ensure this doesn't appear to break anything

The function name_status_find() is documented as used for finding a server's
name given its IP address. It was, however, looking for the first matching
name which could be a group name at times. This fix ensures that group names
are skipped when scanning for a matching name.

Derrell
2009-04-27 09:34:25 -04:00
Jeremy Allison
bd5c2c7dc8 find/replace. Change uintX types to uintX_t types to tidy up the code.
Jeremy.
2009-04-24 07:06:48 -07:00
Kai Blin
c93e2d9d43 errormap: Change the WBC_ERR_UNKNOWN_ERROR to map to NT_STATUS_UNSUCCESSFUL
This allows us to distinguish on NTSTATUS level if we got a
WBC_ERR_UNKNOWN_ERROR or WBC_ERR_NSS_ERROR.
2009-04-23 00:23:56 +02:00
Jeremy Allison
455f2a4c65 Make dskattr async.
Jeremy.
2009-04-22 08:04:53 -07:00
Jeremy Allison
502f47c7c0 Make cli_chkpath async.
Jeremy
2009-04-22 06:46:42 -07:00
Kai Blin
7a9be21916 errormap: Add wbcErr to NTSTATUS mappings 2009-04-22 00:14:45 +02:00
Stefan Metzmacher
14bbed1d67 s3:libsmb: always use the tevent_req_nomem() for checking allocation failures
This will also make sure we cleanup 'req' in case of an error.

metze
2009-04-21 17:42:39 +02:00
Jeremy Allison
5ccf58ff59 Make rmdir async.
Jeremy.
2009-04-21 06:52:54 -07:00
Jeremy Allison
dfc79de607 Make cli_mkdir async. Change it to return NTSTATUS.
Jeremy.
2009-04-21 05:52:34 -07:00
Günther Deschner
b5bec1a6d7 s3-secdesc: use SEC_FLAG_MAXIMUM_ALLOWED instead of SEC_RIGHTS_MAXIMUM_ALLOWED.
Guenther
2009-04-21 12:40:47 +02:00
Andrew Bartlett
6c9caed481 Merge commit 'origin/master' into libcli-auth-merge-without-netlogond 2009-04-20 16:53:02 +02:00
Andrew Bartlett
ddcc355f2b s3:ntlmssp Remove use of talloc(NULL) in NTLMSSP code 2009-04-20 11:55:49 +02:00
Andrew Bartlett
0c771bfc70 s3:ntlmssp Fix segfault: msrpc_gen now uses talloc() 2009-04-20 05:19:48 +10:00
Jeremy Allison
265829c32f When doing a cli_ulogoff don't invalidate the cnum, invalidate the vuid.
Jeremy.
2009-04-16 15:16:28 -07:00
Andrew Bartlett
34193cffc0 Fix crash bug in NTLMSSP caused by msrpc_parse() moving to talloc 2009-04-16 14:08:00 +10:00
Andrew Bartlett
27815a71a9 More work to adapt to merged libcli/auth function prototypes 2009-04-14 16:23:42 +10:00
Andrew Bartlett
f28f113d8e Rework Samba3 to use new libcli/auth code (partial)
This commit is mostly to cope with the removal of SamOemHash (replaced
by arcfour_crypt()) and other collisions (such as changed function
arguments compared to Samba3).

We still provide creds_hash3 until Samba3 uses the credentials code in
netlogon server

Andrew Bartlett
2009-04-14 16:23:35 +10:00
Andrew Bartlett
3b3e21bd9b Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API

To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c

(the actual implementation remains distinct, but the API is now shared)

Andrew Bartlett
2009-04-14 12:53:56 +10:00
Andrew Bartlett
4786a493f7 Solve some of the conflict between Samba3 and Samba4 push_string
This renames push_string in Samba3 into push_string_base and
push_string_check for the two different use cases.

This should allow push_string to be imported from Samba4, using it's
calling conventions.
2009-04-14 12:11:00 +10:00
Volker Lendecke
602059a6ab Fix a bug in smbclient not sending the correct called name
Jeremy, I think the ability to say

smbclient //foo/bar -I <ip-address> -p 139

making the called name to "foo" got lost with 3d2d0203. Was this removed
deliberately? If so, please revert this patch. If not, please merge
appropriately.

Thanks,

Volker
2009-04-12 14:51:15 +02:00
Volker Lendecke
cf7d26933b Convert cli_push to tevent_req
Metze, please check!

Thanks,

Volker
2009-04-08 23:11:59 +02:00
Volker Lendecke
9c89aee5f3 Convert cli_pull to tevent_req 2009-04-08 23:11:59 +02:00
Andrew Bartlett
574a6a8c35 s3:kerberos Rework smb_krb5_unparse_name() to take a talloc context
Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-07 13:25:36 +02:00