And that is correct :) But my program just stops, halfway through. In my ubuntu i just get this STOPPED error: [1]+ Stopped
If I comment out the ptrace bit, my program is running just fine.
Is this somehing ptrace would do?
It is not very complicated. Just some simple if file exists, if some strings in file == WORD. Then run a shell command, and another.
With the ptrace code in place just the first shell command is executed, and the Stopped error comes after it completes.
I can comment out the second shell command, and I still get the Stopped error.
I have tried with several ways to run shell commands but both give me the same result.
Any ideas? Push me in the right direction.
(I have tried to build and run on both ubuntu and Red Hat, v5 and 6, same results).
I can "strip" down the code to somehing like this. And comment "in/out" the ptrace() check.
With ptrace, I get an Stopped error. Without it, its all good.
I have my reasons for using sshpass and password in cleartext in code. This code is just for testing.
My "other" project uses char arrays for all strings, and simple "hide/unhide" in runtime. So you can not "strings" the file for text. The password is fetched from a file, which is encrypted. And decrypted at runtime, which is visible with the strace command. I just want to stop that.
This is not for an big important project, just some simple stuff that we want to secure a bit more, thats all.