Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by manu ( 7 years ago )
#include <stdio.h>
#include<stdlib.h>
int main (int argc, char *argv[])
{
FILE *f_in;
char *cadena = "/etc/passwd";
char login[100], passwd[100], gecos[100], gid[100], home[100], shell[100];
int uid;
if(argv[1])
cadena = argv[1];
f_in = fopen(cadena, "r");
while(!feof(f_in)){
if(fscanf(f_in,"%99[^:],%99[^:]%*c,%d,%99[^:]%*c,%99[^:],%99[^:]%*c,%99[^:]%*c\n",login,passwd,&uid, gid,gecos,home,shell))
{
printf("--- Fichero:\n");
printf("Usuario: %s\n", login);
printf("login: %s\n", gecos);
printf("uid: %d\n",uid);
}
}
return 0;
}
Revise this Paste