Programming Leftovers
-
Ken Thompson Really Did Launch His "Trusting Trust" Trojan Attack in Real Life
In 2021, I’ve rediscovered the full Usenet message after a search effort in multiple Usenet archives. My success was partial - it was still a repost by someone else, and I was unable to find the original message. However, this repost contains the full Usenet message, including complete headers and message body, with the poster name and its Message-ID, establishing the authenticity of the post beyond reasonable doubts.
Historians with a higher standard of proof may contact the poster in person, and the confirmation would be trivial. The poster of this message was Jay R. Ashworth, apparently well-involved in tech and was the author of RFC 2100.
In conclusion, Ken Thompson’s “Trusting Trust” compiler Trojan attack is not just a thought experiment. In fact, it was actually what he really did in real life. In a 1995 mail, he said he was able to successfully compromise the Unix Support Group at Bell Labs (precursor to Unix System Laboratories).
-
Unicode in C
Unicode is a set of non-English characters which can be characters from a different language like Arabic, Hebrew, etc, or can be special characters like emojis and smiley faces. Character encoding went for a toss when different people from different regions of the world started encoding in their local languages. Because of that, the whole process of communication by the means of computers got affected. So, to handle this problem, the Unicode consortium came into the picture which was a group of different people from different regions and different companies whose main task was to encode all the characters that exist in the world in such a way that there remain no disputes.
Unicode started with a fixed two-byte character set but later on, it was changed. Unicode consists of more than a hundred thousand characters and over a hundred languages to handle the vast multitude of different languages including complex characters like emojis, modifiers, and other unknown characters.
If we try to print a special character like an emoji in C language, the compiler will not give the result of printing that emoji. Rather, it returns a code for that emoji which will not be helpful for the user. To resolve this matter, we will practice the Unicode process in C.
-
Fgets() Function in C
The title of this article little clears out the purpose of using the fgets function in C. The fgets() function in C is mainly designed to get the data input from a user or an input stream like file and display it within the output console. To get the input from a user to display on the console, we must have some buffer memory or array in which we can store that input. Using this function, we can restrict the number of characters to be displayed from an input stream and avoid displaying the excess data and display only the needed ones. This guide covers some C examples to explain the use of the fgets() function in detail.
The system update is a must before performing any sort of coding on it as it caters to all the memory-related issues and makes your system feature full. Thus, the “update” keyword with the “apt” utility and “sudo” privilege is a must. After adding this query to your Linux shell, it would require the passcode of a currently logged-in user.
-
Limine nested menu
I posted a couple of days ago, adding a "Fix broken video" menu entry to Limine boot-loader
-
POSIX Semaphores in C
“Although every programming language has many libraries for specific purposes, the POSIX library of C has its place. It has been designed to create a great harmonization among the processes and helps a lot in using multithreading within the programs, i.e., creating multiple threads and synchronizing their execution. Within this guide today, you will see a simple illustration of using POSIX semaphores in C. For the basic C code examples, we must configure its compiler in the system. But, before that, we need to update the system as it’s a must needed step for the smooth execution of code. Thus, the query displayed in the attached snap is a must-have to update and upgrade your Linux operating system with the “apt” utility.”
-
gfldex: Rabbitholeing
With PWC 182-2 specifically asking for Linux paths to be handled, we need to resolve issues like /../ and symbolic links. Since I didn’t feel like putting a directory called a into my root folder, I wrote a little helper that deals with some of the tripwires that modern filesystems provide.