Pejman Moghadam / C-programming

C - Get user identity

Public domain


#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
        if (getuid() != 0) {
                fprintf(stderr, "%s: root privelidges needed\n", *(argv + 0));
                exit(EXIT_FAILURE);
        }
}

BY: Pejman Moghadam
TAG: c, getuid
DATE: 2011-06-01 15:35:50


Pejman Moghadam / C-programming [ TXT ]