diff options
author | runge <runge> | 2008-11-22 18:36:33 +0000 |
---|---|---|
committer | runge <runge> | 2008-11-22 18:36:33 +0000 |
commit | 6fbba525a924961083bf2e43bb841bd15671f526 (patch) | |
tree | 3ec0cf4b285fb0140294a151b801c91bc78a612e /x11vnc/unixpw.c | |
parent | 63b98dba790fa9835e970b8502d93258862a9373 (diff) | |
download | libvncserver-6fbba525a924961083bf2e43bb841bd15671f526.zip libvncserver-6fbba525a924961083bf2e43bb841bd15671f526.tar.gz |
x11vnc: x11vnc.desktop file. -reopen, -dhparams, -sslCRL,
-setdefer options. -rfbport PROMPT VeNCrypt and TLSVNC SSL/TLS
encryption support. Tweaks to choose_delay() algorithm.
-ssl ANON anonymouse Diffie-Hellman mode. Fix bugs in certs
management. Additions to tray=setpass naive user mode.
Diffstat (limited to 'x11vnc/unixpw.c')
-rw-r--r-- | x11vnc/unixpw.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/x11vnc/unixpw.c b/x11vnc/unixpw.c index dcb1581..e0e102d 100644 --- a/x11vnc/unixpw.c +++ b/x11vnc/unixpw.c @@ -56,11 +56,6 @@ extern char *crypt(const char*, const char *); #define IS_BSD #endif -#ifdef NO_SSL_OR_UNIXPW -#undef UNIXPW_SU -#undef UNIXPW_CRYPT -#endif - int white_pixel(void); void unixpw_screen(int init); void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init); @@ -70,12 +65,11 @@ void unixpw_msg(char *msg, int delay); int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int nodisp); int crypt_verify(char *user, char *pass); int cmd_verify(char *user, char *pass); - +void unixpw_verify_screen(char *user, char *pass); static int text_x(void); static int text_y(void); static void set_db(void); -static void unixpw_verify(char *user, char *pass); int unixpw_in_progress = 0; int unixpw_denied = 0; @@ -1008,38 +1002,8 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int #endif /* UNIXPW_SU */ } -static void unixpw_verify(char *user, char *pass) { - int x, y; - char li[] = "Login incorrect"; - char log[] = "login: "; - char *colon = NULL; - ClientData *cd = NULL; - int ok; - -if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "********"); - rfbLog("unixpw_verify: '%s'\n", user ? user : "(null)"); - - if (user) { - colon = strchr(user, ':'); - } - if (colon) { - *colon = '\0'; - rfbLog("unixpw_verify: colon: '%s'\n", user); - } - if (unixpw_client) { - cd = (ClientData *) unixpw_client->clientData; - if (cd) { - char *str = (char *)malloc(strlen("UNIX:") + - strlen(user) + 1); - sprintf(str, "UNIX:%s", user); - if (cd->username) { - free(cd->username); - } - cd->username = str; - } - } - - ok = 0; +int unixpw_verify(char *user, char *pass) { + int ok = 0; if (unixpw_cmd) { if (cmd_verify(user, pass)) { rfbLog("unixpw_verify: cmd_verify login for '%s'" @@ -1074,6 +1038,42 @@ if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "*** ok = 0; } } + return ok; +} + + +void unixpw_verify_screen(char *user, char *pass) { + int x, y; + char li[] = "Login incorrect"; + char log[] = "login: "; + char *colon = NULL; + ClientData *cd = NULL; + int ok; + +if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "********"); + rfbLog("unixpw_verify: '%s'\n", user ? user : "(null)"); + + if (user) { + colon = strchr(user, ':'); + } + if (colon) { + *colon = '\0'; + rfbLog("unixpw_verify: colon: '%s'\n", user); + } + if (unixpw_client) { + cd = (ClientData *) unixpw_client->clientData; + if (cd) { + char *str = (char *)malloc(strlen("UNIX:") + + strlen(user) + 1); + sprintf(str, "UNIX:%s", user); + if (cd->username) { + free(cd->username); + } + cd->username = str; + } + } + + ok = unixpw_verify(user, pass); if (ok) { unixpw_accept(user); @@ -1385,7 +1385,7 @@ if (db && db <= 2) fprintf(stderr, "u_cnt: %d %d/%d ks: 0x%x '%s'\n", u_cnt, x, in_passwd = 0; pass[p_cnt++] = '\n'; - unixpw_verify(user, pass); + unixpw_verify_screen(user, pass); for (i=0; i<nmax; i++) { user[i] = '\0'; pass[i] = '\0'; |