--- xlock/resource-msg-jp.h.old Wed Sep 25 21:45:49 2002 +++ xlock/resource-msg-jp.h Wed Sep 25 21:27:40 2002 @@ -10,6 +10,7 @@ #define DEF_VALID "¥Ñ¥¹¥ï¡¼¥É¸¡ººÃæ..." #define DEF_INVALID "¥Ñ¥¹¥ï¡¼¥É¤¬°ã¤¤¤Þ¤¹¡£" #define DEF_INFO "¥Ñ¥¹¥ï¡¼¥É¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤ÈºÆ¥í¥Ã¥¯¤·¤Þ¤¹¡£" +#define DEF_COUNT_FAILED " failed attempts" #define DEF_BTN_LABEL "¥í¥°¥¢¥¦¥È" #define DEF_BTN_HELP "¤³¤³¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¥í¥°¥¢¥¦¥È" --- xlock/resource.c.old Wed Sep 25 21:45:30 2002 +++ xlock/resource.c Wed Sep 25 21:28:22 2002 @@ -163,6 +163,7 @@ # define DEF_VALID "Validation ..." # define DEF_INVALID "Mot de passe Invalide." # define DEF_INFO "Entrez le mot de passe ou choisissez l'icone pour verrouiller." +# define DEF_COUNT_FAILED " essais échoués." #else #if defined NL # define DEF_NAME "Naam: " @@ -170,6 +171,7 @@ # define DEF_VALID "Aan het checken ..." # define DEF_INVALID "Ongeldig wachtwoord." # define DEF_INFO "Geef wachtwoord om te ontgrendelen ; selecteer het icoon om te vergendelen." +# define DEF_COUNT_FAILED " failed attempts." #else #if defined JP # include "resource-msg-jp.h" @@ -179,6 +181,7 @@ # define DEF_VALID "Validating login..." # define DEF_INVALID "Invalid login." # define DEF_INFO "Enter password to unlock; select icon to lock." +# define DEF_COUNT_FAILED " failed attempts." #endif #endif #endif @@ -775,7 +778,7 @@ char *text_invalid; char *geometry; char *icongeometry; - +char *failed_attempts; #ifdef FX char *glgeometry; @@ -886,6 +889,7 @@ {(caddr_t *) & text_invalid, "invalid", "Invalid", DEF_INVALID, t_String}, {(caddr_t *) & geometry, "geometry", "Geometry", DEF_GEOMETRY, t_String}, {(caddr_t *) & icongeometry, "icongeometry", "IconGeometry", DEF_ICONGEOMETRY, t_String}, + {(caddr_t *) & failed_attempts, "failed_att", "Failed_att", DEF_COUNT_FAILED, t_String}, #ifdef FX {(caddr_t *) & glgeometry, "glgeometry", "GLGeometry", DEF_GLGEOMETRY, t_String}, #endif --- xlock/xlock.c.old Wed Sep 25 21:45:18 2002 +++ xlock/xlock.c Wed Sep 25 21:44:35 2002 @@ -176,6 +176,8 @@ * */ +int count_failed; + #ifdef STANDALONE /*- @@ -728,6 +730,7 @@ extern char *text_user; extern char *text_pass; extern char *text_info; +extern char *failed_attempts; extern char *text_valid; extern char *text_invalid; extern char *geometry; @@ -2189,6 +2192,19 @@ putText(dsp, Scr[screen].window, Scr[screen].textgc, text_info, False, left, &x, &y); putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n", False, left, &x, &y); + if(count_failed > 0) { + char * cnt=NULL; + y += font->ascent + font->descent + 6; + if (y < Scr[screen].iconpos.y + iconheight + font->ascent + 12) + y = Scr[screen].iconpos.y + iconheight + font->ascent + 12; + x = left = Scr[screen].iconpos.x; + cnt = malloc(strlen(failed_attempts)+5); /* let the number be up to 9999 */ + sprintf(cnt,"%d%s",count_failed, failed_attempts); + putText(dsp, Scr[screen].window, Scr[screen].textgc, cnt, False, left, &x, &y); + putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n", False, left, &x, &y); + free(cnt); + } + timex = x; timey = y; @@ -2353,10 +2369,12 @@ if (!done && !*buffer) { /* just hit return, and it was not his password */ + count_failed++; break; #if defined( HAVE_SYSLOG_H ) && defined( USE_SYSLOG ) } else if (!done) { /* bad password... log it... */ + count_failed++; (void) printf("failed unlock attempt on user %s\n", user); syslog(SYSLOG_NOTICE, "%s: failed unlock attempt on user %s\n", ProgramName, user); @@ -2409,6 +2427,8 @@ if (sound) play_sound(invalidsound, verbose); got_invalid = 1; + count_failed++; + #endif } }