/[rdesktop]/sourceforge.net/trunk/rdesktop/rdesktop.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdesktop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 238 by astrand, Wed Oct 23 14:55:52 2002 UTC revision 262 by astrand, Mon Nov 18 15:37:20 2002 UTC
# Line 55  BOOL encryption = True; Line 55  BOOL encryption = True;
55  BOOL desktop_save = True;  BOOL desktop_save = True;
56  BOOL fullscreen = False;  BOOL fullscreen = False;
57  BOOL grab_keyboard = True;  BOOL grab_keyboard = True;
58    BOOL hide_decorations = False;
59    
60  /* Display usage information */  /* Display usage information */
61  static void  static void
# Line 79  usage(char *program) Line 80  usage(char *program)
80          fprintf(stderr, "   -m: do not send motion events\n");          fprintf(stderr, "   -m: do not send motion events\n");
81          fprintf(stderr, "   -K: keep window manager key bindings\n");          fprintf(stderr, "   -K: keep window manager key bindings\n");
82          fprintf(stderr, "   -T: window title\n");          fprintf(stderr, "   -T: window title\n");
83            fprintf(stderr, "   -D: hide window manager decorations\n");
84  }  }
85    
86  static BOOL  static BOOL
# Line 136  main(int argc, char *argv[]) Line 138  main(int argc, char *argv[])
138          flags = RDP_LOGON_NORMAL;          flags = RDP_LOGON_NORMAL;
139          prompt_password = False;          prompt_password = False;
140          domain[0] = password[0] = shell[0] = directory[0] = 0;          domain[0] = password[0] = shell[0] = directory[0] = 0;
141          strcpy(keymapname, "us");          strcpy(keymapname, "en-us");
142    
143          while ((c = getopt(argc, argv, "u:d:s:c:p:n:k:g:fbemKT:h?")) != -1)          while ((c = getopt(argc, argv, "u:d:s:c:p:n:k:g:fbemKT:Dh?")) != -1)
144          {          {
145                  switch (c)                  switch (c)
146                  {                  {
# Line 218  main(int argc, char *argv[]) Line 220  main(int argc, char *argv[])
220                                  STRNCPY(title, optarg, sizeof(title));                                  STRNCPY(title, optarg, sizeof(title));
221                                  break;                                  break;
222    
223                            case 'D':
224                                    hide_decorations = True;
225                                    break;
226    
227                          case 'h':                          case 'h':
228                          case '?':                          case '?':
229                          default:                          default:
# Line 312  generate_random_egd(uint8 * buf) Line 318  generate_random_egd(uint8 * buf)
318    
319          addr.sun_family = AF_UNIX;          addr.sun_family = AF_UNIX;
320          memcpy(addr.sun_path, EGD_SOCKET, sizeof(EGD_SOCKET));          memcpy(addr.sun_path, EGD_SOCKET, sizeof(EGD_SOCKET));
321          if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1)          if (connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1)
322                  goto err;                  goto err;
323    
324          /* PRNGD and EGD use a simple communications protocol */          /* PRNGD and EGD use a simple communications protocol */
325          buf[0] = 1;  /* Non-blocking (similar to /dev/urandom) */          buf[0] = 1;             /* Non-blocking (similar to /dev/urandom) */
326          buf[1] = 32; /* Number of requested random bytes */          buf[1] = 32;            /* Number of requested random bytes */
327          if (write(fd, buf, 2) != 2)          if (write(fd, buf, 2) != 2)
328                  goto err;                  goto err;
329    
330          if ((read(fd, buf, 1) != 1) || (buf[0] == 0)) /* Available? */          if ((read(fd, buf, 1) != 1) || (buf[0] == 0))   /* Available? */
331                  goto err;                  goto err;
332    
333          if (read(fd, buf, 32) != 32)          if (read(fd, buf, 32) != 32)
# Line 329  generate_random_egd(uint8 * buf) Line 335  generate_random_egd(uint8 * buf)
335    
336          ret = True;          ret = True;
337    
338  err:        err:
339          close(fd);          close(fd);
340          return ret;          return ret;
341  }  }
# Line 362  generate_random(uint8 * random) Line 368  generate_random(uint8 * random)
368  #endif  #endif
369    
370          /* Otherwise use whatever entropy we can gather - ideas welcome. */          /* Otherwise use whatever entropy we can gather - ideas welcome. */
371          r = (uint32 *)random;          r = (uint32 *) random;
372          r[0] = (getpid()) | (getppid() << 16);          r[0] = (getpid()) | (getppid() << 16);
373          r[1] = (getuid()) | (getgid() << 16);          r[1] = (getuid()) | (getgid() << 16);
374          r[2] = times(&tmsbuf);  /* system uptime (clocks) */          r[2] = times(&tmsbuf);  /* system uptime (clocks) */
# Line 374  generate_random(uint8 * random) Line 380  generate_random(uint8 * random)
380    
381          /* Hash both halves with MD5 to obscure possible patterns */          /* Hash both halves with MD5 to obscure possible patterns */
382          MD5_Init(&md5);          MD5_Init(&md5);
383          MD5_Update(&md5, random, 16);          MD5_Update(&md5, random, 16);
384          MD5_Final(random, &md5);          MD5_Final(random, &md5);
385          MD5_Update(&md5, random+16, 16);          MD5_Update(&md5, random + 16, 16);
386          MD5_Final(random+16, &md5);          MD5_Final(random + 16, &md5);
387  }  }
388    
389  /* malloc; exit if out of memory */  /* malloc; exit if out of memory */

Legend:
Removed from v.238  
changed lines
  Added in v.262

  ViewVC Help
Powered by ViewVC 1.1.26