Skip to content

s3: smbd: Remove legacy (core+, lanman1 protocol level) SMB1 wildcard processing for copy, rename and unlink.

Cleanup our path processing by removing the legacy CORE and LANMAN1 wildcard, unlink and copy behavior from smbd. First part of pathname processing cleanup. First step in removing SMB1 completely.

Wildcard rename or unlink isn't used by any Windows clients since WindowsXP (the last known user of these calls is Windows98), and is purely legacy for DOS and Windows95. When presented with a wildcard pathname via explorer or cmd.exe, WindowsXP enumerates the directory and does individual operations on the matching targets rather than using any old protocol SMB1 wildcard calls.

Removing it makes our pathname code comprehensible (i.e. I can fix security bugs in it :-).

Looks bigger than it is (honest :-).

Patches #1 - #8 are converting all s4 smbtorture uses of smbcli_unlink() to use a new function smbcli_unlink_wcard() that enumerates wildcards and does individual operations, as does our modern client code.

Patches #9 - #17 convert s3 smbtorture3 setup and teardown cleanup code to use a new function torture_deltree() that removes everything under a target directory name and the directory itself. Modeled after s4 smbcli_deltree(). I'm amazed we didn't already have this to be honest.

Patches #18 - #21 remove the wildcard tests that will no longer work once the server support for wildcard rename and unlink are removed. There are very few tests removed here, and they are all legacy SMB1 stuff.

Patches #22 - #38 are the actual smbd server changes that remove the nightmare wildcard code from smbd. Removing reply_copy() is easy, as that was never used or tested (and is essentially an smbd DoS waiting to be used). I've broken them up into as small as I can, so that each change is understandable.

Patch #22 - remove reply_copy().

Patches #23 - #25 remove the unlink wildcard code.

Patches #26 - #38 remove the rename wildcard code.

Passes ci.

I now understand our pathname processing again, and am preparing to make further cleanups.

Edited by Jeremy Allison

Merge request reports

Loading