home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume22 / nn6.4 / part22 / usercheck.c < prev   
Encoding:
C/C++ Source or Header  |  1990-06-07  |  198 b   |  13 lines

  1. /* check for whether caller is a specific uid (numeric) */
  2.  
  3. main(argc, argv)
  4. int argc;
  5. char *argv[];
  6. {
  7.     int uid = 0;
  8.  
  9.     if (argc > 1) uid = atoi(argv[1]);
  10.  
  11.     exit(getuid() == uid ? 0 : 1);
  12. }
  13.