diff --git a/src/bin/login/main.c b/src/bin/login/main.c index 7754bb5..2859677 100644 --- a/src/bin/login/main.c +++ b/src/bin/login/main.c @@ -86,8 +86,8 @@ printf("Password: "); pgets((char *)&passWord); for (i=0x0;i<(4096/sizeof(struct passwd));i++) { - if (0x0 == memcmp(userName,data[i].username,4)) { - if (0x0 == memcmp(passWord,data[i].password,4)) { + if (0x0 == strcmp(userName,data[i].username)) { + if (0x0 == strcmp(passWord,data[i].password)) { shellPid = fork(); if (!shellPid) { if (setuid(data[i].uid) != 0x0) { @@ -107,7 +107,7 @@ chdir(data[i].path); exec(data[i].shell,0x0,0x0); printf("Error: Problem Starting Shell\n"); - exit(1); + exit(-1); } else { while (pidStatus(shellPid) > 0) { diff --git a/src/bin/shell/commands.c b/src/bin/shell/commands.c index 97f71b3..b4ae750 100644 --- a/src/bin/shell/commands.c +++ b/src/bin/shell/commands.c @@ -90,6 +90,9 @@ mkdir(data->argv[1],0xEAA); } } + else if (memcmp(data->args->arg,"id",2) == 0x0) { + printf("UID: %i, GID: %i\n",getuid(),getgid()); + } else { return(0); }