12-31-2013
Check out setuid/setgid.
A small c program / executable with setuid set could achieve your goal.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Solaris
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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. UNIX for Dummies Questions & Answers
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
7. Web Development
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
8. UNIX for Beginners Questions & Answers
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
9. 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
LEARN ABOUT MOJAVE
seteuid
SETUID(2) BSD System Calls Manual SETUID(2)
NAME
setegid, seteuid, setgid, setuid -- set user and group ID
SYNOPSIS
#include <unistd.h>
int
setegid(gid_t egid);
int
seteuid(uid_t euid);
int
setgid(gid_t gid);
int
setuid(uid_t uid);
DESCRIPTION
The setuid() function sets the real and effective user IDs and the saved set-user-ID of the current process to the specified value. The
setuid() function is permitted if the effective user ID is that of the super user, or if the specified user ID is the same as the effective
user ID. If not, but the specified user ID is the same as the real user ID, setuid() will set the effective user ID to the real user ID.
The setgid() function sets the real and effective group IDs and the saved set-group-ID of the current process to the specified value. The
setgid() function is permitted if the effective user ID is that of the super user, or if the specified group ID is the same as the effective
group ID. If not, but the specified group ID is the same as the real group ID, setgid() will set the effective group ID to the real group
ID.
The seteuid() function (setegid()) sets the effective user ID (group ID) of the current process. The effective user ID may be set to the
value of the real user ID or the saved set-user-ID (see intro(2) and execve(2)); in this way, the effective user ID of a set-user-ID exe-
cutable may be toggled by switching to the real user ID, then re-enabled by reverting to the set-user-ID value. Similarly, the effective
group ID may be set to the value of the real group ID or the saved set-user-ID.
RETURN VALUES
Upon success, these functions return 0; otherwise -1 is returned.
If the user is not the super user, or the uid specified is not the real, effective ID, or saved ID, these functions return -1.
ERRORS
The setegid(), seteuid(), setgid(), and setuid() system calls will fail if:
[EINVAL] The value of the {group,user} ID argument is invalid and is not supported by the implementation.
[EPERM] The process does not have appropriate privileges and the ID argument does not match the real ID or the saved
set-{group,user}-ID.
LEGACY SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
The include file <sys/types.h> is necessary for all functions.
SEE ALSO
getgid(2), getuid(2), compat(5)
STANDARDS
The setuid() and setgid() functions are compliant with the ISO/IEC 9945-1:1990 (``POSIX.1'') specification with _POSIX_SAVED_IDS defined,
with the extensions allowed in section B.4.2.2. The seteuid() and setegid() functions are extensions based on the POSIX concept of
_POSIX_SAVED_IDS, and have been proposed for a future revision of the standard.
4.2 Berkeley Distribution June 4, 1993 4.2 Berkeley Distribution