mirror of
https://github.com/tnodir/fort
synced 2024-11-15 03:56:18 +00:00
Driver: fortcout: Minor refactor
This commit is contained in:
parent
523885987d
commit
ee4a369257
@ -395,14 +395,21 @@ inline static BOOL fort_callout_ale_check_svchost_sid(const SID *sid)
|
|||||||
return FALSE; // not "Service SID"'s prefix
|
return FALSE; // not "Service SID"'s prefix
|
||||||
|
|
||||||
const BYTE *idAuth = &sid->IdentifierAuthority.Value[0];
|
const BYTE *idAuth = &sid->IdentifierAuthority.Value[0];
|
||||||
if (idAuth[5] != 5 || idAuth[4] != 0 || *((PUINT32) &idAuth[0]) != 0)
|
if (idAuth[5] != 5)
|
||||||
|
return FALSE; // not "NT Authority"
|
||||||
|
|
||||||
|
if (idAuth[4] != 0 || *((PUINT32) &idAuth[0]) != 0)
|
||||||
return FALSE; // not "NT Authority"
|
return FALSE; // not "NT Authority"
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static BOOL fort_callout_ale_fill_path_sid(PCFORT_CALLOUT_ARG ca, PFORT_CALLOUT_ALE_EXTRA cx)
|
inline static BOOL fort_callout_ale_fill_path_sid(
|
||||||
|
PCFORT_CALLOUT_ARG ca, PFORT_CALLOUT_ALE_EXTRA cx, BOOL isSvcHost)
|
||||||
{
|
{
|
||||||
|
if (!isSvcHost)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
const PSID_AND_ATTRIBUTES_HASH sidHash = fort_callout_ale_get_sid(ca);
|
const PSID_AND_ATTRIBUTES_HASH sidHash = fort_callout_ale_get_sid(ca);
|
||||||
if (sidHash == NULL)
|
if (sidHash == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -440,8 +447,7 @@ inline static void fort_callout_ale_fill_path(PCFORT_CALLOUT_ARG ca, PFORT_CALLO
|
|||||||
|
|
||||||
if (fort_pstree_get_proc_name(
|
if (fort_pstree_get_proc_name(
|
||||||
&fort_device()->ps_tree, cx->process_id, path, &isSvcHost, &inherited)
|
&fort_device()->ps_tree, cx->process_id, path, &isSvcHost, &inherited)
|
||||||
// Check Service SID
|
|| fort_callout_ale_fill_path_sid(ca, cx, isSvcHost)) {
|
||||||
|| (isSvcHost && fort_callout_ale_fill_path_sid(ca, cx))) {
|
|
||||||
|
|
||||||
if (!inherited) {
|
if (!inherited) {
|
||||||
*real_path = *path;
|
*real_path = *path;
|
||||||
|
Loading…
Reference in New Issue
Block a user