![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| setuid and guid | itik | SUN Solaris | 6 | 05-12-2008 06:28 PM |
| setuid bit - error | zedex | HP-UX | 3 | 11-14-2007 06:04 PM |
| setuid | Prem | UNIX for Dummies Questions & Answers | 1 | 02-16-2007 03:19 PM |
| cc, setuid, and LD_LIBRARY_PATH | WolfBoy | UNIX for Advanced & Expert Users | 0 | 01-19-2006 10:56 AM |
| Using setuid and setgid | crispy | UNIX for Dummies Questions & Answers | 1 | 04-16-2005 04:58 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a C wrapper programme which basically execute a shell script. The shell script has 700 as permission and oracle is owner of the shell script.
The C execuatble has 4711 permission so that means that it has setuid bit set and group and others can execute the C executable. The reason why I am doing is, I don't want to give read access to my shell script to others and group and owner will have rw access to the script file. When I execute my C execuatble as different user, it works great but I want some enhancement. When my script is being executed, it is executed as oracle user so every line in the script is executed as oracle user but there are certain things which I want to run as the real user not the effective user. e.g. my shell script calls sqlplus , so when sqlplus is being run , it is run under oracle user but what I want is , it should run under the name of real user. Is there any easy way to do this ? Thanks Sanjay |
| Forum Sponsor | ||
|
|
|
|||
|
Neo,
Thanks for reply. Can you please give me example how to do exec process with the UID, you want. Please see my test case below :- [IPLAY] $ ls -al a.ksh -rwx------ 1 oracle dba 46 Apr 15 15:54 a.ksh Where a.ksh is as follows :- #!/usr/bin/ksh # There are more lines of code here that should be executed # as oracle user. # but the line below (sqlplus) should be executed as the calling user i.e. real user. sqlplus system/cub4@idev1 ************************************* This is C Wrapper script. [IPLAY] $ cat a.c #include <stdlib.h> #include <stdio.h> #include <string.h> /********************************************** This is the wrapper script ***********************************************/ int main(int argc, char *argv[]) { int i; i=system("/local1/USERS/oracle/a.ksh"); if ( i == 0 ) return 0; else return 1; } I have compiled gcc a.c -o a Now, I have changed permission of a as 4711 So when I will execute a as some other user e.g. sanjay, the sqlplus session is started but I want to start the sqlplus session as the sanjay user which is the real user, oracle is the effective user in this case. Thanks Quote:
Last edited by sanjay92; 04-15-2002 at 04:22 PM. |
|||
| Google UNIX.COM |