File: usercheck.c

package info (click to toggle)
nn 6.5.1-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,472 kB
  • ctags: 4,518
  • sloc: ansic: 35,126; sh: 1,489; makefile: 214; awk: 138
file content (13 lines) | stat: -rw-r--r-- 199 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13

/* check for whether caller is a specific uid (numeric) */

main(argc, argv)
int argc;
char *argv[];
{
    int uid = 0;

    if (argc > 1) uid = atoi(argv[1]);

    exit(getuid() == uid ? 0 : 1);
}