![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's | manas6 | UNIX for Dummies Questions & Answers | 0 | 06-05-2008 07:44 AM |
| asking about return code | naamas03 | Shell Programming and Scripting | 3 | 08-28-2007 05:53 AM |
| return value of a function | prez | Shell Programming and Scripting | 3 | 08-22-2007 06:08 PM |
| What is wrapper script and how to write | chiru | UNIX for Dummies Questions & Answers | 1 | 06-12-2006 06:23 AM |
| Return Code of tar in AIX | dupeng | AIX | 3 | 02-23-2004 12:05 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Code:
#include <unistd.h>
uid_t myuid(void)
{
return getuid();
}
No offense meant, but setuid is a major security risk. Don't go implementing your code on your system unless it is a home desktop that can be trashed. setuid requires either root or the so-called sticky bit set to allow the program to change it's username. It may seem simple but there is a lot to writing a setuid program: http://nob.cs.ucdavis.edu/bishop/sec...sproglogin.pdf |
|
||||
|
setuid() is pretty integral to a safe unix process.
One basic mode is for a root privileged parent to acquire resources only it can handle (ports < 1024) and then delegate service to setuid(> 0) children/threads, ala OpenSSH and many other pieces of software via IPC. Given it's not easy to do securely and does pose a considerable security issue: mostly races and various abuses of unsafe programing practices in the privileged process. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|