summaryrefslogtreecommitdiffstats
path: root/source/smbd/msdfs.c
Commit message (Collapse)AuthorAgeFilesLines
* r25387: Sync with 3.2.0 svn treeGerald Carter2007-09-271-253/+617
|
* r24653: Some trivial 3_2->3_2_0 mergesVolker Lendecke2007-08-241-1/+1
|
* r24253: From Jan Martin <Jan.Martin@rwedea.com>.Jeremy Allison2007-08-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------------------------------------------- In rare cases, Samba 3.0.25b shows directory contents at the wrong position in the file tree when displaying a subdirectory of a DFS link. The problem occurs whenever Windows XP asks for a DFS referral for a subdirectory of a DFS link with a trailing backslash. Windows does not do this very often, but we saw it several times per day on our central DFS server. smbd/msdfs.c, dfs_path_lookup() does the following with the requested path: - in line 390, the local copy 'localpath' is 'unix_convert'ed; the trailing backslash is removed inside unix_convert - in lines 417-20, 'dfspath' (another copy of the requested path) is mangled another way without removing trailing backslashes That's why the following loop (lines 435-461) that is meant to synchronously cut off the last path component from both strings until it comes to a DFS link, does not handle both strings the same. When the original path ended with a backslash, 'canon_dfspath' has always one component more than 'localpath', so that *consumedcntp gets too big in line 446. This value is reported to the client. ---------------------------------------------------------- Bug #4860. Jeremy.
* r23843: Fix bug #4777, reported by Bill Marshall <bmarsh@us.ibm.com>.Jeremy Allison2007-07-111-1/+2
| | | | | | Doing a DFS traverse through a deep link could fail (not using explorer). Jeremy.
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-07-101-2/+1
|
* r23780: Find and fix more GPL2 -> GPL3.Jeremy Allison2007-07-091-1/+1
| | | | Jeremy.
* r23526: Merge 23522/23523 from 3_0:Volker Lendecke2007-06-161-3/+5
| | | | | | | | Save us a kilobyte stack space in a hot code path: I can't see a reason why check_path_syntax should not be able to run in-line. The destination pointer either walks side by side with the source pointer or is decremented. So as far as I can see s>=d is true throughout the whole routine.
* r23430: Merge r19963 from 3_0:Michael Adam2007-06-121-0/+1
| | | | | | Add 'registry shares = yes' and registry key security descriptors. Michael
* r22909: Change prototype of dump_data(), so that it takes unsigned char *Michael Adam2007-05-151-3/+3
| | | | | | | | | | instead of char *, which matches what samba4 has. Fix all the callers to prevent compiler warnings. This essentially ports r22001 from SAMBA_3_0 to SAMBA_3_0_26. There are a few additional type cast corrections.
* r22590: Make TALLOC_ARRAY consistent across all uses.Jeremy Allison2007-04-301-4/+8
| | | | | That should be it.... Jeremy.
* r22064: Fix the DFS code to work better with Vista clients. AllowJeremy Allison2007-04-031-32/+36
| | | | | | | | "host msdfs = true" to be set in the [global] section and allow Vista to see shares with "msdfs root = yes" and "msdfs root = no" off the same server. Down to an error message really :-). Jeremy.
* r21961: Repair bug introduced by rev. 21960.Jeremy Allison2007-03-241-0/+6
| | | | | We need to do the initial strtok to set up the internal state. Jeremy.
* r21960: Fix bugs 4463,4464,4465,4466. Thanks Jason :-)Volker Lendecke2007-03-241-2/+0
|
* r21942: Hoist by our own petard :-). Older smbclient binariesJeremy Allison2007-03-221-2/+2
| | | | | | | | | | | | | | 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.
* r21803: Missed part of patch to make self-referrals work.Jeremy Allison2007-03-121-0/+1
| | | | Jeremy.
* r21800: Check-in the DFS rewrite. I am still testing this but itJeremy Allison2007-03-121-370/+459
| | | | | | | | 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.
* r21759: Fix the same bug in a more elegant way, strrchr_mJeremy Allison2007-03-081-7/+12
| | | | | is an expensive call.... Jeremy.
* r21758: Fix a very specific dfs bug when passing in POSIXJeremy Allison2007-03-081-3/+6
| | | | | | | 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.
* r21756: An invarient the dfs code depended on for POSIX pathsJeremy Allison2007-03-071-4/+1
| | | | | is no longer true, so fix it. Jeremy.
* r21754: Volker is completely correct. There's no need forJeremy Allison2007-03-071-1/+31
| | | | | | | the RESOLVE_DFSPATH macros and their varients any more. Fix reporting profile bug with all error returns. Jeremy.
* r21251: Okay, after Jeremy has kindly tested this, check it in :-)Volker Lendecke2007-02-081-1/+5
| | | | | | | | | | | 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
* r21226: Fix bug #4377 (rename of "foo" -> "Foo" fails).Jeremy Allison2007-02-071-11/+29
| | | | | | | 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.
* r20671: This version of the pathname code passes volkersJeremy Allison2007-01-111-1/+1
| | | | | modified gentest to 1000 iterations. Jeremy.
* r20655: After consulting with Volker, fix our pathnameJeremy Allison2007-01-101-2/+4
| | | | | | | | | | handling. Gets rid of more code than it adds. I will port this to SAMBA_3_0 next. There are still some wrinkles with wildcard delete I am working on - for example a dirtype pattern of 0x8aa4 isn't handled correctly yet.... still looking at this. Jeremy.
* r19810: more merge work....does not compile currently. Working on smbd mergeGerald Carter2006-11-211-13/+21
|
* r19769: more compile fixes while merging from SAMBA_3_0 (not done yet)Gerald Carter2006-11-181-1/+7
|
* r17453: Fix msdfs RPC management (this broke with the autogenerated dfs rpcs).Günther Deschner2006-08-081-0/+1
| | | | | | | | | | * 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
* r17376: Fix bug #3985 - ensure in msdfs we check for ourJeremy Allison2006-08-021-14/+8
| | | | | | | 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.
* r16254: pulling klocwork fixes for 3.0.23rc3 (current up to r16251)Gerald Carter2006-06-151-1/+2
|
* r15837: starting sync up for 3.0.23rc1 (in sync with SAMBA_3_0 r15822)Gerald Carter2006-05-231-1/+4
|
* r14387: Try and fix the coverity issues (#53, #54) with negativeJeremy Allison2006-03-141-4/+4
| | | | | | sink by ensuring all uses of rpcstr_push are consistent with a size_t dest size arg. Jeremy.
* r14336: Try and quieten coverity #53 and #54. Make it obviousJeremy Allison2006-03-131-2/+2
| | | | | we're using -1 as a special size_t case by casting. Jeremy.
* r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison2006-03-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* r13316: Let the carnage begin....Gerald Carter2006-02-031-1/+7
| | | | Sync with trunk as off r13315
* r12194: Ensure that when we set a connection path we've canonicalizedJeremy Allison2005-12-121-1/+1
| | | | | | | | | 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.
* r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We canJeremy Allison2005-10-311-1/+2
| | | | | | | | 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.
* r9545: (Hopefully the last) fixes for DIR -> SMB_STRUCT_DIR.Jeremy Allison2005-08-231-1/+1
| | | | Jeremy.
* r8963: Clean up the horrid "fake conn struct" part of MSDFS.Jeremy Allison2005-08-021-11/+19
| | | | Jeremy.
* r8959: Make msdfs code talloc based. Fix leaks.Jeremy Allison2005-08-021-134/+195
| | | | Jeremy.
* r8950: Fix one more mem leak found by Gunther.Jeremy Allison2005-08-021-4/+4
| | | | Jeremy.
* r8948: Fix valgrind bad free bug found by Gunther.Jeremy Allison2005-08-021-2/+6
| | | | Jeremy.
* r8697: BUG 2908: make sure to allow for the trailing NULLGerald Carter2005-07-221-2/+1
|
* r7981: MS-DFS tidyup patches from James Peach <jpeach@sgi.com>.Jeremy Allison2005-06-281-25/+36
| | | | | Looking forward to the day he can commit these himself :-). Jeremy.
* r7893: Add in the extra parameters to opendir() to fix the large ↵Jeremy Allison2005-06-251-1/+1
| | | | | | | directory/insane app problem. Rev vfs version. Doesn't change the normal codepath. Jeremy.
* r6242: after talking to jeremy, we can actually consolidateGerald Carter2005-04-071-8/+10
| | | | | | | | | 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.
* r6237: fix my breakage of WinXP sp2 msdfs support.Gerald Carter2005-04-071-5/+16
| | | | | | | | 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()
* r6053: Fixup dfs path with the new wildcard parser code split out.Jeremy Allison2005-03-251-22/+17
| | | | Jeremy.
* r6048: Split out the check_path_syntax into a findfirst/next/wildcard version.Jeremy Allison2005-03-241-2/+2
| | | | | The semantics are different with wildcards. Jeremy.
* r5165: BUG 2295: always use get_local_machine_name() rather than digging in ↵Gerald Carter2005-02-011-4/+3
| | | | the gloval variable 'local_machine'
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2004-12-071-7/+6
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.