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

144 Commits

Author SHA1 Message Date
Jeremy Allison
9527f93272 r21961: Repair bug introduced by rev. 21960.
We need to do the initial strtok to set up the internal state.
Jeremy.
(This used to be commit 8c7042b419)
2007-10-10 12:18:53 -05:00
Volker Lendecke
eca13022ef r21960: Fix bugs 4463,4464,4465,4466. Thanks Jason :-)
(This used to be commit a2e27c4431)
2007-10-10 12:18:52 -05:00
Jeremy Allison
bf26a7632e r21942: Hoist by our own petard :-). Older smbclient binaries
were not able to connect to the rewritten dfs code as
they set the dfs flag bit but then send local paths.

Now that our dfs code is a *lot* more robust in
detecting this sort of braindamage we can just
call into it directly on getting a DFS flag
and let the parser sort it out without having
to check it's actually connecting to a dfs
enabled share (I'm proud of this code :-).

Jeremy.
(This used to be commit 8c4d929c76)
2007-10-10 12:18:51 -05:00
Jeremy Allison
a5dd4355cd r21803: Missed part of patch to make self-referrals work.
Jeremy.
(This used to be commit b1fa55e513)
2007-10-10 12:18:35 -05:00
Jeremy Allison
24cdd7c733 r21800: Check-in the DFS rewrite. I am still testing this but it
works from smbclient and Windows, and I am promising to
support and fix both client and server code moving forward.
Still need to test the RPC admin support but I haven't
changed that code.
Jeremy.
(This used to be commit 7a7862c01d)
2007-10-10 12:18:34 -05:00
Jeremy Allison
db32963181 r21759: Fix the same bug in a more elegant way, strrchr_m
is an expensive call....
Jeremy.
(This used to be commit 321a136dbc)
2007-10-10 12:18:28 -05:00
Jeremy Allison
c4ea95fd30 r21758: Fix a very specific dfs bug when passing in POSIX
pathnames. When we're working out how much we've
consumed we need to backtrack by either a '/' or '\\'
component, as both are valid separators.
Jeremy.
(This used to be commit 1722ea20db)
2007-10-10 12:18:28 -05:00
Jeremy Allison
286d8554aa r21756: An invarient the dfs code depended on for POSIX paths
is no longer true, so fix it.
Jeremy.
(This used to be commit 698159c0ee)
2007-10-10 12:18:28 -05:00
Jeremy Allison
7b2c2e4155 r21754: Volker is completely correct. There's no need for
the RESOLVE_DFSPATH macros and their varients
any more. Fix reporting profile bug with all
error returns.
Jeremy.
(This used to be commit cdf0fdb104)
2007-10-10 12:18:28 -05:00
Volker Lendecke
5920d870cf r21251: Okay, after Jeremy has kindly tested this, check it in :-)
Attached find a workaround that works for me. This is not the "correct" fix,
to me it seems our DFS referral marshalling is broken. Vista requests level 4,
we reply with level 2, and Vista seems not to like that. If we reply with
level 3 it seems more happy.

Needs more work!

Volker
(This used to be commit 4c3a913562)
2007-10-10 12:17:51 -05:00
Jeremy Allison
ffe646b1e6 r21226: Fix bug #4377 (rename of "foo" -> "Foo" fails).
This is actually an interesting case as it exposed bad code in our DFS redirect
module (that was where the bug was introduced).
Caused by our turning on dfsroot be default.
Jeremy.
(This used to be commit 5fe25588f5)
2007-10-10 12:17:49 -05:00
Jeremy Allison
db0ad252a0 r20718: Sync up the filename path parsing changes from SAMBA_3_0_24.
The only difference between the two trees now w.r.t file
serving are the changes to smbd/open.c in this branch I need
to review.
Jeremy.
(This used to be commit f4474edf6a)
2007-10-10 12:17:04 -05:00
Volker Lendecke
575845ccbe r19963: Add 'registry shares = yes' and registry key security descriptors.
(This used to be commit 6cab254c49)
2007-10-10 12:16:16 -05:00
Jelmer Vernooij
48e2a2bfb7 r18481: Use pidl-generated server side code for dfs.
(This used to be commit 3f337c104d)
2007-10-10 11:51:43 -05:00
Günther Deschner
11673dc07a r17453: Fix msdfs RPC management (this broke with the autogenerated dfs rpcs).
* Remove "unknown" from dfs_Enum (samba4 dfs IDL updates to follow).

* When encountering an unsupported infolevel the rpc server must reply
with a dfs_info_0 structure and WERR_OK (observed from w2k3 when talking
to nt4).

Guenther
(This used to be commit f9bef1f08f)
2007-10-10 11:38:34 -05:00
Jeremy Allison
f569db1c06 r17376: Fix bug #3985 - ensure in msdfs we check for our
netbios aliases. Reported by Björn Jacke <bjoern@j3e.de>.
Probably needs to be in 3.0.23b (if Björn approves
of the fix).
Jeremy.
(This used to be commit e9e711fe37)
2007-10-10 11:38:29 -05:00
Volker Lendecke
430fa0eba0 r17348: Some C++ warnings
(This used to be commit ae6b9b34e5)
2007-10-10 11:38:27 -05:00
Jeremy Allison
725d88b6d4 r16968: The function parse_processed_dfs_path() is dependent on the
fact that check_path_syntax() will convert '\\' characters to '/'.
When POSIX pathnames have been selected this doesn't happen, so we
must look for the unaltered separator of '\\' instead of the modified '/'.
Stevef please check this with the CIFSFS MS-DFS code !
Jeremy
(This used to be commit 883bb398e5)
2007-10-10 11:19:16 -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
Günther Deschner
3dc4d79a44 r16797: Add msdfs proxy junctions in the netdfs rpc enumeration.
Guenther
(This used to be commit 6bf350895a)
2007-10-10 11:19:11 -05:00
Volker Lendecke
a47ffac30d r16203: Fix potentially writing one result of strtok beyond the end of alt_path.
Found by Klocwork, ID 653.

Volker
(This used to be commit 4cb8cf221f)
2007-10-10 11:17:25 -05:00
Gerald Carter
679e539655 r15712: BUG 3435: patch from volker to fix 'msdfs root = yes' in [homes]
(This used to be commit 466478f07e)
2007-10-10 11:17:09 -05:00
Jeremy Allison
e6676a9a69 r14387: Try and fix the coverity issues (#53, #54) with negative
sink by ensuring all uses of rpcstr_push are consistent
with a size_t dest size arg.
Jeremy.
(This used to be commit f65d7afe19)
2007-10-10 11:15:27 -05:00
Jeremy Allison
ed5095a490 r14336: Try and quieten coverity #53 and #54. Make it obvious
we're using -1 as a special size_t case by casting.
Jeremy.
(This used to be commit 415530bd08)
2007-10-10 11:15:25 -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
fa4df827d0 r12194: Ensure that when we set a connection path we've canonicalized
the name (must be abolute - start with /, must not end in /,
must have ./ and ../ removed). Of course for realpath resolved
paths this won't be the case but for others we need this name
to be canonicalized. This name is going into the sharemode db
for #3303 so needs to be in a normalized format.
Jeremy.
(This used to be commit 22e3300911)
2007-10-10 11:05:48 -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
Jeremy Allison
b67ba1e36b r9545: (Hopefully the last) fixes for DIR -> SMB_STRUCT_DIR.
Jeremy.
(This used to be commit b242f27860)
2007-10-10 11:01:12 -05:00
Jeremy Allison
78d6fa7277 r8963: Clean up the horrid "fake conn struct" part of MSDFS.
Jeremy.
(This used to be commit 14dd5ab632)
2007-10-10 11:00:23 -05:00
Jeremy Allison
abb81cfe26 r8959: Make msdfs code talloc based. Fix leaks.
Jeremy.
(This used to be commit 076023df8e)
2007-10-10 11:00:22 -05:00
Jeremy Allison
a4cdedcc08 r8950: Fix one more mem leak found by Gunther.
Jeremy.
(This used to be commit 547c6ee0a9)
2007-10-10 11:00:22 -05:00
Jeremy Allison
dada62cf82 r8948: Fix valgrind bad free bug found by Gunther.
Jeremy.
(This used to be commit ff291f4c97)
2007-10-10 11:00:22 -05:00
Gerald Carter
9365669a59 r8697: BUG 2908: make sure to allow for the trailing NULL
(This used to be commit 3b505a8243)
2007-10-10 11:00:15 -05:00
Jeremy Allison
bf547ff1ad r7981: MS-DFS tidyup patches from James Peach <jpeach@sgi.com>.
Looking forward to the day he can commit these himself :-).
Jeremy.
(This used to be commit 12ff297829)
2007-10-10 10:58:06 -05:00
Jeremy Allison
ff7e5c2673 r7893: Add in the extra parameters to opendir() to fix the large directory/insane app
problem. Rev vfs version. Doesn't change the normal codepath.
Jeremy.
(This used to be commit 0f03a6bdcd)
2007-10-10 10:58:02 -05:00
Gerald Carter
1253a174f3 r6242: after talking to jeremy, we can actually consolidate
the 2 BOOL flags in dfs_redirect() down to one since
they both are used in essentially the same context
(from what we can tell).

Tested Win98SE, WinXP sp 1 & 2, Win2k3 sp1, and WIn2k Sp4.
All dfs operations still seem to work.
(This used to be commit 59ffacf59c)
2007-10-10 10:56:31 -05:00
Gerald Carter
b751f95a25 r6237: fix my breakage of WinXP sp2 msdfs support.
We did need the special case for RESOLVE_DFSPATH
in the findfirst() code.

Jeremy, please verify I haven't broken the allow_wcard
code you added to resolve_dfs_path()
(This used to be commit 29983398e2)
2007-10-10 10:56:31 -05:00
Jeremy Allison
a5433c4bf7 r6053: Fixup dfs path with the new wildcard parser code split out.
Jeremy.
(This used to be commit e831cef618)
2007-10-10 10:56:19 -05:00
Jeremy Allison
27b84e5e55 r6048: Split out the check_path_syntax into a findfirst/next/wildcard version.
The semantics are different with wildcards.
Jeremy.
(This used to be commit f8b67159fc)
2007-10-10 10:56:18 -05:00
Gerald Carter
c1b9243c28 r5165: BUG 2295: always use get_local_machine_name() rather than digging in the gloval variable 'local_machine'
(This used to be commit 6a6e4af46a)
2007-10-10 10:55:31 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
fddef6fc20 r1115: Fix for #1427. Catch bad path errors at the right point. Ensure all
our pathname parsing is consistent.
Jeremy.
(This used to be commit 5e8237e306)
2007-10-10 10:51:56 -05:00
Stefan Metzmacher
9b4e6c7ea6 r410: merge tpot's changeset 353 from trunk:
Move msdfs.c into the source/smbd directory and remove source/msdfs.

metze
(This used to be commit 88e6e6d29c)
2007-10-10 10:51:22 -05:00