Permission error while using execve..


 
Thread Tools Search this Thread
Top Forums Programming Permission error while using execve..
# 1  
Old 08-15-2014
Permission error while using execve..

Hi,

I have the following scenario..

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..
# 2  
Old 08-15-2014
What's your OS?
# 3  
Old 08-15-2014
Please show us exactly what you're doing, and exactly what error you're getting. Otherwise, we are only guessing...
# 4  
Old 08-17-2014
Hi,

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.

Can any one help me with this ..

Thanks,
Sathish
# 5  
Old 08-17-2014
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:
Code:
ls -l /path/to/binary/you/are/trying/to/exec
ls -l /path/to/binary/that/is/using/execve/to/invoke/above/binary
id

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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Webserver permission denied error

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)
Discussion started by: yifangt
3 Replies

2. UNIX for Dummies Questions & Answers

Conserving processes: execve() vs fork()

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)
Discussion started by: uiop44
1 Replies

3. Programming

execve notification in user mode under Linux

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)
Discussion started by: aaron.lwe
1 Replies

4. UNIX for Dummies Questions & Answers

Permission error

for FNAME in `find /unixsxxx/interface/2.0/xxxxxxx -type f \( -name '*.KSH' -o -name '*.sh' -o -name '*.sql' -o -name '*.ksh' \) -exec grep -il xxx.xxx.xxx.xxx {} \;`; do C=`grep -c xxx.xxx.xxx.xxx ${FNAME}`; echo "${C}:${FNAME}" >> /unixsxxx/apps/41.txt;done How to avoid my command from... (2 Replies)
Discussion started by: TimHortons
2 Replies

5. Programming

pipe-fork-execve

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)
Discussion started by: xtremejames183
4 Replies

6. Programming

md5sum and execve

Hello there! Is there a way to use execve() to run md5sum function? for example execve("md5sum <filename>, NULL,NULL);" thanx! (2 Replies)
Discussion started by: nicos
2 Replies

7. UNIX for Dummies Questions & Answers

script permission error

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)
Discussion started by: rschille
2 Replies

8. Programming

execve to execute a program

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)
Discussion started by: winsonlee
0 Replies

9. UNIX for Advanced & Expert Users

getcwd: permission denied error

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)
Discussion started by: Deepa
3 Replies

10. UNIX for Dummies Questions & Answers

rm Permission Denied error

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)
Discussion started by: Cech2002
7 Replies
Login or Register to Ask a Question