Skip to content
Advertisement

Tag: unix

bash does not get root permissions with setuid program

I have the following home-grown implementation of su: To allow for proper execution, the permissions and ownership information are set accordingly: When I invoke a shell, such as /bin/sh, I am able to modify root-owned files and directories: However, /bin/bash doesn’t seem to get root permissions: Answer Shells reset the euid to the uid for security reasons. So if you

Piping To Grep Is Giving Too Many Results

I’m trying to check whether a particular service is running via a Linux terminal, and the following command doesn’t seem to be filtering the results as expected. Not sure what I’m doing wrong… This produces several lines of output, including, for example, I’m not sure why this is happening, since the string “subversion” is not contained within the above line…

Login script using Python and SQLite

I’m trying to create a login script using SQLite to store the user data. Any ideas on how to to that? I have research over hours and found nothing of the kind. I would appreciate any help! 🙂 This is what I got so far: But it always returns Login failed… I want to check the input “user” and the

Date manipulation in awk variable : Non Military Format

In the mentioned code : | awk ‘{ print $1, $2 }’ AWK $2 is having “Thu Nov 19 17:00:00 2015” in it. I want to manipulate this date String there only in inline awk in Non Military format “Thu Nov 19 05:00:00 PM 2015”. Please help. Answer This line should give you the expected format: Here you go:

How to find whether a given address is in heap or in stack

I have a requirement to find whether a given address is in heap or in stack. Is there a reliable way to do this in Linux? I have thought about the following approach assuming that the stack will grow downward and heap will grow up towards stack. How reliable is this solution? We don’t use gcc split-stack. [edit – I

CUPS printing remote(http://) files from command line

I am trying to create a custom script to control my CANON SELPHY PRINTER form the command-line. lp -d Canon_CP900 -o media=”CP_C_size” /Users/sangyookim/Desktop/selphy.jpg I have the tested the above code and it’s working perfectly as I intend it to. But I have stumbled upon a problem. When I replace the /Users/sangyookim/Desktop/selphy.jpg or filname to a web link such as the

Running a script in terminal using Linux

Im trying to run this script in the terminal but its not working and says permission denied. scriptEmail is filename. scriptEmail is written as follows: My read write permission Answer As for permissions: Check that your shebang is at the very top of your file, and that it starts exactly with #!; # ! will not work. Check that your

linux cmp utility output: what is a “line”?

Could someone tell me what the “line” number represents in the output of a cmp command? I ask this because, first, I can’t find it explained anywhere. Second, I am getting results comparing a set of files where the “char” outputs are identical (as expected) but the “line” outputs differ wildly. Answer The “line” outputs reflect the number of newline

Advertisement