{"record":{"id":"6e9fb5e2c3f4ac8c","repo":"shadow1ng/fscan","slug":"s-ldpreload-system-lib-dir-not-found","errorCode":null,"errorMessage":"%s [ldpreload_system_lib_dir_not_found]","messagePattern":"(.+?) \\[ldpreload_system_lib_dir_not_found\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/local/ldpreload.go","lineNumber":157,"sourceCode":"\tsystemDirs := []string{\n\t\t\"/usr/lib/x86_64-linux-gnu\",\n\t\t\"/usr/lib64\",\n\t\t\"/usr/lib\",\n\t\t\"/lib/x86_64-linux-gnu\",\n\t\t\"/lib64\",\n\t\t\"/lib\",\n\t}\n\n\tvar targetDir string\n\tfor _, dir := range systemDirs {\n\t\tif _, err := os.Stat(dir); err == nil {\n\t\t\ttargetDir = dir\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif targetDir == \"\" {\n\t\treturn \"\", fmt.Errorf(\"%s\", i18n.GetText(\"ldpreload_system_lib_dir_not_found\"))\n\t}\n\n\t// 生成目标路径\n\tbasename := filepath.Base(targetFile)\n\tif !strings.HasPrefix(basename, \"lib\") {\n\t\tbasename = \"lib\" + basename\n\t}\n\tif !strings.HasSuffix(basename, \".so\") {\n\t\tbasename = strings.TrimSuffix(basename, filepath.Ext(basename)) + \".so\"\n\t}\n\n\ttargetPath := filepath.Join(targetDir, basename)\n\n\t// 复制文件\n\terr := p.copyFile(targetFile, targetPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/local/ldpreload.go#L139-L175","documentation":"Raised in copyToSystemPath when none of the standard system library directories (/usr/lib*, /lib*, etc.) exist on the target, so there is nowhere to copy the LD_PRELOAD .so. Indicates a very unusual or containerized filesystem.","triggerScenarios":"Thrown at plugins/local/ldpreload.go:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the target layout — /lib or /usr/lib should exist on normal Linux","Specify a custom target directory if the layout is nonstandard","Fall back to another persistence mechanism"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}