[pve-devel] r5420 - vncterm/pve2

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Jan 24 10:43:45 CET 2011


Author: dietmar
Date: 2011-01-24 10:43:44 +0100 (Mon, 24 Jan 2011)
New Revision: 5420

Modified:
   vncterm/pve2/vncterm.c
Log:
remove passwdfile option


Modified: vncterm/pve2/vncterm.c
===================================================================
--- vncterm/pve2/vncterm.c	2011-01-24 09:40:07 UTC (rev 5419)
+++ vncterm/pve2/vncterm.c	2011-01-24 09:43:44 UTC (rev 5420)
@@ -2255,16 +2255,11 @@
     }
   }
 
-  char *passwdfile = NULL;
   for (i = 1; i < argc; i++) {
     if (!strcmp (argv[i], "-timeout")) {
       CHECK_ARGC (argc, argv, i);
       idle_timeout = atoi(argv[i+1]);
       rfbPurgeArguments(&argc, &i, 2, argv);
-    } else if (!strcmp (argv[i], "-passwdfile")) {
-      CHECK_ARGC (argc, argv, i);
-      passwdfile = strdup(argv[i+1]);
-      rfbPurgeArguments(&argc, &i, 2, argv);
     }
   }
 
@@ -2278,46 +2273,6 @@
 
   vncTerm *vt = create_vncterm (argc, argv, 745, 400);
 
-  if (passwdfile) {
-    int rem = 0;
-    if (passwdfile[0] == 'r' && passwdfile[1] == 'm' &&
-	passwdfile[2] == ':') {
-      passwdfile += 3;
-      rem = 1;
-    }
-    FILE *pwfd;
-
-    if (!(pwfd = fopen (passwdfile, "r"))) {
-      perror ("unable to open password file");
-      exit (-1);
-    }
-
-    char passwd[10];
-    passwd[0] = 0;
-
-    if (!fgets (passwd, 9, pwfd)) {
-      perror ("unable to read password file");
-      if (rem) unlink (passwdfile);
-      exit (-1);
-    }
-    fclose (pwfd);
-
-    if (strlen (passwd) != 8) {
-      fprintf (stderr, "vnc password too short\n");
-      if (rem) unlink (passwdfile);
-      exit (-1);
-    }
-
-    if (rem) unlink (passwdfile);
-
-    char **passwds = malloc (sizeof (char**)*2);
-
-    passwds[0] = passwd;
-    passwds[1] = NULL;
-    vt->screen->authPasswdData = (void*)passwds;
-    vt->screen->passwordCheck = rfbCheckPasswordByList;
-  }
-
   setlocale(LC_ALL, ""); // set from environment
 
   char *ctype = setlocale (LC_CTYPE, NULL); // query LC_CTYPE



More information about the pve-devel mailing list