{"record":{"id":"61b41c94f315b390","repo":"projectdiscovery/nuclei","slug":"smb-path-is-a-directory-not-a-file-s","errorCode":null,"errorMessage":"smb path is a directory, not a file: %s","messagePattern":"smb path is a directory, not a file: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/file/smb_bridge.go","lineNumber":124,"sourceCode":"\t}\n\tfor _, e := range entries {\n\t\tif e.IsDir {\n\t\t\tcontinue\n\t\t}\n\t\tchild := *target\n\t\tchild.Path = e.Name\n\t\tcallback(child.Display())\n\t}\n\treturn nil\n}\n\nfunc (request *Request) readSMBFile(ctx context.Context, displayPath string) (string, error) {\n\ttarget, err := ParseSMBTarget(displayPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif target.Path == \".\" || isDirectorySMBTarget(displayPath) {\n\t\treturn \"\", fmt.Errorf(\"smb path is a directory, not a file: %s\", displayPath)\n\t}\n\texecID := request.executionID()\n\tif execID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"smb file target requires an initialized execution id\")\n\t}\n\tsess, err := smbsession.Dial(ctx, execID, target.Host, request.smbPort(target), request.resolveSMBCreds(target))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer sess.Close()\n\tmaxBytes := request.maxSize\n\tif maxBytes <= 0 {\n\t\tmaxBytes = smbsession.DefaultMaxReadBytes\n\t}\n\treturn sess.ReadFile(target.Share, target.Path, maxBytes)\n}\n\n// isDirectorySMBTarget reports whether the path refers to a share root / dir listing.","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/file/smb_bridge.go#L106-L142","documentation":"Error \"smb path is a directory, not a file: %s\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/protocols/file/smb_bridge.go:124 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}