10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
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
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
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
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
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
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
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
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
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
issetugid(2) System Calls issetugid(2)
NAME
issetugid - determine if current executable is running setuid or setgid
SYNOPSIS
#include <unistd.h>
int issetugid(void);
DESCRIPTION
The issetugid() function enables library functions (in libtermlib, libc, or other libraries) to guarantee safe behavior when used in setuid
or setgid programs or programs that run with more privileges after a succesful exec(2). Some library functions might be passed insufficient
information and not know whether the current program was started setuid or setgid because a higher level calling code might have made
changes to the uid, euid, gid, or egid. These low-level library functions are therefore unable to determine if they are being run with ele-
vated or normal privileges.
The issetugid() function should be used to determine if a path name returned from a getenv(3C) call can be used safely to open the speci-
fied file. It is often not safe to open such a file because the status of the effective uid is not known.
The result of a call to issetugid() is unaffected by calls to setuid(), setgid(), or other such calls. In case of a call to fork(2), the
child process inherits the same status.
The status of issetugid() is affected only by execve() (see exec(2)). If a child process executes a new executable file, a new issetugid()
status will be based on the existing process's uid, euid, gid, and egid permissions and on the modes of the executable file. If the new
executable file modes are setuid or setgid, or if the existing process is executing the new image with uid != euid or gid != egid, or if
the permitted set before the call to the exec function is not a superset of the inheritable set at that time, issetugid() returns 1 in the
new process.
RETURN VALUES
The issetugid() function returns 1 if the process was made setuid or setgid as the result of the last or a previous call to execve(). Oth-
erwise it returns 0.
ERRORS
The issetugid() function is always successful. No return value is reserved to indicate an error.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
exec(2), fork(2), setuid(2), getenv(3C), attributes(5), privileges(5)
SunOS 5.10 19 Feb 2003 issetugid(2)