1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

41 Commits

Author SHA1 Message Date
Jelmer Vernooij
addf29e676 Patch from Paul Green <Paul.Green@stratus.com> to be more POSIX-compatible -
Jeremy Allison
5841ca54b6 Don't use uint. It doesn't exist on some platforms and we don't define it.
Replaced with "unsigned int".
Jeremy.
-
Andrew Tridgell
136b9752fc added cli_locktype() for testing different lockingX lock types -
Andrew Tridgell
56662a75f5 better handling of a zero timeout in cli_lock -
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Jeremy Allison
0fcca6c627 Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
-
Jeremy Allison
794c3e2c76 Added CIFS UNIX extension code to client.
Jeremy.
-
Jeremy Allison
01ff6ce496 Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
-
Jeremy Allison
b1930abb35 Got serious about const again.
REMOVED BZERO CALLS YET AGAIN !!! Why do these keep creeping back in....
They are *NOT* POSIX. I'm also thinking of removing strncpy as I'm sure
it's not being used correctly....
Jeremy.
-
Jeremy Allison
ee5e7ca547 Added NT_USER_TOKEN into server_info to fix extra groups problem.
Got "medieval on our ass" about const warnings (as many as I could :-).
Jeremy.
-
Andrew Tridgell
2d507ec669 fixed ctemp in server and client. It turns out that ctemp on NT is completely broken, and it's pointless to emulate their brokenness completely in this case, but at least this makes us use approximately the same packet format. The spec is complelet wrong in this case -
Simo Sorce
48fc6a6cd5 move to SAFE_FREE() -
Andrew Tridgell
55d5828e60 use cli_is_error() instead of looking in smb_rcls, otherwise NT status
codes don't work correctly
-
Andrew Tridgell
759ca19f32 use 32 bit locking if client doesn't do 64 bit -
Andrew Tridgell
fe414d5e1a string terminate in mkdir -
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.
-
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.
-
Jeremy Allison
15c64199cb Insure caught the fact that PTRDIFFs were being done between two unrelated
pointers.
Jeremy.
-
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
-
Richard Sharpe
672242a52e Fix a small warning about char * vs unsigned char * that gets some compilers
in a twitch.
-
Andrew Tridgell
bfcc6f8827 merging from 2.2 to head -
Jeremy Allison
51987684bd This is a big, rather ugly patch. Whilst investigating the files not truncated
when copying to a full disk problem, I discovered that we were not allowing
the delete on close flag to be set properly, this led to other things, and
after investigation of the proper delete on close semantics and their relationship
to the file_share_delete flag I discovered there were some cases where we
weren't doing the deny modes properly. And this after only 5 years working
on them..... :-) :-).
So here's the latest attempt. I realised the delete on close flag needs to
be set across all smbds with a dev/ino pair open - in addition, the delete
on close flag, allow share delete and delete access requested all need to
be stored in the share mode tdb.
The "delete_on_close" entry in the fsp struct is now redundant and should
really be removed. This may also mean we can get rid of the "iterate_fsp"
calls that I didn't like adding in the first place. Whilst doing this patch,
I also discovered we needed to do the se_map_generic() call for file opens
and POSIX ACL mapping, so I added that also.
This code, although ugly, now passes the deny mode torture tests plus the
delete on close tests I added. I do need to add one more multiple connection
delete on close test to make sure I got the semantics exactly right, plus we
should also (as Andrew suggested) move to random testing here.

The good news is that NT should now correctly delete the file on disk
full error when copying to a disk :-).

Jeremy.
-
Jeremy Allison
6f7d9e29e4 Added cli_nt_delete_on_close() call to allow flag to be set for torture tests.
Jeremy.
-
Jeremy Allison
f602fa1205 Added cli_nt_create_full() as a way to get at all the ntcreate parameters.
Used in smbtorture mods. Re-cast cli_nt_create() as a call to cli_nt_create_full().
Jeremy.
-
Andrew Tridgell
34a0821e08 simpler clistr interface which handles individual packets having
unicode bit set differently to capabilities
-
Andrew Tridgell
95c9e4e0ba to use the same macros in the client and server rename the CLISTR_
macros to STR_
-
Andrew Tridgell
847de3b4ad cope better with broken filer expectations -
Andrew Tridgell
4d59c08c5e the unicode conversion of our client code is complete enough to be
enabled by default

you can disable it by setting the environment variable CLI_FORCE_ASCII
-
Andrew Tridgell
5b2ef8a1b9 yipee! client unicode now works well with nt -
Andrew Tridgell
f6b8d67304 converted a bunch more fns -
Andrew Tridgell
c40a1e4ebd converted nt_create and setatr -
Andrew Tridgell
0a8992e224 - neater setting of bcc
- converted cli_rename and cli_unlink
-
Andrew Tridgell
db60c0c262 converted cli_open() -
Andrew Tridgell
95268f5255 converted cli_chkpath() -
Andrew Tridgell
bce3ed01a9 converted cli_mkdir() -
Tim Potter
c4476c6315 Added a cli_nt_create_uni() to do a ntcreate&x with a unicode filename,
regardless of the settings negotiated in the flags2 smb field.
-
Andrew Tridgell
a2d07994e0 pass the desired access into cli_nt_create() -
Andrew Tridgell
b7a1c00bed fixed indentation -
Jeremy Allison
213cd0b519 Ok - fixed a bug in our levelII oplock code. We need to break a level II on
a byte range lock (write lock only, but Win2k breaks on read lock also so I
do the same) - if you think about why, this is obvious. Also fixed our client
code to do level II oplocks, if requested, and fixed the code where we would
assume the client wanted level II if it advertised itself as being level II
capable - it may not want that.
Jeremy.
-
Andrew Tridgell
91f0a3cc2f added cli_lock64() and cli_unlock64() -
Andrew Tridgell
10c5470835 split clientgen.c into several parts
the next step is splitting out the auth code, to make adding lukes
NTLMSSP support easier
-