ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/tools.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/tools.c (file contents):
Revision 1.17 by pajs, Mon Jan 5 14:21:07 2004 UTC vs.
Revision 1.18 by ats, Mon Jan 5 17:20:29 2004 UTC

# Line 25 | Line 25
25   #include <stdio.h>
26   #include <string.h>
27   #include <stdlib.h>
28 + #include <unistd.h>
29   #include <sys/types.h>
30   #include <regex.h>
31   #ifdef ALLBSD
# Line 337 | Line 338 | int statgrab_init(){
338   #endif
339          return 0;
340   }
341 +
342 + int statgrab_drop_privileges() {
343 +        if (setegid(getgid()) != 0) return -1;
344 +        if (seteuid(getuid()) != 0) return -1;
345 +        return 0;
346 + }
347 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines