1) I have a binary which i launch from command line. It executes fine.
2) But when I launch it from another file using execve command, it gives a message that it is not able to access a shared object ".so" in /usr/bin (message is "Permission denied").
I searched on internet on this topic and found out that it has something to do with setgid / setuid..
I am correct in this.. Can someone help me recreate this scenario with a simple example..
I am trying launch a binary using execve command. The binary that I launch uses the jansson library to parse.
In such a case, I am getting a permission denied error to load the lib jansson.so.4. (I had pasted the lib jansson.so.4.4.0 and created a soft link to lib jansson.so.4).
The binary runs fine if run separately through command line both as root and normal user.
I tried to keep the jansson libraries in the home folder and try to load it with ld_library_path and ld_preload variables.
Ld preload fails to load and says it ignored it.
Ld library path checks the path given but doesn't pick it from there and keeps checking in other defaults library paths.
Why do you refuse to tell us what OS you're using?
Why do you refuse to show us the exact text of the diagnostic messages that are printed when things fail?
We are trying to help, but refusing to give us this basic information needed to diagnose your problem only makes it hard for us to give you any useful information.
Show us the output from the commands:
If you think setUID or setGID is an issue, we need to know how the permissions are set on the binary you're trying to exec and we need to know how your UIDs and GIDs are set when you try to run this command from the command line and from the binary whose execve() is failing.
I know that many systems use an LD_LIBRARY_PATH environment variable to set up a list of directories where shared object libraries can be found. I know that when you're running setUJID or setGID programs, that variable is usually ignored to prevent malicious users from overriding system security precautions.
I am not aware of any system that uses ld_library_path and ld_preload variables. If a system does use these variables, it is violating namespace restrictions reserved for use by applications by the standards. (Case distinctions are crucial in environment variable names!)
I guess it is possible, but I have also never seen a system that places shared libraries in /usr/bin; they are usually somewhere under /usr/lib and/or /lib.
Hello,
I was trying a perl-cgi tutorial and saving the data from online form to a file named (guests.txt). I am using the localhost port 80 for practice.
My page file "guestbook.html" is working as I saw the online form. After filled out the blanks and submit, I was expecting to see the result... (3 Replies)
Disclaimer: This is just a rainy day experiment. There is no expected "goal" other than to understand UNIX better.
After reading about fork and exec, my understanding is that forking, as the UNIX shell does by design, consequentially may sacrafice some speed versus an approach that runs in... (1 Reply)
Hi,
I'm writing a monitor program that can be notified once a process makes an execve system call and then stop that process for examining before it starts to run the new code. I know I can ptrace a process to achieve this, but I do not want to ptrace every process in the system. Is it possible?... (1 Reply)
Hi everyone , after a pipe() system call i've forked and entred into the child process to execve a shell script .the problem here is that when the execve sys call fail , i want to send the error code (eg errno) to the parent process using the pipe writer side p , there is nothing received in the... (4 Replies)
I am writing a VERY simple script that copies my catalina log file to a new filename then copies /dev/null inotthe catalina.out. Since the log is the live log, it is open and written to as I copy. I can do the 2 copy commands from a command promp with no problem, it works. I have the probmel in... (2 Replies)
I tried using the following code to execute a program but it doesnt seems to be working .. I would like to know whats wrong wit it .
execve("/bin/cat", "words", NULL); (0 Replies)
When I do a 'cd /appl' and issue 'ls -al' command, I get the following error for .. directory.
./..: Permission denied
But still I get a listing of other directories under /appl.
Also, if I give 'man' for any command under this /appl folder, I get the following error:
... (3 Replies)
I am very new to Unix. We have a script that will remove files from a directory. The account removing the files has the same permissions as the directory the files are located. We have logged in as the account and deleted the files from that directory but when we run the script with the account... (7 Replies)