Skip to content

Commit

Permalink
README.Coding: Approve DBG statements using dom_sid_str_buf
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
  • Loading branch information
vlendec authored and slowfranklin committed Nov 22, 2018
1 parent a3dd28c commit 1295e2b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.Coding
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,22 @@ an iterator style:
... do something with opt ...
}

Another exception: DBG messages for example printing a SID or a GUID:
Here we don't expect any surprise from the printing functions, and the
main reason of this guideline is to make debugging easier. That reason
rarely exists for this particular use case, and we gain some
efficiency because the DBG_ macros don't evaluate their arguments if
the debuglevel is not high enough.

if (!NT_STATUS_IS_OK(status)) {
struct dom_sid_buf sid_buf;
struct GUID_txt_buf guid_buf;
DBG_WARNING(
"objectSID [%s] for GUID [%s] invalid\n",
dom_sid_str_buf(objectsid, &sid_buf),
GUID_buf_string(&cache->entries[idx], &guid_buf));
}

But in general, please try to avoid this pattern.


Expand Down

0 comments on commit 1295e2b

Please sign in to comment.