Report error enumerating shares. Fixes #2272
Some checks are pending
nmap multiplatform autobuilds / build (arm64, gcc, ubuntu-latest-gcc-arm64, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, freebsd-15-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-15-clang, macos-15) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-26-clang, macos-26) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, netbsd-10-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, openbsd-7-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, solaris-11-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, ubuntu-latest-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (egcc, openbsd-7-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, freebsd-15-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, netbsd-10-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, solaris-11-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, ubuntu-latest-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (msvc, windows-latest-msvc, windows-latest) (push) Waiting to run

This commit is contained in:
dmiller 2026-07-23 21:55:44 +00:00
parent 30f3839df2
commit 3cb5343e43

View file

@ -3309,11 +3309,13 @@ function share_get_list(host)
local status, result
stdnse.debug1("SMB: Getting information for share: %s", shares[i])
status, result = share_get_details(host, shares[i])
if not status and result == 'NT_STATUS_BAD_NETWORK_NAME' then
stdnse.debug1("SMB: Share doesn't exist: %s", shares[i])
elseif not status then
stdnse.debug1("SMB: Error while getting share details: %s", result)
return false, result
if not status then
if result == 'NT_STATUS_BAD_NETWORK_NAME' then
stdnse.debug1("SMB: Share doesn't exist: %s", shares[i])
else
stdnse.debug1("SMB: Error while getting share details: %s", result)
end
table.insert(share_details, {name=shares[i], details=result})
else
-- Save the share details
table.insert(share_details, result)