Allow user without dir write permission to execute a script that creates files


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Allow user without dir write permission to execute a script that creates files
# 15  
Old 01-08-2014
I think sudo is successful because it is setuid-root.
Then it can do a setuid(0) to remove restrictions, maybe along with some other magic, and finally it can setuid(user) to switch to a user and run an unrestricted exec().
If you have time, study the sudo source files (sudo.c etc.)!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies

2. UNIX for Beginners Questions & Answers

Setting write permission for particular user

Hi All, We have a scenario in production where we want only one user from a group to modify the file. The file is not set to write permission for application manager. -r--r--r-- 1 amgr u00 15661716 Aug 30 00:06 DCI.dat So here amgr will have permission to edit the file. We want a... (10 Replies)
Discussion started by: arunkumar_mca
10 Replies

3. Web Development

Apache write permission issues to another user owned directory

Hi I am trying to make a web program which is command line equivalent. i have done the coding in cgi program in perl and html for basic forms to take inputs. when i ran the program from web application i see permission denied messages. after analyzing i found apache is running as wwwrun which... (2 Replies)
Discussion started by: rakeshkumar
2 Replies

4. UNIX for Dummies Questions & Answers

Provide execute permission to a user

Hi, I have a shell script(test.sh) and need to give execute permission for this shell script to user group cobr_sftp and oracle. Could you please help as to how to give this permission. I have already given full access(777) to script test.sh. Does this mean all the users/user group can access... (1 Reply)
Discussion started by: abhi_123
1 Replies

5. Shell Programming and Scripting

perl script to check read/write/execute permission for 'others'

I want to check access rights permissions not for 'user', not for 'group', but for 'others'. I want to do it by system command in which i want to use 'ls -l' and 'awk' command. I have written the following program : #!/usr/bin/local/perl #include <stdlib.h> system ("ls -l | awk... (1 Reply)
Discussion started by: shubhamsachdeva
1 Replies

6. Shell Programming and Scripting

search any user files with write permission

Guys, i wanna get any user files with write permission (on user or group permission) for review but i confuse with -perm parameter. any body can help me to explain what is that mean? thank's (1 Reply)
Discussion started by: michlix
1 Replies

7. Shell Programming and Scripting

write permission to a perticular user to a directory

Hi, The requirement is like, the program needs 2 argument one is user_id and second one is directory path. My script will check if that user_id has write access to the directory path. The directory path may be in any file system like AFS or NFS. Can any one please suggest some points to... (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

8. Solaris

cant able to change permission in a DIR as root user

Hi my directory not accepting any commands. its simply telling permission denied. i tried ( cp, mv, rm ) as roor i want to set default permissons to this DIR please find the Logs below. dr-xr-xr-x 1 root root 1 Jun 1 09:04 AP1_ROP ( original dir) root> chmod 777... (5 Replies)
Discussion started by: vijayq8
5 Replies

9. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
Login or Register to Ask a Question
setjmp(3)						     Library Functions Manual							 setjmp(3)

Name
       setjmp, longjmp - non-local goto

Syntax
       #include <setjmp.h>

       int setjmp (env)
       jmp_buf env;

       void longjmp (env, val)
       jmp_buf env;
       int val;

Description
       The and functions help deal with errors and interrupts encountered in a low-level subroutine of a program.

       The function saves its stack environment in env (whose type, jmp_buf, is defined in the <setjmp.h> header file) for later use by It returns
       the value 0.

       The function restores the environment saved by the last call of with the corresponding env argument.   After  finishes,	program  execution
       continues  as if the corresponding call of (which must not itself have returned in the interim) had just returned the value val.  The func-
       tion cannot cause to return the value 0.  If is invoked with a second argument of 0, returns 1.	At the time of the second return from  all
       accessible  data  have  values as of the time is called.  However, global variables have the expected values.  For example, those as of the
       time of the

Examples
       #include <setjmp.h>

       jmp_buf env;
       int i = 0;
       main ()
       {
	    void exit();

	    if(setjmp(env) != 0) {
		 (void) printf("value of i on 2nd return from setjmp: %d0, i);
		 exit(0);
	    }
	    (void) printf("value of i on 1st return from setjmp: %d0, i);
	    i = 1;
	    g();
	    /*NOTREACHED*/
       }

       g()
       {
	    longjmp(env, 1);
	    /*NOTREACHED*/
       }

       If the a.out resulting from this C language code is run, the output is as follows:
       value of i on 1st return from setjmp:0

       value of i on 2nd return from setjmp:1
       Unexpected behavior occurs if is called without a previous call to or when the last such call was in a function which has since returned.

Restrictions
       The values of the registers on the second return from are register values at the time of the first call to not those of the Thus, variables
       in a given function can produce unexpected results in the presence of depending on whether they are register or stack variables.

See Also
       signal(2).

								       RISC								 setjmp(3)