1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

666 Commits

Author SHA1 Message Date
Tim Potter
6dbdb0d813 A rewrite of the error handling in the libsmb client code. I've separated
out the error handling into a bunch of separate functions rather than all
being handled in one big function.

Fetch error codes from the last received packet:

    void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
    uint32 cli_nt_error(struct cli_state *);

Convert errors to UNIX errno values:

    int cli_errno_from_dos(uint8 eclass, uint32 num);
    int cli_errno_from_nt(uint32 status);
    int cli_errno(struct cli_state *cli);

Detect different kinds of errors:

    BOOL cli_is_dos_error(struct cli_state *cli);
    BOOL cli_is_nt_error(struct cli_state *cli);
    BOOL cli_is_error(struct cli_state *cli);

This also means we now support CAP_STATUS32 as we can decode and understand
NT errors instead of just DOS errors.  Yay!

Ported a whole bunch of files in libsmb to use this new API instead of the
just the DOS error.
-
Tim Potter
fb60798a77 Changed the order of arguments in make_oem_passwd_hash(). All the other
encryption functions have outputs as the last arguments.
-
Tim Potter
04d978258b Factored out common rpc pipe initialisation and shutdown code. -
Tim Potter
4c9f010a1e Fixed another possible memleak in cli_initialise() -
Tim Potter
b5373f4b59 Cleaned up error handling in cli_initialise() to fix a memleak found by
Claudia Moroder <claudiamoroder@st-ulrich.suedtirol.net>
-
Tim Potter
99ce277fc8 Changed lone malloc() call to talloc(). Spotted by
Claudia Moroder <claudiamoroder@st-ulrich.suedtirol.net>
-
Jeremy Allison
840802f106 Added "use mmap" for HPUX.
Jeremy.
-
Jeremy Allison
e3580b4033 Throw out crappy (non-ascii unaware) mbtows stuff and use proper unicode
push calls. If this breaks authentication then good, it needed fixing anyway :-).
Jeremy.
-
Tim Potter
12e44e4029 cli_samr_query_dispinfo() can return STATUS_MORE_ENTRIES which isn't an
entry.
-
Tim Potter
375636b763 Added a warning debug if cli_samr_lookup_rids is called with more than 1000
rids as this seems to crash LSASS.EXE more often than not.
-
Tim Potter
e0ebbc9ae3 In cli_lsa_lookup_sids() don't append a separator character between domain
and name if there is no name.
-
Tim Potter
2accab2589 Changed the cli_lsa_lookup_sids() function to unpack the domain and user or
group using rpcstr_pull_unistr2_fstring rather than pull_ascii_fstring (!!)
-
Andrew Tridgell
3dc9fd076a formatting fix -
Andrew Tridgell
dc99b9ddf8 fixed some unicode and LANMAN2 bugs in trans2 find first -
Andrew Bartlett
8df8e84144 Add backend encryption support for NTLMv2.
The leg-work for this was done by the folks at samba-tng.org, I'm just bringing
it accross to HEAD.

The MD5 implementation is seperatly derived, and does not have the copyright
problems that the one in TNG has.

Also add const to a few places where it makes sence.

Andrew Bartlett
-
Tim Potter
974790e45e Renamed formal parameter fd to fnum because we're talking about SMB file
handles, not unix ones.
-
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. -
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
-
Tim Potter
0a505e50a5 Fixed incorrect comment for cli_NetServerEnum() -
Jeremy Allison
15c64199cb Insure caught the fact that PTRDIFFs were being done between two unrelated
pointers.
Jeremy.
-
Andrew Tridgell
ba79d2a030 cli_read() was reading too many bytes. -
Jeremy Allison
2999eab5ab Use a logical cli_read(), removed the cli_read_one() hack.
Jeremy.
-
Richard Sharpe
8a873b5dfb Fix a stupid typo ... -
Tim Potter
a48d480ce9 Put an 0x in front of a hex number. -
Andrew Tridgell
e2ecff419f fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef instead of a define -
Andrew Tridgell
55109a7525 - make the regresison test mode code build in by default. This should
allow us to have test targets without special configure options
- fixed make proto so that it actually does something
-
Andrew Tridgell
7e8e6ae9a8 added the ability to test smbd safely as an ordinary user. The way it works is
that libsmb/ creates a local tcp socket then launches smbd as a subprocess
attached to that socket. smbd thinks it is being launched from inetd.

to use it do the following:

- compile with -DSMB_REGRESSION_TEST
- run like this (also works with smbtorture etc)
    export SMBD_TEST=1
    export LIBSMB_PROG=bin/smbd
    smbclient //server/share -Uuser%pass

obviously you need to setup a smb.conf etc. Using --prefix to configure
is useful.

The aim of all this stuff is to add a decent set of regression tests
to the build farm, so we know if smbd actually runs correctly on all the
platforms, not just builds. We can run smbtorture, masktest, locktest etc,
plus a bunch of smbclient scripts and any new tests we write.

This doesn't help much with nmbd (at least not yet) but its a good start.
-
Tim Potter
465994cfbc Cleanup of cli_lsa_enum_trust_dom(). talloc() doesn't like attempts to
allocate 0 bytes.
-
Tim Potter
9e074bc2bf Merged cli_read_one() function for reading DCE/RPC reply fragments. -
Andrew Tridgell
bbfbe03cc6 added some comments to make the cli read code clearer -
Andrew Tridgell
674ee2f1d1 next_token() was supposed to be a reentrant replacement for strtok(),
but the code suffered from bitrot and is not now reentrant. That means
we can get bizarre behaviour
i've fixed this by making next_token() reentrant and creating a
next_token_nr() that is a small non-reentrant wrapper for those lumps
of code (mostly smbclient) that have come to rely on the non-reentrant
behaviour
-
Andrew Tridgell
86613493a9 Added STR_NOALIGN flags to clistr and srvstr fns. Yes, NT actually does
send unaligned unicode strings sometimes!
Fixed our handling of the workgroup name tacked on the end of the
NT1 negprot response (a unaligned unicode)
fixed a couple of places where we should be using the message_end fns instead
of pre-calculated buffer lengths
-
Jeremy Allison
244aec8ea6 Following info from TAKAHASHI Motonobu <monyo@samba.gr.jp>,
Samba Users Group Japan, ensure that we don't use dos_to_unix(xx,True),
but always use dos_to_unix(xx,False) to prevent overwriting.
Jeremy.
-
Jeremy Allison
05a2911403 Fixed W2K SP2 joining a Samba PDC hosted domain.
Jermey.
-
Tim Potter
2162454d9e Added cli_samr_delete_dom_user() function. -
Jeremy Allison
9297ae69a7 New info level tester.
Jeremy.
-
Andrew Tridgell
3d4a3bfacd added a oplock break handler hook to the client code, this allows for more complete testing of oplocks from smbtorture and would also be essential if a client app ever really did want to use oplocks properly -
Tim Potter
720fea5360 Removed silly Get_Hostbyname() wrapper as DNS names are case-insensitive
and the use of this function only increased timeouts when Samba queries
a broken DNS server.
-
Tim Potter
66e62245ea Added a unix error code for NT_STATUS_PATH_NOT_COVERED. -
Tim Potter
fb80cf2aa1 Merged encode_pw_buffer() and nt_owf_genW() functions from TNG branch. -
Tim Potter
13df2304b3 Added some msdfs client routines. -
Richard Sharpe
832227a72b Fix up the problems with calling smbc_init multiple times. -
Tim Potter
abc294c4a8 Added stubs for dfs rpc client routines. -
Tim Potter
79710a3ab3 Fixed bug in cli_samr_create_dom_user()
Added cli_samr_lookup_names()

Removed redundant argument to cli_samr_connect()
-
Jeremy Allison
6d65556ae8 Set correct reply word in large writeX (greater than 64k) replies.
Also added smbtorture test for this.
Jeremy.
-
Andrew Tridgell
8ec9c87b5d use LDSHFLAGS not -shared in several places -
Tim Potter
6c9796286c Added add domain user to rpcclient.
Added cli_ functions for set userinfo and userinfo2.
-
Gerald Carter
7e23ed4890 merge from 2.2 -
Tim Potter
ee599c9481 Added srv_get_info client command. -
Tim Potter
8d5f202709 Added logon control2 client call. -