Fix for empty usernames
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@288 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
4574f1d7bd
commit
6006a962ee
@ -137,6 +137,7 @@ main(int argc, char *argv[])
|
|||||||
uint32 flags;
|
uint32 flags;
|
||||||
char *p;
|
char *p;
|
||||||
int c;
|
int c;
|
||||||
|
int username_option = 0;
|
||||||
|
|
||||||
flags = RDP_LOGON_NORMAL;
|
flags = RDP_LOGON_NORMAL;
|
||||||
prompt_password = False;
|
prompt_password = False;
|
||||||
@ -149,6 +150,7 @@ main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
case 'u':
|
case 'u':
|
||||||
STRNCPY(username, optarg, sizeof(username));
|
STRNCPY(username, optarg, sizeof(username));
|
||||||
|
username_option = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
@ -259,7 +261,7 @@ main(int argc, char *argv[])
|
|||||||
*p = 0;
|
*p = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (username[0] == 0)
|
if (!username_option)
|
||||||
{
|
{
|
||||||
pw = getpwuid(getuid());
|
pw = getpwuid(getuid());
|
||||||
if ((pw == NULL) || (pw->pw_name == NULL))
|
if ((pw == NULL) || (pw->pw_name == NULL))
|
||||||
|
Loading…
Reference in New Issue
Block a user