18 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 |
*/ |
*/ |
20 |
|
|
21 |
#include <stdlib.h> /* malloc realloc free */ |
#include <stdlib.h> /* malloc realloc free */ |
22 |
#include <unistd.h> /* read close getuid getgid getpid getppid gethostname */ |
#include <unistd.h> /* read close getuid getgid getpid getppid gethostname */ |
23 |
#include <fcntl.h> /* open */ |
#include <fcntl.h> /* open */ |
24 |
#include <pwd.h> /* getpwuid */ |
#include <pwd.h> /* getpwuid */ |
25 |
#include <sys/stat.h> /* stat */ |
#include <sys/stat.h> /* stat */ |
26 |
#include <sys/time.h> /* gettimeofday */ |
#include <sys/time.h> /* gettimeofday */ |
27 |
#include <sys/times.h> /* times */ |
#include <sys/times.h> /* times */ |
28 |
#include "rdesktop.h" |
#include "rdesktop.h" |
29 |
|
|
30 |
char username[16]; |
char username[16]; |
68 |
int c; |
int c; |
69 |
|
|
70 |
STATUS("rdesktop: A Remote Desktop Protocol client.\n"); |
STATUS("rdesktop: A Remote Desktop Protocol client.\n"); |
71 |
STATUS("Version "VERSION". Copyright (C) 1999-2000 Matt Chapman.\n"); |
STATUS("Version " VERSION |
72 |
|
". Copyright (C) 1999-2000 Matt Chapman.\n"); |
73 |
STATUS("See http://www.rdesktop.org/ for more information.\n\n"); |
STATUS("See http://www.rdesktop.org/ for more information.\n\n"); |
74 |
|
|
75 |
flags = RDP_LOGON_NORMAL; |
flags = RDP_LOGON_NORMAL; |
187 |
{ |
{ |
188 |
struct stat st; |
struct stat st; |
189 |
struct tms tmsbuf; |
struct tms tmsbuf; |
190 |
uint32 *r = (uint32 *)random; |
uint32 *r = (uint32 *) random; |
191 |
int fd; |
int fd; |
192 |
|
|
193 |
/* If we have a kernel random device, use it. */ |
/* If we have a kernel random device, use it. */ |
201 |
/* Otherwise use whatever entropy we can gather - ideas welcome. */ |
/* Otherwise use whatever entropy we can gather - ideas welcome. */ |
202 |
r[0] = (getpid()) | (getppid() << 16); |
r[0] = (getpid()) | (getppid() << 16); |
203 |
r[1] = (getuid()) | (getgid() << 16); |
r[1] = (getuid()) | (getgid() << 16); |
204 |
r[2] = times(&tmsbuf); /* system uptime (clocks) */ |
r[2] = times(&tmsbuf); /* system uptime (clocks) */ |
205 |
gettimeofday((struct timeval *)&r[3], NULL); /* sec and usec */ |
gettimeofday((struct timeval *) &r[3], NULL); /* sec and usec */ |
206 |
stat("/tmp", &st); |
stat("/tmp", &st); |
207 |
r[5] = st.st_atime; |
r[5] = st.st_atime; |
208 |
r[6] = st.st_mtime; |
r[6] = st.st_mtime; |
254 |
thisline = 16; |
thisline = 16; |
255 |
|
|
256 |
for (i = 0; i < thisline; i++) |
for (i = 0; i < thisline; i++) |
257 |
STATUS("%02x ", line[i]) |
STATUS("%02x ", line[i]) for (; i < 16; i++) |
258 |
|
STATUS(" "); |
|
for (; i < 16; i++) |
|
|
STATUS(" "); |
|
259 |
|
|
260 |
for (i = 0; i < thisline; i++) |
for (i = 0; i < thisline; i++) |
261 |
STATUS("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); |
STATUS("%c", |
262 |
|
(line[i] >= 0x20 |
263 |
|
&& line[i] < 0x7f) ? line[i] : '.'); |
264 |
|
|
265 |
STATUS("\n"); |
STATUS("\n"); |
266 |
offset += thisline; |
offset += thisline; |