Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions src/detection/os/os_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@ FF_MAYBE_UNUSED static void getUbuntuFlavour(FFOSResult* result)
ffStrbufSetStatic(&result->idLike, "ubuntu");
}

if (ffPathExists("/usr/bin/lliurex-version", FF_PATHTYPE_FILE))
{
ffStrbufSetStatic(&result->name, "LliureX");
ffStrbufSetStatic(&result->id, "lliurex");
ffStrbufClear(&result->version);
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
"/usr/bin/lliurex-version",
NULL,
}) == NULL) // 8.2.2
ffStrbufTrimRightSpace(&result->version);
ffStrbufSetF(&result->prettyName, "LliureX %s", result->version.chars);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if ffProcessAppendStdOut failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lliurex-version is a basic system command in lliurex, if it fails then something is really wrong, it wold be as if command lsb_release fails. If you want I can add any behaviour on fail but the tests I did seemed to be ok without any issue at all.

Cheers

ffStrbufSetStatic(&result->idLike, "ubuntu");
return;
}

if(ffStrContains(xdgConfigDirs, "kde") || ffStrContains(xdgConfigDirs, "plasma") || ffStrContains(xdgConfigDirs, "kubuntu"))
{
ffStrbufSetStatic(&result->name, "Kubuntu");
Expand Down Expand Up @@ -169,15 +184,6 @@ FF_MAYBE_UNUSED static void getUbuntuFlavour(FFOSResult* result)
ffStrbufSetStatic(&result->idLike, "ubuntu");
return;
}

if(ffStrContains(xdgConfigDirs, "lliurex"))
{
ffStrbufSetStatic(&result->name, "LliureX");
ffStrbufSetF(&result->prettyName, "LliureX %s", result->version.chars);
ffStrbufSetStatic(&result->id, "lliurex");
ffStrbufSetStatic(&result->idLike, "ubuntu");
return;
}
}

FF_MAYBE_UNUSED static void getDebianVersion(FFOSResult* result)
Expand Down
Loading