News for hackers. Stuff that matters.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by Cyph0n on Tuesday September 14, 2021 @11:16PM (#28534839)
Looks like it’s mostly C, and not great C at that… In my humble opinion, this is a scary looking project.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by randomfool on Wednesday September 15, 2021 @01:14AM (#28535501)
Specifically- it appears to be mostly C99, lots of macros, lots of ugly buffer manipulation. But it's tooled for PREFast so you know it's secure! (https://github.com/microsoft/omi/blob/4ce2cf1cb0aa656b8eb934...) (j/k... I haven't seen that in ages). Guessing a port of MS's internal WMI codebase?

This codebase just smells of rot all over.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @05:01AM (#28536846)
That is why there is "Modern C", "Modern C++" as talked at conferences, blog posts and endless over here, and then real life code that we actually find out in production.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by int_19h on Wednesday September 15, 2021 @06:40AM (#28537472)
I've seen and written plenty of modern (at the time of writing) C++ in production. It really depends on the team and the product.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @06:53AM (#28537530)
Sure, yet this is the outcome from companies deeply involved in ISO, let alone those where regular folks don't even care HN exists.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by int_19h on Wednesday September 15, 2021 @01:59PM (#28542276)
Ironically, most modern C++ code I wrote was not for Microsoft, but a much smaller company that is not in any way involved in ISO C++ standardization process. It was due to that company culture - senior engineering leadership (which were also the founders) were all big standard C++ fans, and they wrote much of the original codebase.

Large companies like MS often have codebases that are so ancient (e.g. HRESULTs and IF_ERR_GOTO type macros everywhere), they only get modernized very gradually if at all.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @04:56PM (#28544241)
I only use C++ for libraries that are then plugged into managed runtimes.

Most of the stuff I see in the wild could be considered what I call C+, basically MFC style with plenty of C love.

While Microsoft has the excuse for older code bases, stuff like WRL and C++/WinRT also has its share of not only following what is preached regarding C++ Core Guidelines love.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by silon42 on Wednesday September 15, 2021 @06:40AM (#28537470)
So the choice is RIIR or RIIC++ ?
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @06:52AM (#28537524)
It can also be RIIC#, RIID, RIIGo, RIIAda, RIIJava,... take your pick.