Answer:
while(is_sunny=="n")
Explanation:
The loop keeps repeating itself until a certain condition is met.
Here while loop keeps executing until value of is_sunny is not equal to 'n'
When the value of is_sunny is not equal to n then the loop stops.
So lets explain this logic with a chunk of code:
#include <iostream> //to use input output functions
using namespace std; //to identify objects like cin cout
int main() { //start of main function
string is_sunny = "n"; //value of is_sunny is set to n
cout<<"Enter value of is_sunny: "; // prompts user to enter value of is_sunny
cin>>is_sunny; // reads value of is_sunny from user
while(is_sunny=="n") // keeps iterating until value of is_sunny is not equal to n
{ cout<<"keep executing until is_sunny is not equal to n"<<endl;//display this message with each iteration
cout<<"Enter value of is_sunny: "; //keeps prompting to enter is_sunny
cin>>is_sunny; } } //keeps reading value of is_sunny from user
Now if the user keeps entering "n" as value of is_sunny then the loop keeps repeating. When the user enters any string other than n then the loop breaks. The output of the program is attached.
Answer:
Answer explained below
Explanation:
Yes, you can let Set-uid program that is owned by root to run your code instead of /bin/ls but it has it's own drawbacks and is actually not safe.
As you can not rely on that since some of the shells if different from the ruid drop an euid which is actually not safe.
execl("/bin/ls", "ls",(char *)0);
run this under your main program.
Since it can have a root previlege,
-$ cd /tmp/
/tmp$ sudo su
:/tmp# gcc -o system system.c
:/tmp# chmod u+s system // changing file permissions
:/tmp# exit
exit
:/tmp$ cp /bin/sh /tmp/ls
:/tmp$ ./system
<u>Steps:
</u>
1. The first thing you need to do is copy /bin/sh to /tmp.
2. After copying /bin/sh to /tmp set a new name ls but make sure your sh ->.zsh.
3. Set PATH to current directory. /tmp.
4. Compile
5. Run the program system and you can get your root previledge.
Now, with the above exmaple if you change /bin/sh soo that it points back to /bin/bash and repeat all the previous steps, you will not be able to get your root previledges.
The answer is "networks allow computer to connect quickly and to share data or equipment". This is true because with a commuter network you can instantly share files to all the other computer by putting them of the network file storage center. This also allows multiple pieces of equipment to be used to complete one task that would usually take longer if a single computer did it
Answer:
The answer to this question is given below in the explanation section. However, the correct answer is: student should practice netiquette in an online course when they are participating in online discussion board.
Explanation:
It is important for you as a student to recognize that the online classroom is in fact a classroom, and certain behaviors are expected when you communicate with both your peers and your instructors. These guidelines for online behavior and interaction are known as “netiquette”.
So, the correct option of this question is: students should practice netiquette in an online course when they are participating in an online discussion board. Because the discussion board is opened by the instructor/tutor, he constantly looking for student behavior throughout the discussion. so, students should use netiquette practice during the discussion in the online class.
However, other options are not correct because, in these options, there is not the presence of teacher/instructor. And, also noted that netiquette is practiced in online class by the student.