summaryrefslogtreecommitdiff
path: root/source3/smbd/msdfs.c
AgeCommit message (Collapse)AuthorFilesLines
2008-07-27Make create_conn_struct() publicVolker Lendecke1-1/+1
(This used to be commit e115e2582256c34e6905afc8c2929efd6ea61088)
2008-06-24Move the responsibility to keep the cwd from srv_dfs_nt to msdfs.cVolker Lendecke1-17/+53
(This used to be commit 7db382588ac90fe250b72cf4cd07afb39fcae7c0)
2008-06-22Remove the "exists" parameter from create_msdfs_linkVolker Lendecke1-11/+11
Jeremy, setting "exists" to True in _dfs_Add prevented the initial creation of a new symlink for me, because the SMB_VFS_UNLINK failed. This also exists in 3.2. I only check it into 3.3 as I would like you to look at it first. Thanks, Volker (This used to be commit f58b098a4172949018e84c4d0c722d6eb9bba514)
2008-06-22Reduce memory usage in form_junctions() a little bitVolker Lendecke1-0/+1
(This used to be commit d031e6d8cabe2dd0b29e90d173d45843e145176a)
2008-06-22Fix an abort in junction_to_local_pathVolker Lendecke1-1/+1
(This used to be commit 587bd636cb70d09600111ced040adaa55af35d0f)
2008-06-22Fix a crash in _dfs_EnumVolker Lendecke1-0/+2
(cherry picked from commit 4a996476297963d4cb300b4d45c23e83a493c339) (This used to be commit 86cae83a7db87063ecd6e58eaa15f11441c45040)
2008-06-22Fix an uninitialized variable access in callers of parse_msdfs_symlinkVolker Lendecke1-1/+2
At least form_junctions() does not initialize refcount, and I don't see it in get_referred_path(). For the latters, the callers might initialize it. But even if they did, I think parse_msdfs_symlink() should unconditionally return the number of referrals it found. I don't think it makes sense to count them up from somewhere else. (This used to be commit 73172113484a2c6c9af014f59e84707716c61a7d)
2008-06-21Fix a double-closedir() in form_junctions()Volker Lendecke1-1/+0
(This used to be commit 1d7ad0dea7ebf7a46af6e695797e5132264307d6)
2008-05-25Remove some references to get_current_username() and current_user_infoVolker Lendecke1-0/+11
(This used to be commit 344d69f95e217d16213eaa6b53141af6ab459708)
2008-05-19Restructuring of code to fix #5460. Remove searchJeremy Allison1-16/+12
by name code from conn, we were already doing the same check in the dfs_redirect() function, so move it into parse_dfs_path() instead. Jeremy. (This used to be commit 8a7c6df122c5e4a1d0f74ab0f1bc9376a0a8bcb1)
2008-05-13Fix debug message.Jeremy Allison1-2/+2
Jeremy. (This used to be commit 08d168f0e5b8fb07e95a5118a839e0da53e9d363)
2008-05-13Second part of patch for bug #5460. Cope with pathnamesJeremy Allison1-15/+39
that don't look like \xxx\yyy, cope with arbitrary length. Jeremy. (This used to be commit 635035d999fcd8e06b70c8cb1137127c289dc9e6)
2008-05-13Fix bug #5460. The problem is RHEL5.0 shipped a CIFS clientJeremy Allison1-0/+10
that sets the DFS bit on pathnames but doesn't send DFS paths. This causes lookups to fail as the smbd/msdfs.c code now just eats the first two parts of the pathname and uses the rest as the local path. The previous hostname check used to protect us from that as we knew that when the hostname was invalid it was a local path (and a broken client). I didn't want to put that check back in, but came up with another idea - even though the hostname can be a different one, the sharename must be valid on this machine. So we can check for a valid sharename instead. Jeremy. (This used to be commit e1cda82f6f7de3306a653af920756c1640057f2d)
2008-05-05Fix dfs_Enum: In form_junctions, correctly check for malloc failureVolker Lendecke1-1/+1
(This used to be commit 1b1614c3261e1e93a2cad1f1063e28cbbb13f434)
2008-05-05Remove connection_struct->mem_ctx, connection_struct is its own parentVolker Lendecke1-45/+36
(This used to be commit 559180f7d30606d1999399d954ceedc798c669a4)
2008-04-02Fix MSDFS bug noticed by Ofir Azoulay <Ofir.Azoulay@expand.com>.Jeremy Allison1-30/+0
There is no reason to ensure the target host is ourselves, and this breaks MS clients in some cases. Jeremy. (This used to be commit c19fdf43d16ce9fba3e8e12e6192bac31837715e)
2008-01-23strtok -> strtok_rVolker Lendecke1-2/+3
(This used to be commit fd34ce437057bb34cdc37f4b066e424000d36789)
2007-12-07Don't build rpctorture anymore - not maintained. Just remove.Jeremy Allison1-1/+1
Remove all vestiges of pstring (except for smbctool as noted in previous commit). Jeremy (This used to be commit 4c32a22ac50ada3275d2ffba3c1aa08bee7d1549)
2007-11-10Always define PATH_MAX. Makes code simpler (removesJeremy Allison1-21/+41
a bunch of #defines). Remove pstring from msdfs.c. Jeremy. (This used to be commit e203ba22275320808bc11b17361ad1f2d5b0b897)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-28/+28
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r25327: Normalize the path we return for 'msdfs proxy'Volker Lendecke1-1/+11
We now accept both \\server\tmp and \server\tmp. There are other places where this might be necessary, but at least the functionality is a bit easier now. (This used to be commit 25cc27df97e9eecb470f99ea934de12f2a0f4df9)
2007-10-10r25324: Fix "msdfs proxy"Volker Lendecke1-1/+1
Jeremy, please check! (This used to be commit d4eddf88d20b09c450d4358d2ef1bc35736501ff)
2007-10-10r25184: Fix some C++ warnings and an uninitialized variableVolker Lendecke1-1/+1
(This used to be commit b64df8a3c504ab7749c21ffb26e4771a9a0a328f)
2007-10-10r25173: Use the append_buffer version in a loop.Jeremy Allison1-2/+2
Jeremy. (This used to be commit 37cf2c272751065245dd46708af0a78f1f0c47df)
2007-10-10r25138: More pstring elimination. Add a TALLOC_CTX parameterJeremy Allison1-1/+1
to unix_convert(). Jeremy. (This used to be commit 39c211a702e91c34c1a5a689e1b0c4530ea8a1ac)
2007-10-10r25111: Move to talloced pathnames on most code paths.Jeremy Allison1-10/+6
There are now ony 17 pstrings left in reply.c, and these will be easy to remove (and I'll be doing that shortly). Had to fix an interesting bug in pull_ucs2_base_talloc() when a source string is not null terminated :-). Jeremy. (This used to be commit 0c9a8c4dff10974dbffd2a302ae982896122fcc0)
2007-10-10r25102: Rewrite msdfs code to use talloced filenames. Passes make testJeremy Allison1-252/+609
and make valgrindtest. Final step will be to change srvstr_get_path() to return talloced memory in the major codepaths. Jeremy. (This used to be commit cf6b6f9c3a38b68d2671c753f412772344506742)
2007-10-10r25009: Large patch discussed with Volker. Move unix_convert to a talloc-basedJeremy Allison1-3/+4
interface. More development will come on top of this. Remove the "mangled map" parameter. Jeremy. (This used to be commit dee8beba7a92b8a3f68bbcc59fd0a827f68c7736)
2007-10-10r24253: From Jan Martin <Jan.Martin@rwedea.com>.Jeremy Allison1-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. (This used to be commit 42d1c6713a56197ca8dfebf74eb0d483102148f7)
2007-10-10r23843: Fix bug #4777, reported by Bill Marshall <bmarsh@us.ibm.com>.Jeremy Allison1-1/+2
Doing a DFS traverse through a deep link could fail (not using explorer). Jeremy. (This used to be commit cd93f0cb00207098014e41e0ba16210cb150b895)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23522: Save us a kilobyte stack space in a hot code path: I can't see a reasonVolker Lendecke1-3/+5
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. Jeremy, I'm checking this only into 3_0 for now. Please review and ack or directly merge this to 3_0_26. Thanks, Volker (This used to be commit 34a13c82a3b72d6900614b57c58fbaefeeca8fa7)
2007-10-10r22590: Make TALLOC_ARRAY consistent across all uses.Jeremy Allison1-4/+8
That should be it.... Jeremy. (This used to be commit 603233a98bbf65467c8b4f04719d771c70b3b4c9)
2007-10-10r22064: Fix the DFS code to work better with Vista clients. AllowJeremy Allison1-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. (This used to be commit 1a0f69bb21fd03a18514dfc93c84568708144e28)
2007-10-10r22001: change prototype of dump_data(), so that it takes unsigned char * now,Stefan Metzmacher1-3/+3
which matches what samba4 has. also fix all the callers to prevent compiler warnings metze (This used to be commit fa322f0cc9c26a9537ba3f0a7d4e4a25941317e7)
2007-10-10r21961: Repair bug introduced by rev. 21960.Jeremy Allison1-0/+6
We need to do the initial strtok to set up the internal state. Jeremy. (This used to be commit 8c7042b4192cb33988c1bbccdd4a80bb99fd0118)
2007-10-10r21960: Fix bugs 4463,4464,4465,4466. Thanks Jason :-)Volker Lendecke1-2/+0
(This used to be commit a2e27c443101a59ef3429a55e049af3ebd5ec1f2)
2007-10-10r21942: Hoist by our own petard :-). Older smbclient binariesJeremy Allison1-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. (This used to be commit 8c4d929c76ba56d59f651c57d1feb37d2916a436)
2007-10-10r21803: Missed part of patch to make self-referrals work.Jeremy Allison1-0/+1
Jeremy. (This used to be commit b1fa55e513f506bfb58687b692e1507732b00fbc)
2007-10-10r21800: Check-in the DFS rewrite. I am still testing this but itJeremy Allison1-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. (This used to be commit 7a7862c01d07796ef206b255c676ad7dc2cc42fc)
2007-10-10r21759: Fix the same bug in a more elegant way, strrchr_mJeremy Allison1-7/+12
is an expensive call.... Jeremy. (This used to be commit 321a136dbce1a0532f123ea79ecb91f987b9a286)
2007-10-10r21758: Fix a very specific dfs bug when passing in POSIXJeremy Allison1-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. (This used to be commit 1722ea20db2d531f92fb18fa5783f09258727c64)
2007-10-10r21756: An invarient the dfs code depended on for POSIX pathsJeremy Allison1-4/+1
is no longer true, so fix it. Jeremy. (This used to be commit 698159c0ee8d9adb3b56231c0c8ad2ddebd5be11)
2007-10-10r21754: Volker is completely correct. There's no need forJeremy Allison1-1/+31
the RESOLVE_DFSPATH macros and their varients any more. Fix reporting profile bug with all error returns. Jeremy. (This used to be commit cdf0fdb1049fd68b46885cbea887dc0e595fa524)
2007-10-10r21251: Okay, after Jeremy has kindly tested this, check it in :-)Volker Lendecke1-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 (This used to be commit 4c3a9135629415086698da28596f68f7a9db9133)
2007-10-10r21226: Fix bug #4377 (rename of "foo" -> "Foo" fails).Jeremy Allison1-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. (This used to be commit 5fe25588f57ee59d70a66c755dfe70312e7afd08)
2007-10-10r20718: Sync up the filename path parsing changes from SAMBA_3_0_24.Jeremy Allison1-2/+4
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 f4474edf6a0c71001dbd01429ef70bafad6abd74)
2007-10-10r19963: Add 'registry shares = yes' and registry key security descriptors.Volker Lendecke1-0/+1
(This used to be commit 6cab254c49e07b11c170511ec613f0f33914c3e6)
2007-10-10r18481: Use pidl-generated server side code for dfs.Jelmer Vernooij1-5/+6
(This used to be commit 3f337c104d42321595161d0283b39357df252a8e)