Sfoglia il codice sorgente

log unsuccessful login attempts even when user doesn't exist

Serghey Rodin 11 anni fa
parent
commit
cf3ed3e9f5
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      src/v-check-user-password.c

+ 6 - 0
src/v-check-user-password.c

@@ -78,6 +78,12 @@ int main (int argc, char** argv) {
         }
     } else {
         printf("Error: no such user\n",argv[1]);
+        strcat(str, argv[1]);
+        strcat(str, " ");
+        strcat(str, ip);
+        strcat(str, " failed to login \n");
+        fputs (str,pFile);      /* write */
+        fclose (pFile);         /* close */
         exit(3);
     };