shadow1ng/fscan · error
%s [ldpreload_system_lib_dir_not_found]
Error message
%s [ldpreload_system_lib_dir_not_found]
What it means
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.
Source
Thrown at plugins/local/ldpreload.go:157
systemDirs := []string{
"/usr/lib/x86_64-linux-gnu",
"/usr/lib64",
"/usr/lib",
"/lib/x86_64-linux-gnu",
"/lib64",
"/lib",
}
var targetDir string
for _, dir := range systemDirs {
if _, err := os.Stat(dir); err == nil {
targetDir = dir
break
}
}
if targetDir == "" {
return "", fmt.Errorf("%s", i18n.GetText("ldpreload_system_lib_dir_not_found"))
}
// 生成目标路径
basename := filepath.Base(targetFile)
if !strings.HasPrefix(basename, "lib") {
basename = "lib" + basename
}
if !strings.HasSuffix(basename, ".so") {
basename = strings.TrimSuffix(basename, filepath.Ext(basename)) + ".so"
}
targetPath := filepath.Join(targetDir, basename)
// 复制文件
err := p.copyFile(targetFile, targetPath)
if err != nil {
return "", err
}View on GitHub (pinned to 95cc12e753)
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
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at plugins/local/ldpreload.go:157 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06).
Data as JSON: /api/errors/6e9fb5e2c3f4ac8c.
Report an issue: GitHub.