Merge branch 'master' of [email protected]:acess2
[tpg/acess2.git] / Usermode / Applications / login_src / main.c
index 391d5bc..456974f 100644 (file)
@@ -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';
                }

UCC git Repository :: git.ucc.asn.au