nightmaremail

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

uid.c (407B)


      1 #include <sys/types.h>
      2 #include <pwd.h>
      3 #include <unistd.h>
      4 #include "uidgid.h"
      5 #include "subfd.h"
      6 #include "substdio.h"
      7 
      8 uid_t
      9 inituid(char *user)
     10 {
     11   struct passwd *pw;
     12   pw = getpwnam(user);
     13   if (!pw) {
     14     substdio_puts(subfderr,"fatal: unable to find user ");
     15     substdio_puts(subfderr,user);
     16     substdio_puts(subfderr,"\n");
     17     substdio_flush(subfderr);
     18     _exit(111);
     19   }
     20   return pw->pw_uid;
     21 }