Naman
Drop a malicious library somewhere in ~ and throw LD_PRELOAD into .bashrc
The only way to do that is some extrnal source, obviously. And it can be done without sudo , I agree. But I really don't think that you can inject anything into .bashrc without root permissions.
Naman
You can write to .bashrc from within a flatpak sandbox running as non root
You have to give flatpack root permissions before it can do something to .bashrc
Naman
Btw, who said that flatpack have all the good packages? Flatpack have a lot of bugs, not because its flatpack devs fault, but because it is done, most probably intentionally, by some users cum developers, who know the flaws and exploit them. Everybody can make their own software and post it to flatpack.
Naman
And there is nobody to verify the softwares.
Naman
Yes, it is the group for the discussion. It is necessary to discuss it here because it is connected to the people here. Devs should be aware of operating systems clearly and myths need to be busted, imo. Nobody should have myths in mind regarding os, imo
Naman
Sorry, I forgot to introduce myself 😅 I am developer, or more precisely a web developer at a Linux distro. Somebody here invited me to the discussion and asked me to present my views on the topic.
Mдtt
Windows checks if the malicious process actually has write access to the file and rejects any attempt to make links if the process doesn't have access
It checks the permission that's true, however is not so difficult to trick the system and gain write access to a file by links https://github.com/padovah4ck/CVE-2020-0683 https://offsec.almond.consulting/intro-to-file-operation-abuse-on-Windows.html https://nixhacker.com/understanding-and-exploiting-symbolic-link-in-windows/
Anonymous
I want to learn C/C++ can anyone help me please
Anonymous
Thanks
as
how can I install gcc-4.9 on linux
Anonymous
Depends on the distro
Anonymous
Why do you need an old compiler version? You can use a newer version and targeting a previous version of the programming language.
Anonymous
Thanks
Grace Lee
/get
Grace Lee
sorry i typr wrongly
Henry
/get
Anonymous
/get
striker
/get
Gulshan
/get
/get cbook
Harry
## Rules #pinned * You are not entitled to an answer, getting angry about not answered questions will get you warned. * Not checking your problem in google (or any other search engine) first will get you a warn. * Asking to solve an assignment/test/whatever without trying it first yourself will get you a warn or will get you BANNED. We won’t write a code for you, but we can push you forward and suggest something. * Before posting a long code snippet think twice and read the Resources section below. * No “best book” or “best youtube channel” requests, use /get cbook and /get cppbookguide chat commands. * No “best ide” requests, use /get ide chat command to see the suggestions. * Asking for something that is in the pinned message right after joining WILL GET YOU BANNED. * C/C++ discussion preffered (assembly also allowed), asking about other languages (or groups for other languages) right after joining will get you BANNED. * Reverse enginnering, hacking and related topics are allowed, but asking to hack facebook, instagram, etc. is NOT allowed. Also if you ask "how to become a hacker" and obviously have zero knowledge on anything related to that you may get warned or banned. * Legitimate requests for help on code and programming questions are welcome. A request is considered legitimate if it describes your problem, what you've done so far and what went wrong. Requests such as "write my program" or "do my homework" are never considered legitimate. Asking not legitimate questions will result in a warn or ban. See https://stackoverflow.com/help/mcve on how to write good questions. * Asking for book recommendations is ok, but "pls give pdf book" is not allowed, find books by yourself. Posting illegally copied books (or links to those books) is also not allowed and will get you BANNED. * Only English language is allowed, if you speak shitty English or don't understand anything in English YOU WILL BE BANNED. * A little bit of programming related memes, jokes, shitposting are allowed. * NSFW content (porn, nudity, etc.) is not allowed. * Spamming/advertising (job posts are also ads, so ask an admin before posting) will grant you a warning or an immediate ban if you do it right after joining. * Religion, politics and ideological topics are forbidden. * Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed. * If you encounter a problem, while using dev C++ or turbo C/C++, you will not be helped, use another more modern IDE. * Don't post compiled executables, that is obviously a security risk. * Personal messages without asking beforehand are not allowed. * If you want to post a link or some article in this chat you will need an admin approval first ## Resources C/C++ group India: http://t.me/c_cpp_india About asking good questions: * [English](http://www.catb.org/esr/faqs/smart-questions.html) * [Translations](http://www.catb.org/esr/faqs/smart-questions.html#translations) For posting long code snippets: * [GitHub Gist](https://gist.github.com) * [Ubuntu Paste](https://paste.ubuntu.com/) * [Pastebin](https://pastebin.com) ## Reports If you notice any forbidden content, please use the /report command while responding to the offending post to report it to the admins.
Thanks for providing C/C++ India group link. It would be better if you provide Java and other languages link too.
Anonymous
hi guys I'm working on a project for my university its need register account. i design a table for that.but my teacher told me its should be standard.what table and field need for standard registration?
ברני
Hey, c begginer, Can someone explain me why the function calling dosnt work? What do I need to do to call the function right? https://onlinegdb.com/BkwjeuHtP
ברני
*I didn't put a function call Cuz every try I did didn't work,
ss..
/get
Anonymous
blah blah blah blah blah enough arguments made?
Manav
C++ or batter say c+class And class can be set as a table
Calling C++ C with classes is not correct. It may have been true back in the day but that is a few decade old thing
Ammar
Hey, c begginer, Can someone explain me why the function calling dosnt work? What do I need to do to call the function right? https://onlinegdb.com/BkwjeuHtP
This one does not make sense. int arr[SIZE]; ... ... for (int i = 0; i < arr; i++) This part i < arr, you compare an integer with memory address of the array.
Ammar
Good compiler should warn you like this: warning: comparison between pointer and integer
Zel
That example you are literally answering a request for a number with directions on where to find a data set.
Ammar
Not possible
It is basically possible to compare an integer with a pointer. They even provide uintptr_t and intptr_t which are data types that always fit for pointer size in any environment. But still, in the above case does not seem to be correct.
ברני
This one does not make sense. int arr[SIZE]; ... ... for (int i = 0; i < arr; i++) This part i < arr, you compare an integer with memory address of the array.
I didnt had a chance yet to check the function mistakes because Im straggling to find how to call it on the main.. Can you first explain me how to call the function? That was my question.
Ammar
Calling a function in C is just like this. function_name(arg1, arg2, arg3); It is the same as you call scanf, printf, and something like that. They are all functions too. Simple example: int add(int a, int b) { return a + b; } int at the beginning of the function definition is the return type. add is the function name. int a is the first argument. int b is the second argument. Call function example: int x = 10; int y = 30; int result = add(x, y); printf("%d", result); // output 40
labyrinth
labyrinth
why deleting line 17 incurs undefined behavior?
labyrinth
there is no RW operation in the child process
labyrinth
there are only 6 lines in the .txt file, but without closing fptr in the child process, it could fork up to thousands of child process
Ammar
there are only 6 lines in the .txt file, but without closing fptr in the child process, it could fork up to thousands of child process
Interesting, AFAIK fork() will duplicate the file descriptors and they will be independent. Even if there is read/write operation in the child processes, that should not be a problem, except for race condition read/write problem. Not really sure about your case. I am curious what is the content of line_buffer when it executes thousand of calls to fork(), that must be thousand of iterations in the parent process too, since the child will exit before it reaches the loop branch.
Ammar
Could you send the simple working code as text? I would like to copy/paste on my machine and try.
labyrinth
YES
labyrinth
for printing i guess it is gonna be repetition
labyrinth
c #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <unistd.h> int main (){ pid_t procid; int cnt = 0, // fork counter n_read; FILE *fptr = NULL; fptr = fopen("tmpfile.txt", "r"); char line_buffer[100]; while( (n_read = fscanf( fptr, "%s", line_buffer)) != EOF){ procid = fork(); if(procid == 0){ fclose( fptr ); // undefined behavior after removing this line exit(0); } cnt ++; } printf("%d forked\n", cnt); return 0; }
V01D
Cuz that may get you a warn
labyrinth
if i were to use repl.it, shall i invite or post? havent used it before
V01D
Depends on the admin and his or her mood. I dont care, I'm just warning him.
Ammar
@fattysheep I can't reproduce the problem on my machine. Both result in the same behavior.
Ammar
Roxifλsz 🇱🇹
You ran the same executable both times
labyrinth
labyrinth
this is what i got
Ammar
Let me retry
labyrinth
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 this is what i use
Ammar
Still the same here.
Ammar
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 this is what i use
What is the content of tmpfiles.txt on your machine? I suspect it is a buffer overflow that overwrite the other variables so it shows wrong value. Not really sure though about the fclose.
labyrinth
i dont think that matters, i changed the content and it behaves the same; each line has only 8 chars or so
labyrinth
to my knowledge, it should be independent after fork, FILE* or fd, but it seems that it behaves as expected on your machine
Ammar
to my knowledge, it should be independent after fork, FILE* or fd, but it seems that it behaves as expected on your machine
The answer in this thread says so too https://unix.stackexchange.com/questions/91058/file-descriptor-and-fork
Ammar
But yeah, forgetting fclose itself is a bad behavior. Also it leads to memory leaks. Valgrind detects it.
labyrinth
this is mentioned in APUE and UNP, after forking, there is a reference counter to the file, closing it will cause the counter to -1 and the file truely closes once it goes down to 0
labyrinth
yes, true; but on my machine, calling _Exit will result in expected output and _Exit does not do the cleaning process 😅😅
Ammar
Maybe, the only proper way to investigate it is put debug flag (gcc -g) on compiled binary on your machine and run the program step by step under the GDB.
Ammar
But does that really matter in this case? I can't think of that.
labyrinth
Neither do I. Thanks anyway; I did not find it easy to learn gdb but given the situation i think i should get my hands dirty asap
Henry
What are the most powerful aspect of c
ברני
Hey again, I finally did the function call Thanx to Ammar, but now I have a new problem with the calculation in the funcrion.. I'm trying to compare numbers to numbers that are in the arry, but I'm missing Somthing..can someone help me to figure it out please with explanation 🙏