diff --git a/src/lib/libc_old/sys/auth.c b/src/lib/libc_old/sys/auth.c new file mode 100644 index 0000000..ef002f9 --- /dev/null +++ b/src/lib/libc_old/sys/auth.c @@ -0,0 +1,31 @@ +#include + +typedef struct _UbixUser UbixUser; +struct _UbixUser +{ + char *username; + char *password; + int uid; + int gid; + char *home; + char *shell; +}; + + +int auth(char *username, char *password) +{ + UbixUser *uu; + + uu = malloc(sizeof *uu); + uu->uid = -1; + uu->username = username; + uu->password = password; + + asm volatile( + "int %0\n" + : : "i" (0x80), "a" (35), "b" (uu) + ); + if(uu->uid == -1) + return 0; + return 1; +}