The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



Thread: File Permission
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 03-27-2002
sanjay92
Guest
 

Posts: n/a
Thanks Guys,
I was able to write a C wrapper script and it looks like it works perfect.


Sanjay


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/**********************************************
This is the wrapper script
How to Compile : gcc f_getSQLPLUS.c -o f_getSQLPLUS
: chmod 4711 f_getSQLPLUS

***********************************************/

int main(int argc, char *argv[]) {
char argbuf[4096] = ". /opt/app/oracle/local/bin/oralib.ksh ; ";
int i;

for (i = 0; i < argc ; i++)
{
strcat(argbuf,argv[i]);
strcat(argbuf, " ");
}

//printf("%s", argbuf);
system(argbuf);
}



Quote:
Originally posted by LivinFree
No Unix that I know of will execute a shell script setuid, even if the setuid bit is on.

You could write a wrapper script, though, using sudo, and if you set up the sudoers file correctly, you should be able to let them execute, but not read.