Video není dostupné.
Omlouváme se.

How NOT TO CODE: Intel's Linux Thunderbolt Utils Code is the WORST I have EVER SEEN!

Sdílet
Vložit
  • čas přidán 18. 07. 2023
  • #GNU #grep anti patterns that cause #bugs #t2sde #linux #Ads & more @Amazon: services.exact... You can support my work at: / renerebe github.com/spo...
    exactcode.com t2sde.org rene.rebe.de

Komentáře • 527

  • @MoreReneRebe
    @MoreReneRebe  Před rokem +131

    Over 7 (!!!) month later neither Intel nor the developer have responded to the three major issues I opened, nor has there been any other upstream activity:
    github.com/intel/thunderbolt-utils/issues/6
    github.com/intel/thunderbolt-utils/issues/7

    • @jorgewemyss3994
      @jorgewemyss3994 Před 5 měsíci +5

      I would never criticize in public the way other person codes. even more make a youtube video about it.

    • @en7998
      @en7998 Před 5 měsíci +47

      Why not. The main point here is that this level of coding should be unacceptable for release, especially for an organization like Intel. Noone is being shamed here.

    • @jorgewemyss3994
      @jorgewemyss3994 Před 5 měsíci +7

      @@en7998 I think he's free to suggest better ways of doing things, but doing a theatrical display about how bad done it is, is another thing

    • @willjsky
      @willjsky Před 5 měsíci +21

      ​@@jorgewemyss3994 If you put your code online then the only way to criticise it is in public. There is no expectation of privacy in a public forum and "praise in public, criticise in private" doesn't apply in such circumstances.

    • @famoustoxo5644
      @famoustoxo5644 Před 5 měsíci +8

      @@jorgewemyss3994Are you by any chance Rajat Khandelwal ?

  • @beaubradley9539
    @beaubradley9539 Před 5 měsíci +289

    You must live a blessed professional life if this is the worst code you've seen.

    • @liquidsnake6879
      @liquidsnake6879 Před 4 měsíci +9

      This isn't just ugly code, it's functionally ridiculous, the whole concept of it is nonsensical, that they would write a C program that operates as a wrapper for bash scripts that run sudo commands inside it is just from a conceptual standpoint insane.
      The only thing i've ever seen that compares is when in 1st year of CS i tried to pull a fast one on the teacher by giving him CodeDom nonsense in C# when he asked for a compiler lol i got an F and a talking to afterwards lol
      But for a professional at Intel to do this kind of thing in an open-source core util library is wild beyond words, i absolutely understand Rene's frustration

  • @avarise5607
    @avarise5607 Před 5 měsíci +201

    I was expecting obvious mem leaks, and quadruple nested loops, not a C bash wrapper 😢

  • @Th1200
    @Th1200 Před 5 měsíci +87

    writing basically a bash script in c seems like the most painful task I can imagine...

  • @lizard450
    @lizard450 Před 5 měsíci +145

    The CIA code reviewed it and said it was perfectly fine.
    In all seriousness the code... I've seen worse... Just not more vulnerable.

  • @SentientSeven
    @SentientSeven Před 5 měsíci +96

    I clicked this video thinking "How bad could it be?"... But oh boy, I was not ready for this.

    • @nestorfernandez3859
      @nestorfernandez3859 Před 5 měsíci +2

      I was thinking maybe is the things I do and probably don't know currently how to do better, but no it's like tendfold worst 😂

    • @wlangstroth
      @wlangstroth Před 5 měsíci +6

      I saw your comment, thinking "People are so dramatic in comments, so I'll just take a loo- HOLY MOTHER OF

  • @suic86
    @suic86 Před 6 měsíci +413

    No sarcasm: You're spoiled. This is what ENTERPRISE-level code looks like. (Normally, the shittier the code is, the more expensive the product is.) No joke! In banking and finance, it is even worse. The only comparable thing I've ever seen was Python code written inside and executed from a VBA macro :D

    • @MoreReneRebe
      @MoreReneRebe  Před 6 měsíci +89

      😭

    • @markuszhang1998
      @markuszhang1998 Před 5 měsíci +20

      Makes one wonder if the best thing to do is FIRE and just code on one's own project.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +12

      @@doublewhopper67 sure, can you name some good ones?

    • @teknologist7914
      @teknologist7914 Před 5 měsíci

      @@markuszhang1998 This is why Bitcoin was invented, bro!

    • @gatogordo4131
      @gatogordo4131 Před 5 měsíci +17

      Maybe in India that’s the case, the source of the worst code

  • @tacokoneko
    @tacokoneko Před rokem +81

    Thanks so much for covering this.. I kept reading that and totally double taking, thinking "am I the stupid one, if Intel is doing this then is it actually as bad as it looks?"
    I went and looked at pciutils to restore my sanity. In ALL of pciutils there is only *ONE* place where it does this, popen() a shell command, and it's an ancient file that is ONLY used for the IBM AIX OS, and it uses it on an AIX-exclusive binary that is probably closed-source like the rest of AIX. And the author even left a disclaimer "briefly tested, and seems to supply basic information correctly, but I promise no more." That esoteric edge case is clearly the only time this should be considered acceptable, when there is probably no other way for that obsolete OS.

    • @tacokoneko
      @tacokoneko Před rokem +10

      And even that one instance has better error handling than the thunderbolt-utils.

  • @delicious_seabass
    @delicious_seabass Před rokem +245

    The only logical explanation is that they got an intern to work on this.

    • @MoreReneRebe
      @MoreReneRebe  Před rokem +59

      They should qa their interns, ...

    • @delicious_seabass
      @delicious_seabass Před rokem +52

      @@MoreReneRebe They should QA their QA for letting it through. 😁

    • @tui3264
      @tui3264 Před rokem +32

      this is what happens when you only hire leetcode pros , can't believe this is from same company who wrote hyperscan

    • @Baebon6259
      @Baebon6259 Před 6 měsíci +12

      an intern that probably used ChatGPT to write it.

    • @gigiperih
      @gigiperih Před 6 měsíci +33

      Nah man, the author is indian he is either principle engineer or above.. they good at doing something bad :)

  • @xcoder1122
    @xcoder1122 Před 5 měsíci +29

    I studied computer science at a university that is one of the top ten technical universities in the world, and even after three years we hardly ever had to write code, and when we did write code it was in academic languages that no one I know uses for real world projects. As for writing C code, I know people who have done their masters and can't even write a C program, as shown in the video, because the language C was only used a few times in exams and it was only to code an algorithm but just because you can code a simple algorithm in C doesn't mean you have any idea how to write a full program.
    The whole course revolved around algorithms (but their theory and how to develop own ones, not how to implement them), a lot of mathematics (math alone was easily 50% of the course), automata theory, how IT technology works and computer language theory (i.e. what is functional programming, what is object-oriented programming, etc.), but nothing meaningful was ever developed. You were expected to acquire this knowledge yourself, but this knowledge was never tested, so many here only did the bare minimum. There were extra courses that you had to take, but here you could choose which ones and if you didn't want to take courses where you really had to write code, you didn't have to, so many didn't.
    Maybe that has all changed since I finished my studies, but I doubt it, because when computer science graduates apply to us, they regularly don't really know how to program. They may have all the theoretical knowledge in the world and can answer any question, but let them write a simple app and you'll immediately see that these people have never programmed anything meaningful in their lives and have no idea how to go about it. Or they can program, but only in languages that have no commercial use.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +13

      Sure I agree theoretical CS is very theoretical and should be. Yet in all that time one should learn enough theory to know that all the points outlined in that video are not reasonable implementation details. And someone with some more knowledge should have reviewed it

    • @BlueSheep95
      @BlueSheep95 Před 5 měsíci +7

      Nope. Nothing changed. I'm in 8th semester of my Bachelor in Computer Science and most of my coding skills were self taught. I did a lot of programming in my free time to get better at what I'm doing. Code this bad I would have written in like the first two weeks of programming ever, in my entire life. School and universities teaches us, how to understand algorithms, not how to implement them. Sadly I know some people who would definitely write even worse code than demonstrated in the video, myself excluded of course. ;) And these people have far better grades than I am... Bruh...

    • @amagicmuffin1191
      @amagicmuffin1191 Před 5 měsíci

      depends on the school. mine, for cs majors at least, has classes that require writing code practically every semester it seems.

  • @amilamad
    @amilamad Před 5 měsíci +46

    This makes me more confident. I always thought i was not good enough for apply for places like intel

    • @brylozketrzyn
      @brylozketrzyn Před 5 měsíci +12

      They even hired a guy that never wrote a single line of code as chief programmer. Don't expect much

    • @purpasmart_4831
      @purpasmart_4831 Před 2 měsíci

      Ive applied at Intel several times, and my C code runs circles compared to this. It sad that I can't get a job but people like this get one.

  • @anon_y_mousse
    @anon_y_mousse Před rokem +74

    You know what I think happened? Someone probably wrote a shell script and some manager said "this looks unprofessional, use a real programming language", and they pushed the task of translating it into C onto an intern and that intern went for a direct translation with a few helper functions to fill in the gap instead of actually reading what it did and properly translating it. Although, the use of sudo is downright dangerous and perplexing as to why someone thought that was okay. Also, why do they have so many uses of cat instead of just calling grep or awk or the worst I see is to merely use cat and do_bash_cmd to read the first line in a file. My brain is breaking.

    • @magicmulder
      @magicmulder Před 5 měsíci +2

      But the guy named in the header is a CS PhD, assuming his credentials are legit.

    • @anon_y_mousse
      @anon_y_mousse Před 5 měsíci +21

      @@magicmulder This may shock you, but not everyone who attends a university actually learns. In my experience, most CS graduates couldn't code their way out of a paper bag, at least when they're fresh out of school. Engineers and mathematicians tend to be worse and often never improve. It largely depends on their initiative.

    • @MichaelFJ1969
      @MichaelFJ1969 Před 5 měsíci +1

      Looks like something done by Chat GPT ....

    • @emmanuelalfa4048
      @emmanuelalfa4048 Před 5 měsíci +4

      Say this was written by an intern, hypothetically speaking, there should have been some form of QA. Well, given the state of some of intel's products, I'm not surprised that this sneaked past QA

    • @skeloston111
      @skeloston111 Před 5 měsíci +1

      Not sure about that, this library is suppose to be an utility library so if they wrote a shell script to start with then they already failed the objective. What is likely that someone is is lazy or under pressure or doesn't know how to code for that task so instead they bring their shell knowledge into it.

  • @LouisDuran
    @LouisDuran Před 5 měsíci +14

    Like ... "If an electrician gets into coding" LOL! Rajat Khandelwal is rolling over in his severance.

  • @neoyagami
    @neoyagami Před 5 měsíci +25

    Im no c expert but these “greps” and “ls” with pipes scared the fk out of me

    • @Turalcar
      @Turalcar Před 5 měsíci +8

      It gets so much worse. Can you guess what switch_cmd_to_root() does?
      Spoiler: sudo bash -c "%s"
      Edit: Nvm, he spoils it in the later half of the video

  • @justin423
    @justin423 Před 5 měsíci +32

    the fact that this code was copyrighted is the "chef's kiss"....

  • @AndrewCodeDev
    @AndrewCodeDev Před rokem +77

    Can we also just appreciate how misleading their utilities are?
    So every time they run that switch_cmd_to_root function, they are calling malloc. However, the length of it is literally hard coded (MAX_LEN * sizeof(char)). There is no reason to do that - just take in a second pointer as the destination and then have the caller take control of whether or not they want to call malloc. You could easily get away with keeping all of this on static buffers but instead you have random malloc calls in the middle of functions that should ostensibly be about running commands.
    Amazing.

    • @davidjwp
      @davidjwp Před 5 měsíci

      Also the allocation isn't protected, which granted is not gonna be a problem for 99% of the times but it shows real lack of security

  • @scottxiong5844
    @scottxiong5844 Před rokem +50

    😂. The sudo got me. I feel that shaming is required in order to actually change people. I mean look at the people in the political system in the world lol.

    • @AK-vx4dy
      @AK-vx4dy Před rokem

      Why so picky? function does what he has in the name :D

    • @teknologist7914
      @teknologist7914 Před 5 měsíci +4

      This is shocking... and what's with the assumption that the system even has sudo installed & configured?

  • @moncyn1
    @moncyn1 Před 7 měsíci +106

    looks like legendary indian programmer code quality

    • @khuntasaurus88
      @khuntasaurus88 Před 6 měsíci +32

      I got hired as a senior python dev in a company which had recently bought an indian software company and my job was gonna be adapting their tool into our codebase. I quit after a month. Here are some reasons:
      - Dangling file pointers. Probably over 200 instances of open() without reliable or sometimes without ANY close()
      - 20k lines in a single file containing constants (half of which were duplicated and the other half unused)
      - Running arbitrary unsanitized eval()
      - Ignoring important exceptions with empty except: clauses
      - Infinite recursions galore with try catch Recursion depth exception catching!!!
      Never ever work with indian developers

    • @kennichdendenn
      @kennichdendenn Před 5 měsíci +10

      ​@@khuntasaurus88 sorry, but I have to disagree, or rather correct that statement: it only applies to cheap indian developement companies with excessive amounts of management pressure to work quicker. Which would be absolutely the same anywhere else in the world. I know people coming from and working in India that are excellent developers and whose code is of very high quality.
      But they have an advantage: management that is concerned about code quality and plans that into the schedule.
      Btw: The indian education system can be brutal - many people competing for limited study oportunities. Thats why they need to know and do stuff (especially in maths) to get *into* the better universtities other people in the west barely know and can do when they graduate...

    • @adityapss2683
      @adityapss2683 Před 5 měsíci +18

      @@khuntasaurus88 *Do not work with underpaid indian developers. If you treat india like low cost development center, this is what you get.

    • @gatogordo4131
      @gatogordo4131 Před 5 měsíci

      Indians are the worst programmers, is a fact, when I a see and Indian article I just close it.

    • @gatogordo4131
      @gatogordo4131 Před 5 měsíci +12

      @@adityapss2683Latin Americans programmers are also underpaid and are far superior than Indians in programming.

  • @connoro1373
    @connoro1373 Před 6 měsíci +46

    What is isane is that the developer has a PhD in C.S from a very reputable American university and an EE degree from IIT in India... you correctly guess that the person writing this has a EE background... but with a PhD in CS it really really makes you think...

    • @markuszhang1998
      @markuszhang1998 Před 5 měsíci +14

      PHD has nothing to do with code quality.

    • @magicmulder
      @magicmulder Před 5 měsíci +4

      @@markuszhang1998The Java code I was forced to write at university was hot garbage too. And I am a good developer. I was just totally out of my element in that language at the time.

    • @markuszhang1998
      @markuszhang1998 Před 5 měsíci

      I think what really surprised me is that there was no code review, or worse, garbage code review for the things OP pointed out. And this is Intel. This probably shows how broken the whole company, or even the industry is.@@magicmulder

    • @nicwhites
      @nicwhites Před 5 měsíci +10

      The higher the degree a lot of time the shittier the code. College students make shit code most the time as their projects are usually super small

    • @gatogordo4131
      @gatogordo4131 Před 5 měsíci

      That’s typical thing coming from Indians, PHD, thousand of degrees and still doing a crap job, anyone who has worked with Indians have seen that a lot.

  • @m4gicpi3
    @m4gicpi3 Před 5 měsíci +15

    This video pop on my homepage and the repository was archived few hours ago.

  • @10xSRK
    @10xSRK Před 5 měsíci +35

    A lot of people here are saying something like "they got an intern to do it". Even if that were the case, I think the bigger picture is that this shouldn't even pass a mild code review. Zero quality control.
    I mean, aren't they laying off people while paying billions in dividends? I'm guessing the people laid off may have prevented this.

    • @jongeduard
      @jongeduard Před 5 měsíci +5

      What we often see is that when it gets bad in a company, the good people leave first. And cheap lesser skilled people are employed instead. Or they try to do everything with a too small amount of people. The result is increased stress on everything, overall quality goes down and more mistakes are made, and even less work gets done in the end.

    • @fluchschule
      @fluchschule Před 5 měsíci +1

      In reality, if a reviewer writes more than "looks good", they will be hated by the other programmers (and next time someone else will be asked to do the review).

    • @vincei4252
      @vincei4252 Před 5 měsíci +1

      Every grassroots Intel project I've invested money in in the past few years has been canceled. Intel FPGA's that I paid for at the beginning of the pandemic were never delivered and my orders canceled. After buying up Altera and screwing up the company, I couldn't help but laugh receiving an email this week announcing that the whole thing was being spun off into a standalone company again. Intel is the disaster and gift that just keeps giving.

    • @alexisfrjp
      @alexisfrjp Před 5 měsíci

      the problem is that "interns" at intel hold actually senior positions, no kidding, if you knew...
      How many times I had to work with senior guys at Intel who weren't even technically at junior level...

    • @liquidsnake6879
      @liquidsnake6879 Před 4 měsíci

      The code reviewers are just as bad lol welcome to the corporate world, they're not hiring people who cost a lot of money, they're hiring juniors, paying them as juniors and treating them as seniors because it's cheaper

  • @specy_
    @specy_ Před 5 měsíci +45

    I'm mostly a frontend developer, when i look at public repositories of modules that i use, I'm often shocked by the code as it's almost never what i expected. I'm not sure if it's people writing bad code, people writing overly complex code for the task, or I'm just a bad developer.

    • @iusevimbtw
      @iusevimbtw Před 5 měsíci +10

      I have yet to see a JS library that is not overly complex

    • @sohigh7433
      @sohigh7433 Před 5 měsíci +3

      JS is pure garboleum. I suggest TS, it actually feels like a real programming language.

    • @zweitekonto9654
      @zweitekonto9654 Před 5 měsíci +3

      You are the first web developer I have ever seen who actually takes interest in how things are implemented.

    • @specy_
      @specy_ Před 5 měsíci +2

      @@zweitekonto9654 I'm not the only one, there are also some really cool and skilled frontend developers out there

    • @zweitekonto9654
      @zweitekonto9654 Před 5 měsíci

      @@specy_ people with these kinds of interest do not stay in web dev for long. unless it pays really well.

  • @LazerDon271
    @LazerDon271 Před 6 měsíci +13

    Clearly something is very wrong at Intel, this needs to be investigated further. How many other projects have this junk? I am not a serious developer, I only write hobby projects for myself and even I found this to be incredibly shoddy. Really incredible that this is being released for consumption by Intel.

    • @MoreReneRebe
      @MoreReneRebe  Před 6 měsíci +1

      probably mostly some interns project - other projects are not THAT bad, ..

  • @octain
    @octain Před 6 měsíci +25

    I love how passionate you are about code.

  • @danielsan901998
    @danielsan901998 Před rokem +16

    When i need to call a binary in c i usually use the fork+exec to at least avoid calling a shell with all the risks it involve. Calling a shell it's a crazy thing to do that i only expect from someone learning to program, i can't understand how someone can get a job with this technical knowledge.

  • @horsethi3f
    @horsethi3f Před 5 měsíci +18

    As an illiterate self thought coder myself, this was enlightening. Please do more code review videos.
    That sudo was hilarious. Someone was having fun or just didnt care so long as it passes those tests.

    • @Turalcar
      @Turalcar Před 5 měsíci

      That means they were running tests under a user that accepts sudo without a prompt which is frankly terrifying.

  • @brettlaw4346
    @brettlaw4346 Před 5 měsíci +7

    Backdoor or incompetence.

  • @ariromerog
    @ariromerog Před 5 měsíci +10

    I came here thinking, okay, this gentelman is going to laugh at things that I would do myself. I'm both sad and happy that it wasn't the case.

  • @squfucs
    @squfucs Před 5 měsíci +6

    rajat khandelwal they are roasting you in the comments bro

  • @reo101
    @reo101 Před 5 měsíci +8

    It was archived 2 hours ago, kek

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +2

      they deleted it now, so I forked it for you. Maybe I'll even fix the most ridiculous bugs sometime soon: github.com/rxrbln/thunderbolt-utils

  • @teknologist7914
    @teknologist7914 Před 5 měsíci +24

    You should use an enterprise IDE with tabs, dude ;) the UI will be so flashy you'll miss these bugs

    • @okie9025
      @okie9025 Před 5 měsíci +1

      just literally anything else other than a monochrome terminal editor will suffice lol

  • @haraldfielker4635
    @haraldfielker4635 Před 5 měsíci +4

    I posted this on linkedin and they finally put the repo in archive mode... THANKS!

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci

      👀 www.linkedin.com/feed/update/urn:li:activity:7167233894474358785/

    • @torcher5023
      @torcher5023 Před 4 měsíci

      such a nerd thing lol

  • @gggggg-gw7fw
    @gggggg-gw7fw Před 5 měsíci +3

    I love how something like this can make a human become that stressed xD

  • @ran2wild370
    @ran2wild370 Před rokem +9

    I like it :-) Why not to call bash from within hardware bound driver. Why not??!! Good idea. Comrades need to see what's on TB storage there overseas.

  • @troyb4533
    @troyb4533 Před 6 měsíci +26

    Your accent makes this rant all that much better.😂😂😂

  • @danielvelkov116
    @danielvelkov116 Před 5 měsíci +3

    Terry said the only question im programming is "is this code ni66erlishous or not". Here the answer is clearly YES

  • @tenminutetokyo2643
    @tenminutetokyo2643 Před 5 měsíci +7

    Highly skilled + talented

  • @nestorfernandez3859
    @nestorfernandez3859 Před 5 měsíci +3

    He is an electrical and electronics engineer, he do not have even a computer science degree. He had 3 months of experience as programmer when he entered in Intel. Now he is doing a PHD and says is a experienced developer. With like 3 years of experience he considers hinself a seasoned developer 😂

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +2

      Linkedin indicates working on Intel Thunderbolt "System Software" since Aug 2020. And 4 or so people at Intel worked on this utils according to the source code. The produced quality really should have been orders of magnitudes higher with all this educated experts in-house at Intel, ...

    • @nestorfernandez3859
      @nestorfernandez3859 Před 5 měsíci

      Yeah, that code is shitty as hell, no excuses, least for a company like Intel.

  • @fluchschule
    @fluchschule Před 5 měsíci +4

    I guess the author of this code is a hardware engineer. It's not their primary task, they have the habit to spend time on this stuff just until it seems to work. You can find a lot of code like this, it's far from unusual. I see the problem not with the author but with the company that they have zero interest in maintainable code.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +4

      This was announced by Intel as Linux thunderbolt utils. There is really no excuse for releasing core OS components like this.

  • @jesseb0rn51
    @jesseb0rn51 Před 5 měsíci +2

    Direct shell calls without the full path also open this up to being an „easy“ privilege escalation

  • @jonathane9403
    @jonathane9403 Před 2 měsíci +1

    Incompetence is the standard of our Western society in many fields, eg, finance, medicine, media, government etc. The only debate is whether this hefty layer of incompetence that has emerged has been put there by design?

  • @MrAmad3us
    @MrAmad3us Před 5 měsíci +2

    Dude uses C as a script wrapper for Bash 😎

  • @HyperMario64
    @HyperMario64 Před 6 měsíci +4

    A lot of proprietary code is much worse than that. None of that is too clever at all and the cute little flaws would be easy to fix. Worst production code I've seen yet is actually public. Most GNU code is complete garbage. Navigating this stuff feels like crossing a mine field.

  • @llothar68
    @llothar68 Před 6 měsíci +11

    I'm Anarcho Superman, i sudo everywhere, even on windows. i hate permissions and restrictions.

    • @magicmulder
      @magicmulder Před 5 měsíci +6

      Sudoman

    • @vincei4252
      @vincei4252 Před 5 měsíci

      Just login as root and run rm -rf every other command. not using sudo will save you precious time achieving your goals.

    • @llothar68
      @llothar68 Před 5 měsíci +1

      @@vincei4252 You scared chicken. Real man do backups and supermans like me are not even frightened by restores.

  • @magicmulder
    @magicmulder Před 5 měsíci +4

    We once licensed a well-known survey software and opted for running it on our servers instead of SaaS. The code was hot garbage (which I expected when I saw their database model way before that).

  • @DanielJoyce
    @DanielJoyce Před 5 měsíci +3

    I have slowly come to learn that i am not a bad developer. There are people better than me. But finally after two decades imposter syndrome has finally abated.

  • @2know2learn
    @2know2learn Před 5 měsíci +1

    Thank you for sharing. Hope to understand more in the future.

  • @AK-vx4dy
    @AK-vx4dy Před rokem +4

    You were so happy yesterday: (

  • @johanngambolputty5351
    @johanngambolputty5351 Před 5 měsíci +3

    Probably just a psi-op meant to break Rene.

  • @tristanstrahler
    @tristanstrahler Před 5 měsíci +2

    Oh god. This looks like the code produced by a branch of Intel India.

  • @DefaultUser3301
    @DefaultUser3301 Před 2 měsíci +1

    8:11 fast forward to see him going rampage if you are in a hurry

  • @rmoog1019
    @rmoog1019 Před 4 měsíci +1

    I just met a Python dev that copies files like this:
    process = subprocess.Popen(["cp", "-r", os.path.join(entry.src, file), entry.dst], preexec_fn=limit_memory)
    Overall I'm noticing that the restaurant industry, construction industry, and IT industry have fallen the same fate over the course of the pandemic - all 3 industries are loaded with bumbling codgers that shouldn't be here. People who write low level code only to invoke shell commands, people who don't connect live and neutral to the mains, people who serve expired food and try to boil and salt the foul taste out of it.
    Many such cases.

  • @OCShortsMan
    @OCShortsMan Před 5 měsíci +2

    I know nothing of code or developing outside of HTML. I know not what the good man speaks. But it’s relaxes me and sometimes I pick up like 1% of some information that makes sense. I don’t know what I’m doing here but I like it!

    • @VGMiaou
      @VGMiaou Před 5 měsíci +1

      If you can only do html you are pretty much wasting your time watching this friend.

  • @rmoog1019
    @rmoog1019 Před 6 měsíci +8

    >Rajat
    Many such cases

    • @xhivo97
      @xhivo97 Před 5 měsíci

      Racist undertones or am I going insane?

  • @kirilldanshin
    @kirilldanshin Před 5 měsíci +2

    The entire repo is gone, I got 404 and there’s no traces of this on intel’s github

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +2

      Guess that' speaks for the code quality

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +2

      here, I forked it for you. Maybe I'll even fix the most ridiculous bugs sometime soon: github.com/rxrbln/thunderbolt-utils

    • @kirilldanshin
      @kirilldanshin Před 5 měsíci +1

      thanks! I’ll check it out

  • @RakibFiha
    @RakibFiha Před 5 měsíci +3

    Did they remove the repo? Lol, cannot find it anymore.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +2

      Yes, apparently

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +2

      here, I forked it for you. Maybe I'll even fix the most ridiculous bugs sometime soon: github.com/rxrbln/thunderbolt-utils

  • @anishkelkar6434
    @anishkelkar6434 Před 2 měsíci +1

    A newbie system programmer here, has majorly done development in webservice and data engineering. Wanted to know what's the right practice then to call system calls in c? instead of not calling bash script inside a c script.

  • @CaptainDangeax
    @CaptainDangeax Před 5 měsíci +2

    Reminds me of a non working python installer. There was a code to identify x86 or x64 which was repeated 4 times, and of course, différences

  • @DBarks38
    @DBarks38 Před 5 měsíci +1

    I am electrical design engineer and I would never expected to see a program in C invoquing shell code in my career…
    Fortunately I was laying in my couch watching the video but I almost fell down…

  • @lanternenman
    @lanternenman Před 5 měsíci +1

    WOW, they archived the repository 2 days ago without comment. So they released it like this, fixed nothing and just abandoned it.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci

      I forked it for you. Maybe I'll even fix the most ridiculous bugs sometime soon: github.com/rxrbln/thunderbolt-utils

  • @nicwhites
    @nicwhites Před 5 měsíci +3

    I agree with all your irritation. That code is dog water, BUT you should build up your dev environment to not also be dog water. You shouldn’t be grep-ing for definitions with a project dir while LSPs exist

  • @AleksyGrabovski
    @AleksyGrabovski Před 5 měsíci +4

    I agree those particular usages of shell commands are bad, but calling external utilities from C program isn't bad per-se, I did it in prod code couple of times. If you don't spawn shell utilities you then have to parse text files in C which is *very* *very* difficult if you want to handle all edge cases. Another example is that alternative is to use very low-level API: you want to find default route from routing table you do `route -n | awk ...` and you have it, of course you can open a NETLINK socket and write a shit tone of code just to get it, but do you seriously believe it is better?

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +4

      Using a the appropriate library to parse things and netlink is always better than forking off parsing with Unix scripting. Slow, insecure. And especially don't thru everything thru Sudo!

    • @AleksyGrabovski
      @AleksyGrabovski Před 5 měsíci +5

      @@MoreReneRebe I mostly agree with your position. Building from `./lib` - amateurish, using sudo without user knowledge - very bad. Using shell is slow - maybe, unreadable - yes if abused as you have shown in your video. But I don't buy your argument that popen is somehow inherently insecure. You need to prove this. My example with netlink actually improves security of an application as a whole, because netlink requires root permission or CAP_NET_RAW and CAP_NET_ADMIN capabilities set on your executable file. Then please tell me how writing custom netlink code is more secure then using popen and parsing output of `route` or `iptables`? My position is that code that you've shown is bad, but if you are an experienced programmer and you know what your are doing then popen is the good choice.

    • @AleksyGrabovski
      @AleksyGrabovski Před 5 měsíci

      I just did google search and ImageMagick uses popen in their code, do you consider ImageMagic developers bad?

    • @xcoder1122
      @xcoder1122 Před 5 měsíci

      @@MoreReneRebeThe whole idea of UNIX is it to combine multiple binaries to achieve your goal. The whole philosophy of UNIX is that every binary only does exactly one thing and does this one thing very well.

  • @kevinfortier556
    @kevinfortier556 Před 5 měsíci +2

    Scripting in C is freaking hilarious 🤣
    Watching someone shit on code is very enjoyable. I would like you to review my code

  • @Ulterior1980
    @Ulterior1980 Před 3 měsíci +1

    I agree that approach is exotic to say least, and I see some rookie mistakes like incorrect use of sizeof for string operations too

  • @vxcute0
    @vxcute0 Před 4 měsíci +1

    this is crazy, i am 2nd year college student and I will definitely not write code like this !

  • @enitalp
    @enitalp Před 5 měsíci +1

    No offense, I'm a game dev with 30+ years of experience here, and I see the same thing every time I read low-level C code for MCUs RTOs or drivers code.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci

      No. Low level code in this area if usually not that crappy. I do this provisionally for 25y.i know what I'm talking about. If you see similar buggy code that's of course also not how it should be.

  • @afmikasenpai
    @afmikasenpai Před 5 měsíci +1

    8:00 I felt that.

  • @KevinInPhoenix
    @KevinInPhoenix Před 5 měsíci +3

    What do you expect when you offshore your coding to the third world to save on programmer salaries? The bean counters at Intel don't care what the code looks like as long as it is cheap. Good, fast, cheap: pick any two.

  • @replikvltyoutube3727
    @replikvltyoutube3727 Před rokem +6

    I think it could be faster (and safer) to do in POSIX shell also using gnu parallel for things that can be parallelized etc

    • @MoreReneRebe
      @MoreReneRebe  Před rokem +4

      We could add a parallel shell syscall into the kernel execute User code in there for even greater sysfs parsing performance!

    • @replikvltyoutube3727
      @replikvltyoutube3727 Před rokem +1

      @@MoreReneRebe yeah or do that I guess

    • @MoreReneRebe
      @MoreReneRebe  Před rokem

      🫶 we could port all top and perf tools to such a new system call for MASSIVE performance uplift! 🤔

  • @3ombieautopilot
    @3ombieautopilot Před 5 měsíci +2

    How often do you spot that kind of code? I don't know C, watching a real professional like you criticising code is very fun! :)

  • @mikeinal5521
    @mikeinal5521 Před 5 měsíci +2

    I guess this may be a reason for all the effort put in to nuetering their Managment Engine.

  • @SimoneRondelli1990
    @SimoneRondelli1990 Před 6 měsíci +2

    If i had a nickel for every time i had a similar rant... 😁 I loved this!

  • @hansmuster5291
    @hansmuster5291 Před 5 měsíci +2

    this is next level comedy 🍿

  • @hexarith
    @hexarith Před 5 měsíci +1

    It's not just thunderbolt-utils. In my experience, most code that's released directly from Intel to open source is riddled with issues like that. Have a look at the earliest releases of the whole BlueZ stack (that whole mess should be burnt to the ground, IMHO). Or have a look at the earliest releases of tpm2-tss.
    Personally, to me, all source code that has Intel as original provenance has a strong smell and I approach it with extreme suspicion.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +1

      a strong smell of outsourcing to the cheapest developers w/o experience or dedication? :-/

  • @nicholasfacciola6626
    @nicholasfacciola6626 Před 5 měsíci +1

    Intel employee here. Public repositories such as this are not under near the same scrutiny as the ones that are secured. Some public repositories may not even be subject to code review

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +1

      Appreciate your comment. I of course know some other folks there. The comments were about this particular gem.

  • @davidlakes5087
    @davidlakes5087 Před 5 měsíci +2

    With the utmost appreciation, this video would have been much more helpful if you would have discussed WHY each of these transgressions was undesirable instead of simply repeating that they had no QA and that this wasn’t the right way to do it.

  • @TheSmkngun
    @TheSmkngun Před 5 měsíci +1

    This was hilarious to watch and embarrassing at the same time.

  • @hacker-7214
    @hacker-7214 Před 5 měsíci +2

    how about u actually coherently explain whats wrong with the code instead of just getting mad every 2 seconds.

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci

      I actually dd just that ¯\_(ツ)_/¯

  • @cold_ultra
    @cold_ultra Před 5 měsíci +2

    Maybe i should send my CV to intel

  • @itscoronatime8836
    @itscoronatime8836 Před 5 měsíci +1

    As someone who doesn't code I feel like this might've been contributing to my horrible experience trying to use a external GPU on linux.

  • @justanaveragebalkan
    @justanaveragebalkan Před 5 měsíci +1

    That amateur hour, i wont name the company, because it's not small.
    It had 95 levels of switch statements, they said it's fine, it's like a horizontal funnel.

  • @Luna0wl
    @Luna0wl Před 5 měsíci +6

    As a hobbyist my code sucks, but I played enough CTF's to know this seems exploitable xD

  • @jongeduard
    @jongeduard Před 5 měsíci +1

    I feel the problem is those hardware guys are hardware guys. They should just higher proper software devs in the organization and work together. And put the right people onto the right job.
    What we see in code is all just the reflection of management problems in a company. That's what I believe.
    Well managed companies engineer well working stuff.

  • @Ghostleft
    @Ghostleft Před 5 měsíci +1

    Oh my !!😂
    I’m a Linux admin and I couldn’t stand that “quality” code 😬

  • @minciNashu
    @minciNashu Před 5 měsíci +2

    Oh yeah? But can you invert a binary tree?

  • @arthurbesnard1536
    @arthurbesnard1536 Před 5 měsíci +1

    This is why companies does not want to go opensource. Because their code sucks. Honestly I'm not a programmer, I would have still done a better job...
    It is probably a move from intel to discredit opensource...

  • @noxagonal
    @noxagonal Před 5 měsíci +1

    I was making a cross platform library, I'm primarily using Windows, but I wanted to make it work on Linux as well... Lets just say that the first commits were not my finest. Still, I think I got a hang of it after around a couple of weeks or so. XD

  • @bear458ziif-s
    @bear458ziif-s Před 5 měsíci +1

    i'm more concerned that you're using a light theme

  • @no-ld3hz
    @no-ld3hz Před 5 měsíci +1

    I was about to be like "Can't get any worse than the code I've had to write for low level stuff, which has mainly been polling UART data due to no interrupts"
    Then I see that snprintf statement and begin to cry 😭😭😭

    • @studogYT
      @studogYT Před 5 měsíci

      What hardware had UARTs but not interrupts?

  • @heraldo623
    @heraldo623 Před 5 měsíci +1

    Lots of places for Shell injection (and with sudo!) LOOL

  • @R00M4D
    @R00M4D Před 5 měsíci +1

    I found their linked in. They were an electrical engineering major and this their first job out of college. Take it easy on the poor chap 😅 We’ve all been beginners at some point

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci +3

      if you watched the video carefully I primarily blamed Intel and did not even mention their name. This should have been peer reviewed by some senior lead before prominent release by Intel. They also where a team of at least three according to the sources so it makes already at least a group of three or four.

  • @jonathandero848
    @jonathandero848 Před 6 měsíci +3

    Hahaha, shell in C-clothing!

  • @michelians1148
    @michelians1148 Před 5 měsíci +3

    Do not redeem it! Do not redeem the card!

    • @ketansrivastav
      @ketansrivastav Před 5 měsíci

      racism, how novel.

    • @michelians1148
      @michelians1148 Před 5 měsíci +3

      @@ketansrivastav Are you listening to me? AREYOULISTENINGTOME?! 🤬💢

  • @81lcf
    @81lcf Před 4 měsíci +1

    The funny things is you can ship such crap code, but you can't fail inverting a binary tree in 30 minutes of live coding during hiring process.

  • @asdfghjkl1755
    @asdfghjkl1755 Před 5 měsíci +2

    It is using snprintf, so it is secure.

  • @overclucker
    @overclucker Před 5 měsíci +1

    It was a bash script and they were told to rewrite it in c.

  • @thyzor
    @thyzor Před 5 měsíci +3

    This makes me feel good about my amateure programming skills, most of these issues even i were aware of, and ive only been doing this for like 8 months.

    • @y6lp8WepaHxpG
      @y6lp8WepaHxpG Před 5 měsíci

      You are not good

    • @thyzor
      @thyzor Před 5 měsíci

      @@y6lp8WepaHxpG never implied i were, altough you might be the worst troll ive seen on the internet, its like you didnt even try 😔

  • @Ghostleft
    @Ghostleft Před 5 měsíci +2

    The “jugad” 😂

  • @ciesinsk
    @ciesinsk Před 5 měsíci +1

    Hillarious. I even like that this video could be compressed to 2min of real content (and stuff).

    • @MoreReneRebe
      @MoreReneRebe  Před 5 měsíci

      Of course do it better and share your work. 😘

    • @ciesinsk
      @ciesinsk Před 5 měsíci +1

      Your forgot "and stuff". @@MoreReneRebe

  • @semihmasat
    @semihmasat Před 5 měsíci +1

    I can feel how angry he is. I would love be on that room when he recorded this 😂