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

271 Commits

Author SHA1 Message Date
Volker Lendecke
e9a2b265e7 r20211: send_nt_replies does not need the inbuf arg
(This used to be commit ab45c50da3)
2007-10-10 12:16:32 -05:00
Jeremy Allison
d29722e378 r20178: Ensure we allocate the intermediate trans structs
off conn->mem_ctx, not the null context so we can
safefy free everything on conn close. Should fix
possible memleak.
Jeremy.
(This used to be commit b33bde7b39)
2007-10-10 12:16:29 -05:00
Herb Lewis
791f48f167 r20124: clean up nested extern declaration warnings
(This used to be commit ac3eb7813e)
2007-10-10 12:16:26 -05:00
Volker Lendecke
c9cea2d624 r19001: Fix comment
(This used to be commit 048127f9dd)
2007-10-10 12:14:55 -05:00
Gerald Carter
eab57a0a0f r18789: Replace the winreg server code with the libndr parsing code.
Many things work (OpenHKLM, etc...) but some still don't.
This shouldn't block anyone so I'm checking it in.
Will probably move to a bzr tree after this for
longer dev cycles between checkins.
(This used to be commit cf1404a0d7)
2007-10-10 12:00:57 -05:00
Jelmer Vernooij
4db7642caa r18745: Use the Samba4 data structures for security descriptors and security descriptor
buffers.

Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
(This used to be commit b41c52b9db)
2007-10-10 12:00:54 -05:00
Stefan Metzmacher
258a465e20 r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.

metze
(This used to be commit 2f58645b70)
2007-10-10 11:51:59 -05:00
Jeremy Allison
a64925ddff r17800: Start using struct timespec internally for file times
on the wire. This allows us to go to nsec resolution
for systems that support it. It should also now be
easy to add a correct "create time" (birth time)
for systems that support it (*BSD). I'll be watching
the build farm closely after this one for breakage :-).
Jeremy.
(This used to be commit 425280a1d2)
2007-10-10 11:38:48 -05:00
Volker Lendecke
e23781b3b3 r17316: More C++ warnings -- 456 left
(This used to be commit 1e4ee728df)
2007-10-10 11:38:25 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
ce61fb21d9 r16397: Fix Klocwork #11767 and drasticly simplify the
logic in smbd/process.c. All interested (Volker,
Jerry, James etc). PLEASE REVIEW THIS CHANGE.
The logic should be identical but *much* easier
to follow and change (and shouldn't confuse Klockwork :-).
Jeremy.
(This used to be commit d357f8b335)
2007-10-10 11:18:52 -05:00
Jeremy Allison
b85b18d794 r16311: Check for NULL return. Klocwork #998.
Jeremy.
(This used to be commit c430730f5a)
2007-10-10 11:17:33 -05:00
Jeremy Allison
4b6fef6b6a r16295: Fix gcc4 "warning: dereferencing type-punned pointer will break
strict-aliasing rules" warning.
Jeremy.
(This used to be commit 7ac5aee88c)
2007-10-10 11:17:32 -05:00
Jeremy Allison
17e1b83996 r16277: Start fixing up gcc4 -O6 warnings on an x86_64 box. size_t != unsigned int
in a format string.
Jeremy.
(This used to be commit 3a15fff219)
2007-10-10 11:17:30 -05:00
Jeremy Allison
41f139c0bb r15949: Patch for bug #3308 to stop us returning duplicate
mid replies on path based set-eof trans2 calls.
Needs modification for HEAD (as in head open_file_ntcreateX
properly returns NTSTATUS - I'll fix this tomorrow my
time). Secondly it still fails the Samba4 RAW-OPLOCK
smbtorture because of an interesting case. Our oplock
code always returns "break to level 2" if it can.
In this case (path-based set-eof or set-allocation size
on an exclusive oplocked file) W2K3 always sends a
break-to-none. We send the break to none (from level2)
after we've done the write for eof or allocation size.
I need to work out some way of telling our break code
to always break to none (might need to extend the message
field).
Jeremy.
(This used to be commit ad9895c654)
2007-10-10 11:17:14 -05:00
James Peach
0a1ca7fa3d r15943: Update misleading DEBUG statements and comments that refer to
open_file_shared.
(This used to be commit 784126edff)
2007-10-10 11:17:14 -05:00
James Peach
4d55a81958 r15450: Change profiling data macros to use stack variables rather than
globals. This catches mismatched start/end calls and removes
the need for special nested profiling calls.
(This used to be commit ee75049881)
2007-10-10 11:16:47 -05:00
Volker Lendecke
1ca61f4748 r15266: Fix bug 3720. I wonder why -O1 compiles did not catch this...
Thanks to Jason Mader for reporting this.

Volker
(This used to be commit 3e616c3272)
2007-10-10 11:16:30 -05:00
Jeremy Allison
fc13f28417 r15030: On a performace hunt... Remove as many extraneous
memset's as possible.
Jeremy.
(This used to be commit 1217ed392b)
2007-10-10 11:15:58 -05:00
Jeremy Allison
22dbd67708 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
(This used to be commit 08e52ead03)
2007-10-10 11:15:57 -05:00
Jeremy Allison
894358a8f3 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Jeremy Allison
d14af63e6a r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
(This used to be commit 23f16cbc2e)
2007-10-10 11:06:21 -05:00
Jeremy Allison
c4ccc8f37e r12491: End profile fixes from SATOH Fumiyasu <fumiya@samba.gr.jp>.
Jeremy.
(This used to be commit 2187502732)
2007-10-10 11:05:58 -05:00
Jeremy Allison
6baec64a73 r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We can
only tell at parse time from the wire if an incoming name
has wildcards or not. If it's a mangled name and we demangle
the demangled name may contain wildcard characters. Ensure
these are ignored.
Jeremy.
(This used to be commit 4cd8e2a96b)
2007-10-10 11:05:15 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Jeremy Allison
af8a691db1 r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work
into the tree). I'll test this over the weekend....
Jerry - in looking at the difference between the two trees there
seem to be some printing/ntprinting.c and registry changes we might
want to examine to try keep in sync.
Jeremy.
(This used to be commit c7fe18761e)
2007-10-10 10:58:18 -05:00
Jeremy Allison
7e509e9b99 r7842: With the patch I sent Steve yesterday this gives us complete POSIX pathnames.
ie. files containing : and \ can be accessed from Linux.
Jeremy.
(This used to be commit e9b8d23d61)
2007-10-10 10:57:59 -05:00
Jeremy Allison
bd16770954 r6895: Add "acl check permissions" to turn on/off the new behaviour of
checking for write access in a directory before delete. Also
controls checking for write access before labeling a file read-only
if DOS attributes are not being stored in EA's.
Docuementation to follow.
Jeremy.
(This used to be commit dd1a5e6e49)
2007-10-10 10:56:56 -05:00
Jeremy Allison
bd688a9138 r6633: Added "check_path_syntax_posix()" in preparation for handling
POSIX pathnames. Not yet used.
Jeremy.
(This used to be commit 381da9b55d)
2007-10-10 10:56:48 -05:00
Jeremy Allison
05cc4785a4 r6307: Ensure info requested bitmask is printed in log when querying security descriptors.
Jeremy.
(This used to be commit 4db288e314)
2007-10-10 10:56:36 -05:00
Jeremy Allison
0003238873 r6269: With help from Marcel Müller <mueller@maazl.de> in tracking down the bug,
fix trans2 and nttrans secondary packet processing. We were being too strict checking
the incoming packet (by 1 byte).
Jeremy.
(This used to be commit 3eea1ff4b7)
2007-10-10 10:56:34 -05:00
Volker Lendecke
83e11ba86c r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
(This used to be commit 3493d9f383)
2007-10-10 10:56:33 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
6ef9d08090 r6204: Fix double-free of talloc context.
Jeremy.
(This used to be commit d5c56d2574)
2007-10-10 10:56:28 -05:00
Jeremy Allison
77fa234ffc r6203: Fix attribute return on creating a directory with nttrans_create.
Fix strange allocation semantics of openX.
Jeremy.
(This used to be commit da5a8b539d)
2007-10-10 10:56:28 -05:00
Jeremy Allison
0557c6cba2 r6172: Tidy up error processing significantly. Remove unix_ERR_XXX global nastyness.
Jeremy.
(This used to be commit d3379fe61b)
2007-10-10 10:56:27 -05:00
Jeremy Allison
89fffb349f r6160: Ensure allocation size is correctly returned for OpenX. Only set allocation
on create/truncate for nttrans.
Jeremy.
(This used to be commit fb05ac4c03)
2007-10-10 10:56:26 -05:00
Jeremy Allison
b76112f211 r6146: Added OS/2 EA support in trans2_open and trans2_mkdir. Fixed in nttrans_create.
Jeremy.
(This used to be commit 989fcb4c08)
2007-10-10 10:56:24 -05:00
Jeremy Allison
b7c6e71b26 r6141: Fix OS/2 EA's for NTcreate. OpenX and mkdir to follow.
Jeremy.
(This used to be commit 106f91ff65)
2007-10-10 10:56:24 -05:00
Jeremy Allison
7dcc247164 r6124: Fix for bug #2242 from Tom Lackemann <cessnatomny@yahoo.com> - don't
set SD on an NTtransact create unless we created the file.
Jeremy.
(This used to be commit b42eaf424e)
2007-10-10 10:56:23 -05:00
Gerald Carter
5d1cb8e79e r6014: rather large change set....
pulling back all recent rpc changes from trunk into
3.0.  I've tested a compile and so don't think I've missed
any files.  But if so, just mail me and I'll clean backup
in a couple of hours.

Changes include \winreg, \eventlog, \svcctl, and
general parse_misc.c updates.

I am planning on bracketing the event code with an
#ifdef ENABLE_EVENTLOG until I finish merging Marcin's
changes (very soon).
(This used to be commit 4e0ac63c36)
2007-10-10 10:56:15 -05:00
Jeremy Allison
deb0212172 r5893: Get us to pass some of the Samba4 EA tests. EA_LIST seems to be
working - need to valgrind it to be sure.
Jeremy.
(This used to be commit 8b2b652c0a)
2007-10-10 10:56:07 -05:00
Jeremy Allison
eb546db88d r5720: Attempt to fix bug #2382 (Excel shared workbook stops working). Also
incorporates part of the fix created by ke_miyata@itg.hitachi.co.jp
for bug #2045 (MS-Office behavior of timestamp).
Jeremy.
(This used to be commit 4f3b12ac73)
2007-10-10 10:55:57 -05:00
Jeremy Allison
c56d5cd4c4 r5637: Actually test and fix the crash bugs (sorry:-).
Jeremy.
(This used to be commit 4348ca4854)
2007-10-10 10:55:52 -05:00
Jeremy Allison
02fdabc2a7 r5636: Re-add the allocation size - parameterized by share as
"allocation roundup size", by default set as 1Mb. From
advice by BlueArc about Windows client behaviour. VC++
people can set this to zero to turn it off.
Jeremy.
(This used to be commit 833ca10177)
2007-10-10 10:55:52 -05:00
Jeremy Allison
f95e9fc45b r5548: Stop lying about allocation sizes to Windows clients. It was a nice
idea, and aparently improved performance in some circumstances, but it
breaks the VC++ compiler :-(. Not cool. Fix bug #2146.
Jeremy.
(This used to be commit b9f147634d)
2007-10-10 10:55:47 -05:00
Jeremy Allison
cb203b2d1e r5530: Keep the TRANS call up to date with the NTCreateX call.
Jeremy.
(This used to be commit 98a07e1520)
2007-10-10 10:55:45 -05:00
Jeremy Allison
e2cc3f4816 r5524: Don't do share mode checks on can_delete if open, the rest of the open
code will do this correctly. More for bug #2201.
Jeremy.
(This used to be commit faecf639ef)
2007-10-10 10:55:44 -05:00
Jeremy Allison
14fc089bf5 r5510: Optimisation to only do can_delete check if client asks for FILE_SHARE_DELETE.
Not completely correct but will catch the XP SP2 problem.
Jeremy.
(This used to be commit 1e2d0fcdbb)
2007-10-10 10:55:43 -05:00