X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Flogin_src%2Fmain.c;h=456974fcafe83d72ed414daee6428566b63b9cf8;hb=b98fbd4e9c71447d81fc9bd643fb174c76346e0f;hp=391d5bccfacfa5443aa306249f02bd79a19af89a;hpb=95a7eaaa4a1065334125b65130866f8d1048ddb7;p=tpg%2Facess2.git diff --git a/Usermode/Applications/login_src/main.c b/Usermode/Applications/login_src/main.c index 391d5bcc..456974fc 100644 --- a/Usermode/Applications/login_src/main.c +++ b/Usermode/Applications/login_src/main.c @@ -57,7 +57,8 @@ int main(int argc, char *argv[]) child_argv[0] = uinfo->Shell; // Set Environment setgid(uinfo->GID); - setuid(uid); + //setuid(uid); + setuid(uinfo->UID); execve(uinfo->Shell, child_argv, child_envp); exit(-1); @@ -86,6 +87,7 @@ char *GetUsername() while( (ch = fgetc(stdin)) != -1 && ch != '\n' ) { if(ch == '\b') { + if( pos <= 0 ) continue; pos --; ret[pos] = '\0'; } @@ -121,6 +123,7 @@ char *GetPassword() while( (ch = fgetc(stdin)) != -1 && ch != '\n' ) { if(ch == '\b') { + if( pos <= 0 ) continue; pos --; ret[pos] = '\0'; }