--------------------- PatchSet 2985 Date: 2001/09/09 10:34:28 Author: serassio Branch: nt-2_3-tolsty Tag: (none) Log: Fixed indent problems Members: contrib/chpasswd/Dutch.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/English.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/French.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/German.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/Hungarian.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/Italian.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/Portuguese.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/Russian.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/Spanish.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/chpasswd.c:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/conf.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/chpasswd/language.h:1.1.2.1.2.1->1.1.2.1.2.2 contrib/htpasswd/htpasswd.c:1.1.2.1.2.1->1.1.2.1.2.2 Index: squid/contrib/chpasswd/Dutch.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/Dutch.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/Dutch.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/Dutch.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,5 +1,7 @@ /* Dutch language added by Richard Baselier */ + #if defined(Dutch) + char *msg01 = "Geen schrijfpermissie op paswoord file:"; char *msg02 = "Nieuw paswoord leeg of te kort (minder dan"; char *msg03 = "karakters)."; @@ -23,109 +25,92 @@ char *msg21 = "Minimum aantal speciale karakters (toetsenbord)"; char *msg22 = "Wijzig uw Squid Account Paswoord"; char *msg23 = "Authorisatie file moet eigenaar root hebben. Aub. README."; -char *msg24 = - "Authorisatie file heeft verkeerde mode (moet 755 zijn). Aub. README."; -char *msg25 = "Kan authorisatie file niet openen."; +char *msg24 = "Authorisatie file heeft verkeerde mode (moet 755 zijn). Aub. README."; +char *msg25 = "Kan authorisatie file niet openen."; char *msg26 = "U bent niet bevoegd het paswoord te wijzigen."; char *msg27 = "Authorisatie file niet gevonden."; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Compositie:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" Wijzig Squid paswoord\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("Voor beveiligings redenen, pas deze regels toe op uw nieuwe paswoord :\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Uw account naam:\n"); - printf(" \n"); - printf("
    Uw huidige paswoord:\n"); - printf(" \n", maxlen); - printf("
    Nieuw paswoord:\n"); - printf(" \n", maxlen); - printf("
    Nogmaals nieuw paswoord:\n"); - printf(" \n", maxlen); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Compositie:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Wijzig Squid paswoord\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("Voor beveiligings redenen, pas deze regels toe op uw nieuwe paswoord :\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Uw account naam:\n"); + printf(" \n"); + printf("
    Uw huidige paswoord:\n"); + printf(" \n",maxlen); + printf("
    Nieuw paswoord:\n"); + printf(" \n",maxlen); + printf("
    Nogmaals nieuw paswoord:\n"); + printf(" \n",maxlen); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/English.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/English.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/English.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/English.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,5 +1,7 @@ /* English language added by Pedro L Orso */ + #if defined(English) + char *msg01 = "No write permission on password file:"; char *msg02 = "New password missing or too short (less than"; char *msg03 = "characters)."; @@ -28,104 +30,87 @@ char *msg26 = "You are not authorized to change password."; char *msg27 = "Authorization file not found."; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Composition:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" Change Squid Password\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("For security reasons, remember these rules about your new password:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Your Account Name:\n"); - printf(" \n"); - printf("
    Your Current Password:\n"); - printf(" \n", maxlen); - printf("
    New Password:\n"); - printf(" \n", maxlen); - printf("
    Retype New Password:\n"); - printf(" \n", maxlen); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Composition:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Change Squid Password\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("For security reasons, remember these rules about your new password:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Your Account Name:\n"); + printf(" \n"); + printf("
    Your Current Password:\n"); + printf(" \n",maxlen); + printf("
    New Password:\n"); + printf(" \n",maxlen); + printf("
    Retype New Password:\n"); + printf(" \n",maxlen); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/French.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/French.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/French.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/French.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,7 +1,8 @@ /* French language added by Alexandre Allien */ + #if defined(French) -char *msg01 = - "Vous n'avez pas le droit d'ecriture dans le fichier des mots de passe:"; + +char *msg01 = "Vous n'avez pas le droit d'ecriture dans le fichier des mots de passe:"; char *msg02 = "Le nouveau mot de passe est maquant ou trop court (moins de"; char *msg03 = "caractères)."; char *msg04 = "Le nouveau mot de passe est trop long (plus de"; @@ -18,118 +19,98 @@ char *msg15 = "Impossible d'ouvrir le fichier de configuration:"; char *msg16 = "Impossible d'ouvrir le fichier de log:"; char *msg17 = "Le nouveau mot de passe est invalide."; -char *msg18 = - "SVP, utilisez les règles suivantes pour saisir un nouveau mot de passe:"; +char *msg18 = "SVP, utilisez les règles suivantes pour saisir un nouveau mot de passe:"; char *msg19 = "Un minimun de caractères (a-z, A-Z)"; char *msg20 = "Un minimun de chiffres (0-9)"; -char *msg21 = "Un minimun de caractères spéciaux"; +char *msg21 = "Un minimun de caractères spéciaux"; char *msg22 = "Mise à jour du mot de passe d'accès à Squid"; -char *msg23 = - "Le fichier d'Authentification doit être possedé par l'utilisateur root. Lisez README."; -char *msg24 = - "Le fichier d'Authentification ne possède pas les bons droits (il doit etre en 755). Lisez README."; +char *msg23 = "Le fichier d'Authentification doit être possedé par l'utilisateur root. Lisez README."; +char *msg24 = "Le fichier d'Authentification ne possède pas les bons droits (il doit etre en 755). Lisez README."; char *msg25 = "Impossible d'ouvrir le fichier d'authentification."; char *msg26 = "Vous n'étes pas autorisé a changer votre mot de passe."; char *msg27 = "Impossible de trouver le fichier d'authentification."; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Composition:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" Mise à jour du mot de passe Squid\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("Pour des raisons de sécurité, rappelez-vous les règles pour votre nouveau mot de passe:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Votre nom d'utilisateur:\n"); - printf(" \n"); - printf("
    Votre mot de passe actuel:\n"); - printf(" \n", maxlen); - printf("
    Nouveau mot de passe:\n"); - printf(" \n", maxlen); - printf("
    Resaisissez votre nouveau mot de passe:\n"); - printf(" \n", maxlen); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Composition:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Mise à jour du mot de passe Squid\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("Pour des raisons de sécurité, rappelez-vous les règles pour votre nouveau mot de passe:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Votre nom d'utilisateur:\n"); + printf(" \n"); + printf("
    Votre mot de passe actuel:\n"); + printf(" \n",maxlen); + printf("
    Nouveau mot de passe:\n"); + printf(" \n",maxlen); + printf("
    Resaisissez votre nouveau mot de passe:\n"); + printf(" \n",maxlen); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/German.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/German.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/German.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/German.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,5 +1,7 @@ /* German language added by Juergen Scheiderer */ + #if defined(German) + char *msg01 = "Sie haben kein Schreibrecht für die Passwortdatei:"; char *msg02 = "Fehlendes oder zu kurzes Passwort (weniger als"; char *msg03 = "Zeichen)."; @@ -17,8 +19,7 @@ char *msg15 = "Konfigurationsdatei konnte nicht geöffnet werden:"; char *msg16 = "Protokolldatei konnte nicht geöffnet werden:"; char *msg17 = "Ungültiges neues Passwort."; -char *msg18 = - "Bitte beachten Sie die folgenden Regeln bei der Passworteingabe:"; +char *msg18 = "Bitte beachten Sie die folgenden Regeln bei der Passworteingabe:"; char *msg19 = "Zeichen (a-z, A-Z)"; char *msg20 = "Ziffern (0-9)"; char *msg21 = "Sonderzeichen (Tastatur)"; @@ -29,108 +30,89 @@ char *msg26 = "Sie haben keine Berechtigung, Ihr Passwort zu ändern."; char *msg27 = "Authorisations File nicht gefunden."; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Zusammensetzung:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" Aendern des Zugriffspasswortes\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("Aus Sicherheitsgründen sollten Sie sich bei Eingabe ihres neuen Passworts an folgenden Regeln orientieren:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Benutzername:\n"); - printf(" \n"); - printf("
    aktuelles Passwort:\n"); - printf(" \n"); - printf("
    neues Passwort:\n"); - printf(" \n"); - printf("
    neues Passwort wiederholen:\n"); - printf(" \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf - ("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Zusammensetzung:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Aendern des Zugriffspasswortes\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("Aus Sicherheitsgründen sollten Sie sich bei Eingabe ihres neuen Passworts an folgenden Regeln orientieren:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Benutzername:\n"); + printf(" \n"); + printf("
    aktuelles Passwort:\n"); + printf(" \n"); + printf("
    neues Passwort:\n"); + printf(" \n"); + printf("
    neues Passwort wiederholen:\n"); + printf(" \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/Hungarian.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/Hungarian.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/Hungarian.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/Hungarian.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,5 +1,6 @@ /* Hungarian language re-added by Domonkos Sandor Hungarian language added by Robert Szabo */ + #if defined(Hungarian) char *msg01 = "Nincs írási jog a jelszófile-hoz:"; @@ -24,111 +25,93 @@ char *msg20 = "legalább az alábbi számokat (0-9)"; char *msg21 = "Legalább az alábbi speciális jeleket (billentyüzet)"; char *msg22 = "Internet hozzáférési jogosultság módosítása"; -char *msg23 = - "Az autentikációs file-nak a root tulajdonában kell lennie. Olvasd el README."; -char *msg24 = - "Autentikációs file hibás jogosultsággal (755-nek kell lenni). Olvasd el README."; +char *msg23 = "Az autentikációs file-nak a root tulajdonában kell lennie. Olvasd el README."; +char *msg24 = "Autentikációs file hibás jogosultsággal (755-nek kell lenni). Olvasd el README."; char *msg25 = "Nem tudom megnyitni az autentikációs file-t."; char *msg26 = "Nincs jogod a jelszó módosítására."; char *msg27 = "Az autentikációs file-t nem találom."; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Composition:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" Change Squid Password\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("Biztonsági okok miatt emlékezz az alábbi szabályokra az új jelszó megadásakor:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Felhasználói neved:\n"); - printf(" \n"); - printf("
    Jelenlegi jelszavad:\n"); - printf(" \n", maxlen); - printf("
    Új jelszavad:\n"); - printf(" \n", maxlen); - printf("
    Új jelszavad megerösítése:\n"); - printf(" \n", maxlen); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Composition:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Change Squid Password\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("Biztonsági okok miatt emlékezz az alábbi szabályokra az új jelszó megadásakor:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Felhasználói neved:\n"); + printf(" \n"); + printf("
    Jelenlegi jelszavad:\n"); + printf(" \n",maxlen); + printf("
    Új jelszavad:\n"); + printf(" \n",maxlen); + printf("
    Új jelszavad megerösítése:\n"); + printf(" \n",maxlen); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/Italian.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/Italian.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/Italian.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/Italian.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,5 +1,7 @@ /* Italian language added by Luigi Gangitano */ + #if defined(Italian) + char *msg01 = "Diritti insufficienti per scrivere il file delle password:"; char *msg02 = "Manca la nuova password o e' troppo corta (meno di"; char *msg03 = "caratteri)."; @@ -17,116 +19,98 @@ char *msg15 = "Non e' possibile aprire il file di configurazione:"; char *msg16 = "Non e' possibile aprire il file di log:"; char *msg17 = "La nuova password non e' valida."; -char *msg18 = - "Per favore, usare le seguenti regole per inserire la nuova passowrd:"; +char *msg18 = "Per favore, usare le seguenti regole per inserire la nuova passowrd:"; char *msg19 = "Numero di lettere (minimo) (a-z, A-Z)"; char *msg20 = "Numero di cifre (minimo9 (0-9)"; char *msg21 = "Numero di caratteri speciali (minimo) (eg: %,&,*,ecc.)"; char *msg22 = "Cambia la tua Password di Accesso al server Squid"; -char *msg23 = - "Il file di autorizzazione deve essere intestato al root. Leggere il file README."; -char *msg24 = - "Il file di autorizzazione ha permessi insufficienti (deve essere 755). Leggere il file README."; +char *msg23 = "Il file di autorizzazione deve essere intestato al root. Leggere il file README."; +char *msg24 = "Il file di autorizzazione ha permessi insufficienti (deve essere 755). Leggere il file README."; char *msg25 = "Impossibile aprire il file di autorizzazione."; char *msg26 = "Non sei autorizzato a cambiare la password."; char *msg27 = "Il file di autorizzazione non e' stato trovato."; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Composizione:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" Cambia la Password del server Squid\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("Per ragioni di sicurezza, ricorda queste avvertenze riguardo alla tua password:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Il tuo Account:\n"); - printf(" \n"); - printf("
    La tua Password attuale:\n"); - printf(" \n", maxlen); - printf("
    La nuova Password:\n"); - printf(" \n", maxlen); - printf("
    Riscrivi la nuova Password:\n"); - printf(" \n", maxlen); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Composizione:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Cambia la Password del server Squid\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("Per ragioni di sicurezza, ricorda queste avvertenze riguardo alla tua password:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Il tuo Account:\n"); + printf(" \n"); + printf("
    La tua Password attuale:\n"); + printf(" \n",maxlen); + printf("
    La nuova Password:\n"); + printf(" \n",maxlen); + printf("
    Riscrivi la nuova Password:\n"); + printf(" \n",maxlen); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/Portuguese.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/Portuguese.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/Portuguese.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/Portuguese.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,7 +1,8 @@ /* Portuguses language added by Pedro L Orso */ + #if defined(Portuguese) -char *msg01 = - "Arquivo de senhas sem premissão para gravação:"; + +char *msg01 = "Arquivo de senhas sem premissão para gravação:"; char *msg02 = "Faltou a nova senha ou é muito curta (menor que"; char *msg03 = "caracteres)."; char *msg04 = "Nova senha muito longa (mais que "; @@ -18,117 +19,96 @@ char *msg15 = "Não pode abrir o arquivo de configuracao:"; char *msg16 = "Não pode abrir o arquivo log:"; char *msg17 = "Nova senha inválida."; -char *msg18 = - "Por favor, use as seguintes regras para entrar com a nova senha:"; +char *msg18 = "Por favor, use as seguintes regras para entrar com a nova senha:"; char *msg19 = "Mínimo de letras (a-z, A-Z)"; char *msg20 = "Mínimo de números (0-9)"; char *msg21 = "Mínimo de caracteres especiais (teclado)"; char *msg22 = "Alteração da senha de acesso ao Squid"; -char *msg23 = - "Arquivo de autorização deve pertencer ao root. Por favor leia o README."; -char *msg24 = - "Arquivo de autorização deve ter como atributos 755. Por favor leia o README."; +char *msg23 = "Arquivo de autorização deve pertencer ao root. Por favor leia o README."; +char *msg24 = "Arquivo de autorização deve ter como atributos 755. Por favor leia o README."; char *msg25 = "Não pode abrir o arquivo de autorização."; -char *msg26 = - "Você não tem autorização para alterar a senha."; +char *msg26 = "Você não tem autorização para alterar a senha."; char *msg27 = "Arquivo de autorização não encontrado"; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Composição:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" Alteração de senha do Squid\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("Por medida de segurança, lembre-se das regras abaixo para escolher sua senha:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Usuário: \n"); - printf(" \n"); - printf("
    Senha atual:\n"); - printf(" \n"); - printf("
    Nova senha:\n"); - printf(" \n"); - printf("
    Reentre a nova senha:\n"); - printf(" \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Composição:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Alteração de senha do Squid\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("Por medida de segurança, lembre-se das regras abaixo para escolher sua senha:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Usuário: \n"); + printf(" \n"); + printf("
    Senha atual:\n"); + printf(" \n"); + printf("
    Nova senha:\n"); + printf(" \n"); + printf("
    Reentre a nova senha:\n"); + printf(" \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/Russian.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/Russian.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/Russian.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/Russian.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,131 +1,116 @@ -/* Russian language added by Andrew */ - -#if defined(Russian) -char *msg02 = "îÏ×ÙÊ ÐÁÒÏÌØ ÎÅ ÚÁÄÁÎ ÉÌÉ ÍÅÎÅÅ"; -char *msg03 = "ÓÉÍ×ÏÌÏ×."; -char *msg04 = "îÏ×ÙÊ ÐÁÒÏÌØ ÂÏÌÅÅ"; -char *msg05 = "ðÏÖÁÌÕÊÓÔÁ, ÎÅ ÉÓÐÏÌØÚÕÊÔÅ ÔÏÔ ÖÅ ÓÁÍÙÊ ÐÁÒÏÌØ. ðÁÒÏÌØ ÎÅ ÉÚÍÅÎÅÎ."; -char *msg06 = "îÏ×ÙÊ ÐÁÒÏÌØ É ÐÏÄÔ×ÅÒÖÄÅÎÉÅ ÎÅ ÓÏ×ÐÁÄÁÀÔ."; -char *msg07 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ ÐÁÒÏÌÅÊ:"; -char *msg08 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ×ÒÅÍÅÎÎÙÊ ÆÁÊÌ."; -char *msg09 = "îÅ×ÅÒÎÙÊ ÐÁÒÏÌØ ÐÏÌØÚÏ×ÁÔÅÌÑ:"; -char *msg10 = "ðÁÒÏÌØ ÎÅ ÂÙÌ ÉÚÍÅÎÅÎ."; -char *msg11 = "õÓÐÅÛÎÏ ÉÚÍÅÎÅÎ ÐÁÒÏÌØ ÐÏÌØÚÏ×ÁÔÅÌÑ"; -char *msg12 = ""; -char *msg13 = "ðÏÌØÚÏ×ÁÔÅÌØ:"; -char *msg14 = "ÎÅ ÎÁÊÄÅÎ."; -char *msg15 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ ËÏÎÆÉÇÕÒÁÃÉÉ:"; -char *msg16 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ log-ÆÁÊÌ:"; -char *msg17 = "îÅ×ÅÒÎÙÊ ÎÏ×ÙÊ ÐÁÒÏÌØ."; -char *msg18 = "ðÏÖÁÌÕÊÓÔÁ, ÐÏÌØÚÕÊÔÅÓØ ÓÌÅÄÕÀÝÉÍÉ ÐÒÁ×ÉÌÁÍÉ ÄÌÑ ÉÚÍÅÎÅÎÉÑ ÐÁÒÏÌÑ:"; -char *msg19 = "íÉÎÉÍÁÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÂÕË× (a-z, A-Z)"; -char *msg20 = "íÉÎÉÍÁÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÃÉÆÒ (0-9)"; -char *msg21 = "íÉÎÉÍÁÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÓÐÅÃÓÉÍ×ÏÌÏ× (Ó ËÌÁ×ÉÁÔÕÒÙ)"; -char *msg22 = "éÚÍÅÎÅÎÉÅ ÐÁÒÏÌÑ ÕÞÅÔÎÏÊ ÚÁÐÉÓÉ ÐÒÏËÓÉ ÓÅÒ×ÅÒÁ Squid"; -char *msg23 = "÷ÌÁÄÅÌØÃÅÍ ÆÁÊÌÁ Á×ÔÏÒÉÚÁÃÉÉ ÄÏÌÖÅÔ ÂÙÔØ root. ðÏÖÁÌÕÊÓÔÁ, ÞÉÔÁÊÔÅ README."; -char *msg24 = "íÁÓËÁ ÄÏÓÔÕÐÁ Ë ÆÁÊÌÕ Á×ÔÏÒÉÚÁÃÉÉ ÄÏÌÖÎÁ ÂÙÔØ 755. ðÏÖÁÌÕÊÓÔÁ, ÞÉÔÁÊÔÅ README."; -char *msg25 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ Á×ÔÏÒÉÚÁÃÉÉ."; -char *msg26 = "õ ÷ÁÓ ÎÅÔ ÐÒÁ× ÄÌÑ ÉÚÍÅÎÅÎÉÑ ÐÁÒÏÌÑ."; -char *msg27 = "æÁÊÌ Á×ÔÏÒÉÚÁÃÉÉ ÎÅ ÎÁÊÄÅÎ."; - -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) -{ - - char rules[255] = "
  • ïÇÒÁÎÉÞÅÎÉÅ ÎÁ ÓÉÍ×ÏÌÙ:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf(" éÚÍÅÎÅÎÉÅ ÐÁÒÏÌÑ ÄÏÓÔÕÐÁ Ë Squid\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("éÚ ÓÏÏÂÒÁÖÅÎÉÊ ÂÅÚÏÐÁÓÎÏÓÔÉ, ÚÁÐÏÍÎÉÔÅ ÓÌÅÄÕÀÝÉÅ ÐÒÁ×ÉÌÁ ÉÚÍÅÎÅÎÉÑ ÐÁÒÏÌÑ:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    éÍÑ ÷ÁÛÅÊ ÕÞÅÔÎÏÊ ÚÁÐÉÓÉ\n"); - printf(" \n"); - printf("
    ÷ÁÛ ÔÅËÕÛÉÊ ÐÁÒÏÌØ:\n"); - printf(" \n", maxlen); - printf("
    îÏ×ÙÊ ÐÁÒÏÌØ:\n"); - printf(" \n", maxlen); - printf("
    ðÏÄÔ×ÅÒÄÉÔÅ ÎÏ×ÙÊ ÐÁÒÏÌØ:\n"); - printf(" \n", maxlen); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); - - fflush(stdout); - return; - -} -#endif +/* Russian language added by Andrew */ + +#if defined(Russian) + +char *msg01 = "îÅÔ ÐÒÁ× ÄÌÑ ÚÁÐÉÓÉ × ÆÁÊÌ ÐÁÒÏÌÅÊ:"; +char *msg02 = "îÏ×ÙÊ ÐÁÒÏÌØ ÎÅ ÚÁÄÁÎ ÉÌÉ ÍÅÎÅÅ"; +char *msg03 = "ÓÉÍ×ÏÌÏ×."; +char *msg04 = "îÏ×ÙÊ ÐÁÒÏÌØ ÂÏÌÅÅ"; +char *msg05 = "ðÏÖÁÌÕÊÓÔÁ, ÎÅ ÉÓÐÏÌØÚÕÊÔÅ ÔÏÔ ÖÅ ÓÁÍÙÊ ÐÁÒÏÌØ. ðÁÒÏÌØ ÎÅ ÉÚÍÅÎÅÎ."; +char *msg06 = "îÏ×ÙÊ ÐÁÒÏÌØ É ÐÏÄÔ×ÅÒÖÄÅÎÉÅ ÎÅ ÓÏ×ÐÁÄÁÀÔ."; +char *msg07 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ ÐÁÒÏÌÅÊ:"; +char *msg08 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ×ÒÅÍÅÎÎÙÊ ÆÁÊÌ."; +char *msg09 = "îÅ×ÅÒÎÙÊ ÐÁÒÏÌØ ÐÏÌØÚÏ×ÁÔÅÌÑ:"; +char *msg10 = "ðÁÒÏÌØ ÎÅ ÂÙÌ ÉÚÍÅÎÅÎ."; +char *msg11 = "õÓÐÅÛÎÏ ÉÚÍÅÎÅÎ ÐÁÒÏÌØ ÐÏÌØÚÏ×ÁÔÅÌÑ"; +char *msg12 = ""; +char *msg13 = "ðÏÌØÚÏ×ÁÔÅÌØ:"; +char *msg14 = "ÎÅ ÎÁÊÄÅÎ."; +char *msg15 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ ËÏÎÆÉÇÕÒÁÃÉÉ:"; +char *msg16 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ log-ÆÁÊÌ:"; +char *msg17 = "îÅ×ÅÒÎÙÊ ÎÏ×ÙÊ ÐÁÒÏÌØ."; +char *msg18 = "ðÏÖÁÌÕÊÓÔÁ, ÐÏÌØÚÕÊÔÅÓØ ÓÌÅÄÕÀÝÉÍÉ ÐÒÁ×ÉÌÁÍÉ ÄÌÑ ÉÚÍÅÎÅÎÉÑ ÐÁÒÏÌÑ:"; +char *msg19 = "íÉÎÉÍÁÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÂÕË× (a-z, A-Z)"; +char *msg20 = "íÉÎÉÍÁÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÃÉÆÒ (0-9)"; +char *msg21 = "íÉÎÉÍÁÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÓÐÅÃÓÉÍ×ÏÌÏ× (Ó ËÌÁ×ÉÁÔÕÒÙ)"; +char *msg22 = "éÚÍÅÎÅÎÉÅ ÐÁÒÏÌÑ ÕÞÅÔÎÏÊ ÚÁÐÉÓÉ ÐÒÏËÓÉ ÓÅÒ×ÅÒÁ Squid"; +char *msg23 = "÷ÌÁÄÅÌØÃÅÍ ÆÁÊÌÁ Á×ÔÏÒÉÚÁÃÉÉ ÄÏÌÖÅÔ ÂÙÔØ root. ðÏÖÁÌÕÊÓÔÁ, ÞÉÔÁÊÔÅ README."; +char *msg24 = "íÁÓËÁ ÄÏÓÔÕÐÁ Ë ÆÁÊÌÕ Á×ÔÏÒÉÚÁÃÉÉ ÄÏÌÖÎÁ ÂÙÔØ 755. ðÏÖÁÌÕÊÓÔÁ, ÞÉÔÁÊÔÅ README."; +char *msg25 = "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ Á×ÔÏÒÉÚÁÃÉÉ."; +char *msg26 = "õ ÷ÁÓ ÎÅÔ ÐÒÁ× ÄÌÑ ÉÚÍÅÎÅÎÉÑ ÐÁÒÏÌÑ."; +char *msg27 = "æÁÊÌ Á×ÔÏÒÉÚÁÃÉÉ ÎÅ ÎÁÊÄÅÎ."; + +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) +{ + + char rules[255] = "
  • ïÇÒÁÎÉÞÅÎÉÅ ÎÁ ÓÉÍ×ÏÌÙ:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" éÚÍÅÎÅÎÉÅ ÐÁÒÏÌÑ ÄÏÓÔÕÐÁ Ë Squid\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("éÚ ÓÏÏÂÒÁÖÅÎÉÊ ÂÅÚÏÐÁÓÎÏÓÔÉ, ÚÁÐÏÍÎÉÔÅ ÓÌÅÄÕÀÝÉÅ ÐÒÁ×ÉÌÁ ÉÚÍÅÎÅÎÉÑ ÐÁÒÏÌÑ:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    éÍÑ ÷ÁÛÅÊ ÕÞÅÔÎÏÊ ÚÁÐÉÓÉ\n"); + printf(" \n"); + printf("
    ÷ÁÛ ÔÅËÕÛÉÊ ÐÁÒÏÌØ:\n"); + printf(" \n",maxlen); + printf("
    îÏ×ÙÊ ÐÁÒÏÌØ:\n"); + printf(" \n",maxlen); + printf("
    ðÏÄÔ×ÅÒÄÉÔÅ ÎÏ×ÙÊ ÐÁÒÏÌØ:\n"); + printf(" \n",maxlen); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); + + fflush(stdout); + return; + +} +#endif Index: squid/contrib/chpasswd/Spanish.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/Spanish.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/Spanish.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/Spanish.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,13 +1,12 @@ /* Spanish language added by Horacio Diaz Requejo */ + #if defined(Spanish) -char *msg01 = - "El archivo de contraseñas no tiene permisos para ser modificado:"; -char *msg02 = - "La nueva contraseña es muy pequeña (tiene menos de"; + +char *msg01 = "El archivo de contraseñas no tiene permisos para ser modificado:"; +char *msg02 = "La nueva contraseña es muy pequeña (tiene menos de"; char *msg03 = "caracteres)."; char *msg04 = "La nueva contraseña es muy grande (tiene mas de"; -char *msg05 = - "Porfavor, no use la misma contraseña que tenia anteriormente"; +char *msg05 = "Porfavor, no use la misma contraseña que tenia anteriormente"; char *msg06 = "La nueva contraseña no coincide en ambos campos."; char *msg07 = "No pudo abrir el archivo de contraseñas:"; char *msg08 = "No se pudo crear un archivo temporal."; @@ -20,122 +19,98 @@ char *msg15 = "No pudo abrir el archivo de configuración:"; char *msg16 = "No se pudo abrir el archivo de logs:"; char *msg17 = "La nueva contrasena es inválida."; -char *msg18 = - "Porfavor, utilize las siguientes reglas para contruir su nueva contraseña:"; +char *msg18 = "Porfavor, utilize las siguientes reglas para contruir su nueva contraseña:"; char *msg19 = "Utilize cualquiera de los siguientes caracteres (a-z, A-Z)"; char *msg20 = "Utilize números (0-9)"; char *msg21 = "Utilize caracteres especiales (/,-,$,%,^,etc)"; char *msg22 = "Cambiando la contraseña de navegación en Internet"; -char *msg23 = - "El archivo de autorización debe pertenecer a root. Porfavor lea el README."; -char *msg24 = - "Los permisos del archivo de autorización son incorrectos (deben ser 755). Porfavor lea el README."; +char *msg23 = "El archivo de autorización debe pertenecer a root. Porfavor lea el README."; +char *msg24 = "Los permisos del archivo de autorización son incorrectos (deben ser 755). Porfavor lea el README."; char *msg25 = "No se pudo abrir el archivo de autorización."; char *msg26 = "Usted no esta autorizado a cambiar contraseñas."; char *msg27 = "No se encontro el archivo de autorización."; -static void -UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, - char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, - char *width, char *height, char *header, char *bgimage) +static void UserForm(char *minlen, char *maxlen, char *minchar, char *minnum, char *minspec, char *bgcolor, char *txcolor, char *ticolor, char *rucolor, char *logo, char *width, char *height, char *header, char *bgimage) { - char rules[255] = "
  • Sintaxis del password:"; - char wrules[255]; - int frules = 0; - - printf("Content-type: text/html\n"); - puts("\n"); - printf("\n"); - printf("\n"); - printf - (" Cambio de contraseña para navegar en internet\n"); - printf("\n"); - printf("\n", bgcolor, txcolor, - bgimage); - - if (strlen(logo) > 0) - printf - ("

    %s

    \n", - logo, width, height, ticolor, header); - else - printf("

    %s

    \n", ticolor, header); - - printf - ("Por razones de seguridad, recuerde utilizar las siguientes reglas al momento de elegir su nueva contraseña:\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("
    \n"); - printf("\n"); - printf("
    Cuenta de acceso a Internet:\n"); - printf(" \n"); - printf("
    Su contraseña actual:\n"); - printf(" \n", maxlen); - printf("
    Su nueva contraseña:\n"); - printf(" \n", maxlen); - printf("
    Reescriba su nueva contraseña:\n"); - printf(" \n", maxlen); - printf("
    \n"); - printf("
    \n"); - printf - ("\n"); - printf("\n"); - printf("\n"); - printf("
    \n"); - printf("
    \n"); - printf("%s-%s\n", URL, PGM, VERSION); - printf("\n"); - printf("\n"); + char rules[255] = "
  • Sintaxis del password:"; + char wrules[255]; + int frules=0; + + printf("Content-type: text/html\n"); + puts("\n"); + printf("\n"); + printf("\n"); + printf(" Cambio de contraseña para navegar en internet\n"); + printf("\n"); + printf("\n",bgcolor,txcolor,bgimage); + + if(strlen(logo) > 0) + printf("

    %s

    \n",logo,width,height,ticolor,header); + else + printf("

    %s

    \n",ticolor,header); + + printf("Por razones de seguridad, recuerde utilizar las siguientes reglas al momento de elegir su nueva contraseña:\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("
    Cuenta de acceso a Internet:\n"); + printf(" \n"); + printf("
    Su contraseña actual:\n"); + printf(" \n",maxlen); + printf("
    Su nueva contraseña:\n"); + printf(" \n",maxlen); + printf("
    Reescriba su nueva contraseña:\n"); + printf(" \n",maxlen); + printf("
    \n"); + printf("
    \n"); + printf("\n"); + printf("\n"); + printf("\n"); + printf("
    \n"); + printf("
    \n"); + printf("%s-%s\n",URL,PGM,VERSION); + printf("\n"); + printf("\n"); - fflush(stdout); - return; + fflush(stdout); + return; } #endif Index: squid/contrib/chpasswd/chpasswd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/chpasswd.c,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/chpasswd.c 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/chpasswd.c 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -10,105 +10,98 @@ #define MAXLEN 1024 #define hhex(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'a' && (x) <= 'f') || \ ((x) >= 'A' && (x) <= 'F')) -char *tn; +char *tn; static void fixpwd(str); -static int htoi(s); -void getconf(ConfigFile, IpAuth, PwdFile, PwdMinLen, PwdMaxLen, PwdLogFile, - BgColor, TxColor, TiColor, RuColor, Logo, Width, Height, Header, BgImage, - SmtpUser, SmtpSubject); -static void vrfyrule(unsigned char *, unsigned char *, unsigned char *, - unsigned char *); -static void vrfyauth(IpAuth, PwdLogFile, PwdFile, SmtpUser, SmtpSubject); +static int htoi(s); +void getconf(ConfigFile,IpAuth,PwdFile,PwdMinLen,PwdMaxLen,PwdLogFile,BgColor,TxColor,TiColor,RuColor,Logo,Width,Height,Header,BgImage,SmtpUser,SmtpSubject); +static void vrfyrule(unsigned char *, unsigned char *, unsigned char *, unsigned char *); +static void vrfyauth(IpAuth,PwdLogFile,PwdFile,SmtpUser,SmtpSubject); eperror(s); -void -main(argc, argv) - int argc; - char *argv[]; -{ - - FILE *fpw, *tmp; - char buf[MAXLEN]; - char User[255]; - char PUser[255]; - char WUser[255]; - char Old_pw[255]; - char WOld_pw[255]; - char New_pw1[255]; - char New_pw2[255]; - char Action[255]; - char Msg[MAXLEN]; - char command[255]; - char PwdFile[MAXLEN] = "c:\\squid23\\etc\\passwd"; - char IpAuth[MAXLEN] = ""; - char PwdMinLen[255] = "4"; - char PwdMaxLen[255] = "10"; - char ShowPwd[255] = "no"; - char PwdMinChar[255] = "0"; - char PwdMinNum[255] = "0"; - char PwdMinSpec[255] = "0"; - char BgColor[255] = "white"; - char TiColor[255] = "green"; - char TxColor[255] = "blue"; - char RuColor[255] = "red"; - char Logo[MAXLEN] = ""; - char Width[MAXLEN] = "80"; - char Height[MAXLEN] = "80"; - char Header[MAXLEN]; - char BgImage[MAXLEN] = ""; - char SmtpUser[MAXLEN] = ""; - char SmtpSubject[MAXLEN] = "CHPASSWD EVENT"; - char InputBuffer[1024]; - char ConfigFile[255]; - char PwdLogFile[255]; - char *pContentLength; - char *str; - char *cpw, salt[3]; - int ContentLength; - int i; - int x, ok = 0; +void main(argc, argv) + int argc; + char *argv[]; +{ + + FILE *fpw, + *tmp; + char buf[MAXLEN]; + char User[255]; + char PUser[255]; + char WUser[255]; + char Old_pw[255]; + char WOld_pw[255]; + char New_pw1[255]; + char New_pw2[255]; + char Action[255]; + char Msg[MAXLEN]; + char command[255]; + char PwdFile[MAXLEN]="c:\\squid23\\etc\\passwd"; + char IpAuth[MAXLEN]=""; + char PwdMinLen[255]="4"; + char PwdMaxLen[255]="10"; + char ShowPwd[255]="no"; + char PwdMinChar[255]="0"; + char PwdMinNum[255]="0"; + char PwdMinSpec[255]="0"; + char BgColor[255]="white"; + char TiColor[255]="green"; + char TxColor[255]="blue"; + char RuColor[255]="red"; + char Logo[MAXLEN]=""; + char Width[MAXLEN]="80"; + char Height[MAXLEN]="80"; + char Header[MAXLEN]; + char BgImage[MAXLEN]=""; + char SmtpUser[MAXLEN]=""; + char SmtpSubject[MAXLEN]="CHPASSWD EVENT"; + char InputBuffer[1024]; + char ConfigFile[255]; + char PwdLogFile[255]; + char *pContentLength; + char *str; + char *cpw, + salt[3]; + int ContentLength; + int i; + int x, + ok = 0; tn = NULL; fpw = NULL; tmp = NULL; - buf[0] = '\0'; - User[0] = '\0'; - PUser[0] = '\0'; - WUser[0] = '\0'; - Old_pw[0] = '\0'; - WOld_pw[0] = '\0'; - New_pw1[0] = '\0'; - New_pw2[0] = '\0'; - Action[0] = '\0'; - Msg[0] = '\0'; - command[0] = '\0'; - PwdLogFile[0] = '\0'; - strcpy(Header, msg22); + buf[0]='\0'; + User[0]='\0'; + PUser[0]='\0'; + WUser[0]='\0'; + Old_pw[0]='\0'; + WOld_pw[0]='\0'; + New_pw1[0]='\0'; + New_pw2[0]='\0'; + Action[0]='\0'; + Msg[0]='\0'; + command[0]='\0'; + PwdLogFile[0]='\0'; + strcpy(Header,msg22); - sprintf(ConfigFile, "%s\\chpasswd.conf", "c:\\squid23\\etc"); + sprintf(ConfigFile,"%s\\chpasswd.conf","c:\\squid23\\etc"); if (access(ConfigFile, R_OK) == 0) - getconf(ConfigFile, IpAuth, PwdFile, PwdMinLen, PwdMaxLen, PwdMinChar, - PwdMinNum, PwdMinSpec, PwdLogFile, ShowPwd, BgColor, TxColor, - TiColor, RuColor, Logo, Width, Height, Header, BgImage, SmtpUser, - SmtpSubject); - - if (strlen(IpAuth) > 0) { - if (access(IpAuth, R_OK) != 0) { - Hmsg(msg27); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, "-", "", "no", msg27, PwdFile, SmtpUser, - SmtpSubject); - exit(1); - } - vrfyauth(IpAuth, PwdLogFile, PwdFile, SmtpUser, SmtpSubject); + getconf(ConfigFile,IpAuth,PwdFile,PwdMinLen,PwdMaxLen,PwdMinChar,PwdMinNum,PwdMinSpec,PwdLogFile,ShowPwd,BgColor,TxColor,TiColor,RuColor,Logo,Width,Height,Header,BgImage,SmtpUser,SmtpSubject); + + if (strlen(IpAuth) > 0 ) { + if (access(IpAuth, R_OK) != 0) { + Hmsg(msg27); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,"-","","no",msg27,PwdFile,SmtpUser,SmtpSubject); + exit(1); + } + vrfyauth(IpAuth,PwdLogFile,PwdFile,SmtpUser,SmtpSubject); } if (strcmp(getenv("REQUEST_METHOD"), "GET") == 0) { - UserForm(PwdMinLen, PwdMaxLen, PwdMinChar, PwdMinNum, PwdMinSpec, - BgColor, TxColor, TiColor, RuColor, Logo, Width, Height, Header, - BgImage); + UserForm(PwdMinLen,PwdMaxLen,PwdMinChar,PwdMinNum,PwdMinSpec,BgColor,TxColor,TiColor,RuColor,Logo,Width,Height,Header,BgImage); return; } @@ -144,79 +137,74 @@ getword(New_pw2, InputBuffer, '&'); getword(Action, InputBuffer, '='); - if (atoi(PwdMinChar) || atoi(PwdMinNum) || atoi(PwdMinSpec)) - vrfyrule(New_pw1, PwdMinChar, PwdMinNum, PwdMinSpec); + if(atoi(PwdMinChar) || atoi(PwdMinNum) || atoi(PwdMinSpec)) + vrfyrule(New_pw1,PwdMinChar,PwdMinNum,PwdMinSpec); fixpwd(Old_pw); if (strcmp(Action, "change") == 0) { - if (strlen(New_pw1) < atoi(PwdMinLen)) { - sprintf(Msg, "%s %s %s", msg02, PwdMinLen, msg03); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, User, New_pw1, ShowPwd, Msg, PwdFile, SmtpUser, - SmtpSubject); + if (strlen(New_pw1) < atoi(PwdMinLen)) { + sprintf(Msg, "%s %s %s",msg02, PwdMinLen, msg03); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject); Herror(Msg, fpw, tmp); return; - } + } if (strlen(New_pw1) > atoi(PwdMaxLen)) { - sprintf(Msg, "%s %s %s", msg04, PwdMaxLen, msg03); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, User, New_pw1, ShowPwd, Msg, PwdFile, SmtpUser, - SmtpSubject); + sprintf(Msg, "%s %s %s",msg04, PwdMaxLen, msg03); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject); Herror(Msg, fpw, tmp); return; } if (strcmp(Old_pw, New_pw1) == 0) { - sprintf(Msg, "%s", msg05); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, User, New_pw1, ShowPwd, Msg, PwdFile, SmtpUser, - SmtpSubject); + sprintf(Msg, "%s",msg05); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject); Herror(Msg, fpw, tmp); return; } if (strcmp(New_pw1, New_pw2) != 0) { - sprintf(Msg, "%s", msg06); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, User, New_pw1, ShowPwd, Msg, PwdFile, SmtpUser, - SmtpSubject); + sprintf(Msg, "%s",msg06); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject); Herror(Msg, fpw, tmp); return; } if ((fpw = fopen(PwdFile, "r")) == NULL) { - sprintf(Msg, "%s %s", msg07, PwdFile); + sprintf(Msg, "%s %s",msg07, PwdFile); Herror(Msg, fpw, tmp); return; } tn = tmpnam(NULL); if ((tmp = fopen(tn, "w")) == NULL) { - sprintf(Msg, "%s", msg08); + sprintf(Msg, "%s",msg08); Herror(Msg, fpw, tmp); return; } while (fgets(buf, MAXLEN, fpw) != NULL) { if (!ok) { - strcpy(PUser, User); - strcat(PUser, ":"); + strcpy(PUser,User); + strcat(PUser,":"); - if ((str = (char *) strstr(buf, PUser)) != (char *) NULL) { + if ((str = (char *) strstr(buf, PUser)) != (char *) NULL ) { getword(WUser, buf, ':'); getword(WOld_pw, buf, '\n'); if (strcmp(WOld_pw, crypt(Old_pw, WOld_pw)) != 0) { - sprintf(Msg, "%s %s", msg09, User); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, User, New_pw1, ShowPwd, Msg, - PwdFile, SmtpUser, SmtpSubject); + sprintf(Msg, "%s %s",msg09, User); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject); Herror(Msg, fpw, tmp); return; } - fixpwd(New_pw1); + fixpwd(New_pw1); (void) srand((int) time((time_t *) NULL)); to64(&salt[0], rand(), 2); - cpw = crypt(New_pw1, salt); + cpw = crypt(New_pw1, salt); sprintf(buf, "%s:%s\n", User, cpw); ok++; @@ -233,19 +221,16 @@ unlink(tn); if (ok) - Changed(User, PwdLogFile, New_pw1, ShowPwd, PwdFile, SmtpUser, - SmtpSubject); + Changed(User, PwdLogFile, New_pw1, ShowPwd, PwdFile, SmtpUser, SmtpSubject); else - NotFound(User, PwdLogFile, New_pw1, ShowPwd, PwdFile, SmtpUser, - SmtpSubject); + NotFound(User, PwdLogFile, New_pw1, ShowPwd, PwdFile, SmtpUser, SmtpSubject); } else { - if (strcmp(Action, "cancel") == 0) { - sprintf(Msg, "%s", msg10); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, User, New_pw1, ShowPwd, Msg, PwdFile, SmtpUser, - SmtpSubject); - Herror(Msg, fpw, tmp); - return; + if (strcmp(Action, "cancel") == 0) { + sprintf(Msg, "%s",msg10); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,User,New_pw1,ShowPwd,Msg,PwdFile,SmtpUser,SmtpSubject); + Herror(Msg, fpw, tmp); + return; } } return; @@ -255,7 +240,8 @@ void getword(char *word, char *line, char stop) { - int x = 0, y; + int x = 0, + y; for (x = 0; ((line[x]) && (line[x] != stop)); x++) word[x] = line[x]; @@ -300,7 +286,7 @@ void putline(FILE * f, char *l) { - int x; + int x; for (x = 0; l[x]; x++) fputc(l[x], f); @@ -311,13 +297,12 @@ static unsigned char itoa64[] = /* * 0 ... 63 => ascii - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -void -to64(s, v, n) - register char *s; - register long v; - register int n; +void to64(s, v, n) + register char *s; + register long v; + register int n; { while (--n >= 0) { *s++ = itoa64[v & 0x3f]; @@ -327,8 +312,7 @@ void -Changed(char *user, char *PwdLogFile, char *newpwd, char *showpwd, - char *PwdFile, char *SmtpUser, char *SmtpSubject) +Changed(char *user, char *PwdLogFile, char *newpwd, char *showpwd, char *PwdFile, char *SmtpUser, char *SmtpSubject) { char Msg[MAXLEN]; @@ -336,11 +320,10 @@ puts("\n"); printf("\n"); printf(""); - sprintf(Msg, "%s %s %s", msg11, user, msg12); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, user, newpwd, showpwd, Msg, PwdFile, SmtpUser, - SmtpSubject); - strcat(Msg, ""); + sprintf(Msg, "%s %s %s",msg11, user, msg12); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,user,newpwd,showpwd,Msg,PwdFile,SmtpUser,SmtpSubject); + strcat(Msg,""); printf(Msg); return; @@ -348,8 +331,7 @@ void -NotFound(char *user, char *PwdLogFile, char *newpwd, char *showpwd, - char *PwdFile, char *SmtpUser, char *SmtpSubject) +NotFound(char *user, char *PwdLogFile, char *newpwd, char *showpwd, char *PwdFile, char *SmtpUser, char *SmtpSubject) { char Msg[MAXLEN]; @@ -357,314 +339,309 @@ puts("\n"); printf("\n"); printf(""); - sprintf(Msg, "%s %s %s", msg13, user, msg14); + sprintf(Msg, "%s %s %s",msg13, user, msg14); printf(Msg); printf("\n"); - - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, user, newpwd, showpwd, Msg, PwdFile, SmtpUser, - SmtpSubject); + + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,user,newpwd,showpwd,Msg,PwdFile,SmtpUser,SmtpSubject); return; } static void fixpwd(str) - unsigned char *str; + unsigned char *str; { - unsigned char *dest = str; + unsigned char *dest = str; - while (str[0]) { - if (str[0] == '+') - dest[0] = ' '; - else if (str[0] == '%' && hhex(str[1]) && hhex(str[2])) { - dest[0] = (unsigned char) htoi(str + 1); - str += 2; - } else - dest[0] = str[0]; + while (str[0]) + { + if (str[0] == '+') + dest[0] = ' '; + else if (str[0] == '%' && hhex(str[1]) && hhex(str[2])) + { + dest[0] = (unsigned char) htoi(str + 1); + str += 2; + } + else + dest[0] = str[0]; + + str++; + dest++; + } - str++; - dest++; - } - - dest[0] = '\0'; - return; + dest[0] = '\0'; + return; } static int htoi(s) - unsigned char *s; + unsigned char *s; { - int value; - char c; - - c = s[0]; - if (isupper(c)) - c = tolower(c); - value = (c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10) * 16; - - c = s[1]; - if (isupper(c)) - c = tolower(c); - value += c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10; + int value; + char c; - return (value); + c = s[0]; + if (isupper(c)) + c = tolower(c); + value = (c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10) * 16; + + c = s[1]; + if (isupper(c)) + c = tolower(c); + value += c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10; + + return (value); } -void -getconf(ConfigFile, IpAuth, PwdFile, PwdMinLen, PwdMaxLen, PwdMinChar, - PwdMinNum, PwdMinSpec, PwdLogFile, ShowPwd, BgColor, TxColor, TiColor, - RuColor, Logo, Width, Height, Header, BgImage, SmtpUser, SmtpSubject) - unsigned char *ConfigFile; - unsigned char *PwdFile; - unsigned char *IpAuth; - unsigned char *PwdLogFile; - unsigned char *ShowPwd; - unsigned char *PwdMinLen; - unsigned char *PwdMaxLen; - unsigned char *PwdMinChar; - unsigned char *PwdMinNum; - unsigned char *PwdMinSpec; - unsigned char *BgColor; - unsigned char *TxColor; - unsigned char *TiColor; - unsigned char *RuColor; - unsigned char *Logo; - unsigned char *Width; - unsigned char *Height; - unsigned char *Header; - unsigned char *BgImage; - unsigned char *SmtpUser; - unsigned char *SmtpSubject; -{ - - FILE *fp_in; - char buf[255]; - char wbuf[255]; - char Msg[255]; - char *str; - - if ((fp_in = fopen(ConfigFile, "r")) == NULL) { - sprintf(Msg, "%s %s", msg15, ConfigFile); - Hmsg(Msg); - exit(1); - } - - while (fgets(buf, MAXLEN, fp_in) != NULL) { - if ((str = (char *) strstr(buf, "#")) != (char *) NULL) - continue; - - if (strstr(buf, "password_file") != 0) { - getword(wbuf, buf, ' '); - getword(PwdFile, buf, ' '); - PwdFile[strlen(PwdFile) - 1] = '\0'; - } - - if (strstr(buf, "ip_auth") != 0) { - getword(wbuf, buf, ' '); - getword(IpAuth, buf, ' '); - IpAuth[strlen(IpAuth) - 1] = '\0'; - } - - if (strstr(buf, "minimum_length") != 0) { - getword(wbuf, buf, ' '); - getword(PwdMinLen, buf, ' '); - PwdMinLen[strlen(PwdMinLen) - 1] = '\0'; - } - - if (strstr(buf, "maximum_length") != 0) { - getword(wbuf, buf, ' '); - getword(PwdMaxLen, buf, ' '); - PwdMaxLen[strlen(PwdMaxLen) - 1] = '\0'; - } - - if (strstr(buf, "minimum_char") != 0) { - getword(wbuf, buf, ' '); - getword(PwdMinChar, buf, ' '); - PwdMinChar[strlen(PwdMinChar) - 1] = '\0'; - } - - if (strstr(buf, "minimum_num") != 0) { - getword(wbuf, buf, ' '); - getword(PwdMinNum, buf, ' '); - PwdMinNum[strlen(PwdMinNum) - 1] = '\0'; - } - - if (strstr(buf, "minimum_spec") != 0) { - getword(wbuf, buf, ' '); - getword(PwdMinSpec, buf, ' '); - PwdMinSpec[strlen(PwdMinSpec) - 1] = '\0'; - } - - if (strstr(buf, "enable_log") != 0) { - getword(wbuf, buf, ' '); - getword(PwdLogFile, buf, '\0'); - PwdLogFile[strlen(PwdLogFile) - 1] = '\0'; - } - - if (strstr(buf, "show_pwd") != 0) { - getword(wbuf, buf, ' '); - getword(ShowPwd, buf, '\0'); - ShowPwd[strlen(ShowPwd) - 1] = '\0'; - } - - if (strstr(buf, "background_color") != 0) { - getword(wbuf, buf, ' '); - getword(BgColor, buf, '\0'); - BgColor[strlen(BgColor) - 1] = '\0'; - } - - if (strstr(buf, "text_color") != 0) { - getword(wbuf, buf, ' '); - getword(TxColor, buf, '\0'); - TxColor[strlen(TxColor) - 1] = '\0'; - } - - if (strstr(buf, "title_color") != 0) { - getword(wbuf, buf, ' '); - getword(TiColor, buf, '\0'); - TiColor[strlen(TiColor) - 1] = '\0'; - } - - if (strstr(buf, "rules_color") != 0) { - getword(wbuf, buf, ' '); - getword(RuColor, buf, '\0'); - RuColor[strlen(RuColor) - 1] = '\0'; - } - - if (strstr(buf, "logo_image") != 0) { - getword(wbuf, buf, ' '); - getword(Logo, buf, '\0'); - Logo[strlen(Logo) - 1] = '\0'; - } - - if (strstr(buf, "background_image") != 0) { - getword(wbuf, buf, ' '); - getword(BgImage, buf, '\0'); - BgImage[strlen(BgImage) - 1] = '\0'; - } - - if (strstr(buf, "alert_mail_user") != 0) { - getword(wbuf, buf, ' '); - getword(SmtpUser, buf, '\0'); - SmtpUser[strlen(SmtpUser) - 1] = '\0'; - } - - if (strstr(buf, "alert_mail_subject") != 0) { - getword(wbuf, buf, '"'); - getword(SmtpSubject, buf, '"'); +void getconf(ConfigFile, IpAuth, PwdFile, PwdMinLen, PwdMaxLen, PwdMinChar, PwdMinNum, PwdMinSpec, PwdLogFile, ShowPwd, BgColor, TxColor, TiColor, RuColor, Logo, Width, Height, Header, BgImage, SmtpUser, SmtpSubject) + unsigned char *ConfigFile; + unsigned char *PwdFile; + unsigned char *IpAuth; + unsigned char *PwdLogFile; + unsigned char *ShowPwd; + unsigned char *PwdMinLen; + unsigned char *PwdMaxLen; + unsigned char *PwdMinChar; + unsigned char *PwdMinNum; + unsigned char *PwdMinSpec; + unsigned char *BgColor; + unsigned char *TxColor; + unsigned char *TiColor; + unsigned char *RuColor; + unsigned char *Logo; + unsigned char *Width; + unsigned char *Height; + unsigned char *Header; + unsigned char *BgImage; + unsigned char *SmtpUser; + unsigned char *SmtpSubject; +{ + + FILE *fp_in; + char buf[255]; + char wbuf[255]; + char Msg[255]; + char *str; + + if ((fp_in = fopen(ConfigFile, "r")) == NULL) { + sprintf(Msg, "%s %s", msg15, ConfigFile); + Hmsg(Msg); + exit(1); } - if (strstr(buf, "image_size") != 0) { - getword(wbuf, buf, ' '); - getword(Width, buf, ' '); - getword(Height, buf, '\0'); - Height[strlen(Height) - 1] = '\0'; - } + while (fgets(buf, MAXLEN, fp_in) != NULL) { + if((str=(char *) strstr(buf,"#")) != (char *) NULL) + continue; + + if(strstr(buf,"password_file") != 0) { + getword(wbuf,buf,' '); + getword(PwdFile,buf,' '); + PwdFile[strlen(PwdFile)-1]='\0'; + } + + if(strstr(buf,"ip_auth") != 0) { + getword(wbuf,buf,' '); + getword(IpAuth,buf,' '); + IpAuth[strlen(IpAuth)-1]='\0'; + } + + if(strstr(buf,"minimum_length") != 0) { + getword(wbuf,buf,' '); + getword(PwdMinLen,buf,' '); + PwdMinLen[strlen(PwdMinLen)-1]='\0'; + } + + if(strstr(buf,"maximum_length") != 0) { + getword(wbuf,buf,' '); + getword(PwdMaxLen,buf,' '); + PwdMaxLen[strlen(PwdMaxLen)-1]='\0'; + } + + if(strstr(buf,"minimum_char") != 0) { + getword(wbuf,buf,' '); + getword(PwdMinChar,buf,' '); + PwdMinChar[strlen(PwdMinChar)-1]='\0'; + } + + if(strstr(buf,"minimum_num") != 0) { + getword(wbuf,buf,' '); + getword(PwdMinNum,buf,' '); + PwdMinNum[strlen(PwdMinNum)-1]='\0'; + } + + if(strstr(buf,"minimum_spec") != 0) { + getword(wbuf,buf,' '); + getword(PwdMinSpec,buf,' '); + PwdMinSpec[strlen(PwdMinSpec)-1]='\0'; + } + + if(strstr(buf,"enable_log") != 0) { + getword(wbuf,buf,' '); + getword(PwdLogFile,buf,'\0'); + PwdLogFile[strlen(PwdLogFile)-1]='\0'; + } + + if(strstr(buf,"show_pwd") != 0) { + getword(wbuf,buf,' '); + getword(ShowPwd,buf,'\0'); + ShowPwd[strlen(ShowPwd)-1]='\0'; + } + + if(strstr(buf,"background_color") != 0) { + getword(wbuf,buf,' '); + getword(BgColor,buf,'\0'); + BgColor[strlen(BgColor)-1]='\0'; + } + + if(strstr(buf,"text_color") != 0) { + getword(wbuf,buf,' '); + getword(TxColor,buf,'\0'); + TxColor[strlen(TxColor)-1]='\0'; + } + + if(strstr(buf,"title_color") != 0) { + getword(wbuf,buf,' '); + getword(TiColor,buf,'\0'); + TiColor[strlen(TiColor)-1]='\0'; + } + + if(strstr(buf,"rules_color") != 0) { + getword(wbuf,buf,' '); + getword(RuColor,buf,'\0'); + RuColor[strlen(RuColor)-1]='\0'; + } + + if(strstr(buf,"logo_image") != 0) { + getword(wbuf,buf,' '); + getword(Logo,buf,'\0'); + Logo[strlen(Logo)-1]='\0'; + } + + if(strstr(buf,"background_image") != 0) { + getword(wbuf,buf,' '); + getword(BgImage,buf,'\0'); + BgImage[strlen(BgImage)-1]='\0'; + } + + if(strstr(buf,"alert_mail_user") != 0) { + getword(wbuf,buf,' '); + getword(SmtpUser,buf,'\0'); + SmtpUser[strlen(SmtpUser)-1]='\0'; + } + + if(strstr(buf,"alert_mail_subject") != 0) { + getword(wbuf,buf,'"'); + getword(SmtpSubject,buf,'"'); + } + + if(strstr(buf,"image_size") != 0) { + getword(wbuf,buf,' '); + getword(Width,buf,' '); + getword(Height,buf,'\0'); + Height[strlen(Height)-1]='\0'; + } + + if(strstr(buf,"header") != 0) { + getword(wbuf,buf,'"'); + getword(Header,buf,'"'); + } - if (strstr(buf, "header") != 0) { - getword(wbuf, buf, '"'); - getword(Header, buf, '"'); } - - } - - fclose(fp_in); - return; + + fclose(fp_in); + return; } -void -Log(pwdlogfile, user, newpwd, showpwd, msg, pwdfile, smtpuser, smtpsubject) - unsigned char *pwdlogfile; - unsigned char *user; - unsigned char *newpwd; - unsigned char *showpwd; - unsigned char *msg; - unsigned char *pwdfile; - unsigned char *smtpuser; - unsigned char *smtpsubject; -{ - FILE *fp_ou; - char Msg[MAXLEN]; - time_t tm; - struct tm *t; - char time_string[128]; - char pwd[MAXLEN]; - - tm = time(NULL); - t = localtime(&tm); - strftime(time_string, 127, "%Y/%m/%d %H:%M:%S", t); - - if ((fp_ou = fopen(pwdlogfile, "a")) == NULL) { - sprintf(Msg, "%s %s", msg16, pwdlogfile); - Hmsg(Msg); - exit(1); - } - - Msg[0] = '\0'; - strcpy(pwd, "-"); - - if (strcmp(showpwd, "yes") == 0) { - if (strlen(newpwd) > 0) - strcpy(pwd, newpwd); - } - - if (strlen(user) == 0) - strcpy(user, "-"); +void Log(pwdlogfile, user, newpwd, showpwd, msg, pwdfile, smtpuser, smtpsubject) + unsigned char *pwdlogfile; + unsigned char *user; + unsigned char *newpwd; + unsigned char *showpwd; + unsigned char *msg; + unsigned char *pwdfile; + unsigned char *smtpuser; + unsigned char *smtpsubject; +{ + FILE *fp_ou; + char Msg[MAXLEN]; + time_t tm; + struct tm *t; + char time_string[128]; + char pwd[MAXLEN]; + + tm = time(NULL); + t = localtime(&tm); + strftime(time_string, 127, "%Y/%m/%d %H:%M:%S", t); + + if ((fp_ou = fopen(pwdlogfile, "a")) == NULL) { + sprintf(Msg, "%s %s",msg16, pwdlogfile); + Hmsg(Msg); + exit(1); + } - sprintf(Msg, "%s %s %s %s %s pwdfile=%s\n", getenv("REMOTE_ADDR"), - time_string, user, pwd, msg, pwdfile); - Msg[strlen(Msg) - 1] = '\n'; - strip_latin(Msg); - fputs(Msg, fp_ou); - fclose(fp_ou); + Msg[0]='\0'; + strcpy(pwd,"-"); + + if(strcmp(showpwd,"yes") == 0){ + if(strlen(newpwd) > 0) + strcpy(pwd,newpwd); + } + + if(strlen(user) == 0) + strcpy(user,"-"); + + sprintf(Msg, "%s %s %s %s %s pwdfile=%s\n",getenv("REMOTE_ADDR"),time_string,user,pwd,msg,pwdfile); + Msg[strlen(Msg)-1]='\n'; + strip_latin(Msg); + fputs(Msg,fp_ou); + fclose(fp_ou); - if (strlen(smtpuser) > 0) - sendmail(smtpuser, smtpsubject, Msg); + if(strlen(smtpuser) > 0) + sendmail(smtpuser,smtpsubject,Msg); - return; + return; } -static void -vrfyrule(unsigned char *str, unsigned char *minchar, unsigned char *minnum, - unsigned char *minspec) +static void vrfyrule(unsigned char *str, unsigned char *minchar, unsigned char *minnum, unsigned char *minspec) { - int tnum = 0, talfa = 0, tspec = 0; + int tnum=0, talfa=0, tspec=0; char *ostr = str; - while (str[0]) { - if (str[0] == '%' && hhex(str[1]) && hhex(str[2])) { - tspec++; - str = str + 3; - continue; - } - if (str[0] == '.') { - tspec++; - str++; - continue; - } - if ((str[0] >= 'a' && str[0] <= 'z') || (str[0] >= 'A' - && str[0] <= 'Z')) talfa++; - if (str[0] >= '0' && str[0] <= '9') - tnum++; - - str++; + while(str[0]) { + if (str[0] == '%' && hhex(str[1]) && hhex(str[2])) { + tspec++; + str=str+3; + continue; + } + if (str[0] == '.') { + tspec++; + str++; + continue; + } + if ((str[0] >= 'a' && str[0] <= 'z') || (str[0] >='A' && str[0] <= 'Z')) + talfa++; + if (str[0] >= '0' && str[0] <= '9') + tnum++; + + str++; } - if (talfa < atoi(minchar)) - rulefail(minchar, minnum, minspec); + if(talfa < atoi(minchar)) + rulefail(minchar,minnum,minspec); - if (tnum < atoi(minnum)) - rulefail(minchar, minnum, minspec); + if(tnum < atoi(minnum)) + rulefail(minchar,minnum,minspec); - if (tspec < atoi(minspec)) - rulefail(minchar, minnum, minspec); + if(tspec < atoi(minspec)) + rulefail(minchar,minnum,minspec); return; } @@ -679,35 +656,25 @@ puts("\n"); printf("\n"); printf(""); - sprintf(Msg, "%s

    ", msg17); + sprintf(Msg,"%s

    ",msg17); printf(Msg); - sprintf(Msg, "%s

    \n", msg18); + sprintf(Msg,"%s

    \n",msg18); printf(Msg); - if (strcmp(minchar, "0") != 0) - printf - ("\n", - msg19, minchar); - else - printf - ("
    %s%s
    \n", - msg19); - - if (strcmp(minnum, "0") != 0) - printf - ("\n", - msg20, minnum); - else - printf("\n", - msg20); - - if (strcmp(minspec, "0") != 0) - printf - ("\n", - msg21, minspec); - else - printf("\n", - msg21); + if(strcmp(minchar,"0") != 0) + printf("
    %s
    %s%s
    %s
    %s%s
    %s
    \n",msg19,minchar); + else + printf("
    %s%s
    \n",msg19); + + if(strcmp(minnum,"0") != 0) + printf("\n",msg20,minnum); + else + printf("\n",msg20); + + if(strcmp(minspec,"0") != 0) + printf("\n",msg21,minspec); + else + printf("\n",msg21); printf("
    %s
    %s%s
    %s
    %s%s
    %s
    \n"); @@ -715,163 +682,153 @@ } -static void -strip_latin(char *line) +static void strip_latin(char *line) { - char buf[255]; - char warea[255]; - - while (strstr(line, "&") != 0) { - getword(warea, line, '&'); - strncat(warea, line, 1); - getword(buf, line, ';'); - strcat(warea, line); - strcpy(line, warea); - } + char buf[255]; + char warea[255]; - return; + while(strstr(line,"&") != 0){ + getword(warea,line,'&'); + strncat(warea,line,1); + getword(buf,line,';'); + strcat(warea,line); + strcpy(line,warea); + } + + return; + +} + + +static void vrfyauth(char *authfile, char *PwdLogFile, char *PwdFile, char *SmtpUser, char *SmtpSubject) +{ + + FILE *auth; + char IP[30]; + char buf[MAXLEN]; + int authbit=0; + struct stat statb; + + if(stat(authfile,&statb)) eperror(authfile); + if(statb.st_uid != 0) { + Hmsg(msg23); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,"-","","no",msg23,PwdFile,SmtpUser,SmtpSubject); + exit(1); + } + if(statb.st_mode & 022) { + Hmsg(msg24); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,"-","","no",msg24,PwdFile,SmtpUser,SmtpSubject); + exit(1); + } + + if((auth=fopen(authfile,"r"))==NULL) { + Hmsg(msg25); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,"-","","no",msg25,PwdFile,SmtpUser,SmtpSubject); + exit(1); + } + + if(getenv("HTTP_X_FORWARDED_FOR")) + sprintf(IP,"%s",getenv("HTTP_X_FORWARDED_FOR")); + else sprintf(IP,"%s",getenv("REMOTE_ADDR")); + + while(fgets(buf,MAXLEN,auth)!=NULL) { + if(!authbit) { + if(strstr(buf,"#") != 0) + continue; + else authbit=vauth(buf,IP); + } + } + + if(!authbit) { + Hmsg(msg26); + if(strlen(PwdLogFile) > 0) + Log(PwdLogFile,"-","","no",msg26,PwdFile,SmtpUser,SmtpSubject); + exit(1); + } + + return; + +} + + +int vauth(char *buf, char *ip) +{ + char a1[4],a2[4],a3[4],a4[4]; + char o1[4],o2[4],o3[4],o4[4]; + char ip2[255]; + int ok=1; + + strcpy(ip2,ip); + + buf[strlen(buf)-1]='\0'; + + if(strcmp(buf,"0.0.0.0") == 0) + return(1); + if(strcmp(buf,ip2) == 0) + return(1); + + getword(a1,buf,'.'); + getword(a2,buf,'.'); + getword(a3,buf,'.'); + getword(a4,buf,' '); + + getword(o1,ip2,'.'); + getword(o2,ip2,'.'); + getword(o3,ip2,'.'); + getword(o4,ip2,' '); + + if(strcmp(a1,"0") != 0){ + if(strcmp(a1,o1) != 0) + ok=0; + } + if(strcmp(a2,"0") != 0){ + if(strcmp(a2,o2) != 0) + ok=0; + } + if(strcmp(a3,"0") != 0){ + if(strcmp(a3,o3) != 0) + ok=0; + } + if(strcmp(a4,"0") != 0){ + if(strcmp(a4,o4) != 0) + ok=0; + } + return(ok); } -static void -vrfyauth(char *authfile, char *PwdLogFile, char *PwdFile, char *SmtpUser, - char *SmtpSubject) -{ - - FILE *auth; - char IP[30]; - char buf[MAXLEN]; - int authbit = 0; - struct stat statb; - - if (stat(authfile, &statb)) - eperror(authfile); - if (statb.st_uid != 0) { - Hmsg(msg23); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, "-", "", "no", msg23, PwdFile, SmtpUser, - SmtpSubject); - exit(1); - } - if (statb.st_mode & 022) { - Hmsg(msg24); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, "-", "", "no", msg24, PwdFile, SmtpUser, - SmtpSubject); - exit(1); - } - - if ((auth = fopen(authfile, "r")) == NULL) { - Hmsg(msg25); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, "-", "", "no", msg25, PwdFile, SmtpUser, - SmtpSubject); - exit(1); - } - - if (getenv("HTTP_X_FORWARDED_FOR")) - sprintf(IP, "%s", getenv("HTTP_X_FORWARDED_FOR")); - else - sprintf(IP, "%s", getenv("REMOTE_ADDR")); - - while (fgets(buf, MAXLEN, auth) != NULL) { - if (!authbit) { - if (strstr(buf, "#") != 0) - continue; - else - authbit = vauth(buf, IP); - } - } - - if (!authbit) { - Hmsg(msg26); - if (strlen(PwdLogFile) > 0) - Log(PwdLogFile, "-", "", "no", msg26, PwdFile, SmtpUser, - SmtpSubject); - exit(1); - } - - return; - -} - - -int -vauth(char *buf, char *ip) +eperror(s) +register char *s; { - char a1[4], a2[4], a3[4], a4[4]; - char o1[4], o2[4], o3[4], o4[4]; - char ip2[255]; - int ok = 1; - - strcpy(ip2, ip); - - buf[strlen(buf) - 1] = '\0'; - - if (strcmp(buf, "0.0.0.0") == 0) - return (1); - if (strcmp(buf, ip2) == 0) - return (1); - - getword(a1, buf, '.'); - getword(a2, buf, '.'); - getword(a3, buf, '.'); - getword(a4, buf, ' '); - - getword(o1, ip2, '.'); - getword(o2, ip2, '.'); - getword(o3, ip2, '.'); - getword(o4, ip2, ' '); - - if (strcmp(a1, "0") != 0) { - if (strcmp(a1, o1) != 0) - ok = 0; - } - if (strcmp(a2, "0") != 0) { - if (strcmp(a2, o2) != 0) - ok = 0; - } - if (strcmp(a3, "0") != 0) { - if (strcmp(a3, o3) != 0) - ok = 0; - } - if (strcmp(a4, "0") != 0) { - if (strcmp(a4, o4) != 0) - ok = 0; - } + perror("chpasswd.cgi"); + exit(1); - return (ok); } -eperror(s) - register char *s; +void sendmail(char *user, char *subj, char *msg) { - perror("chpasswd.cgi"); - exit(1); -} + FILE *mail; + char cmd[MAXLEN]; + sprintf(cmd,"mailx -s '%s' %s",subj,user); -void -sendmail(char *user, char *subj, char *msg) -{ + if (access("/bin/mailx", R_OK) == 0) + sprintf(cmd,"/bin/mailx -s '%s' %s",subj,user); + if (access("/usr/bin/mailx", R_OK) == 0) + sprintf(cmd,"/bin/mailx -s '%s' %s",subj,user); - FILE *mail; - char cmd[MAXLEN]; + if((mail =popen(cmd, "w")) != NULL ) { + fputs(msg,mail); + pclose(mail); + } - sprintf(cmd, "mailx -s '%s' %s", subj, user); - if (access("/bin/mailx", R_OK) == 0) - sprintf(cmd, "/bin/mailx -s '%s' %s", subj, user); - if (access("/usr/bin/mailx", R_OK) == 0) - sprintf(cmd, "/bin/mailx -s '%s' %s", subj, user); - - if ((mail = popen(cmd, "w")) != NULL) { - fputs(msg, mail); - pclose(mail); - } // FILE *mail = popen(MAILPROG " -s 'Test Message' root", "w"); // if (!mail) { // perror("popen"); @@ -886,5 +843,5 @@ // exit(1); // } // } - return; + return; } Index: squid/contrib/chpasswd/conf.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/conf.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/conf.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/conf.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -1,4 +1,5 @@ #include "info.h" + #if HAVE_CRYPT_H #ifdef WIN32 #include "crypt.h" @@ -56,8 +57,7 @@ int vauth(char *, char *); void sendmail(char *, char *, char *); void to64(register char *, register long, register int); -void Log(unsigned char *, unsigned char *, unsigned char *, unsigned char *, - unsigned char *, unsigned char *, unsigned char *, unsigned char *); +void Log(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *); Index: squid/contrib/chpasswd/language.h =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/language.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/chpasswd/language.h 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/chpasswd/language.h 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -16,12 +16,12 @@ #if defined(Dutch) #include "Dutch.h" #endif -#if defined(French) -#include "French.h" +#if defined(French) +#include "French.h" #endif -#if defined(German) -#include "German.h" +#if defined(German) +#include "German.h" #endif -#if defined(Spanish) -#include "Spanish.h" +#if defined(Spanish) +#include "Spanish.h" #endif Index: squid/contrib/htpasswd/htpasswd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/htpasswd/Attic/htpasswd.c,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2 --- squid/contrib/htpasswd/htpasswd.c 27 Aug 2001 21:48:16 -0000 1.1.2.1.2.1 +++ squid/contrib/htpasswd/htpasswd.c 9 Sep 2001 10:34:28 -0000 1.1.2.1.2.2 @@ -32,72 +32,60 @@ char *tn; -char * -strd(char *s) -{ +char *strd(char *s) { char *d; - d = (char *) malloc(strlen(s) + 1); - strcpy(d, s); - return (d); + d=(char *)malloc(strlen(s) + 1); + strcpy(d,s); + return(d); } -void -getword(char *word, char *line, char stop) -{ - int x = 0, y; +void getword(char *word, char *line, char stop) { + int x = 0,y; - for (x = 0; ((line[x]) && (line[x] != stop)); x++) - word[x] = line[x]; + for(x=0;((line[x]) && (line[x] != stop));x++) + word[x] = line[x]; word[x] = '\0'; - if (line[x]) - ++x; - y = 0; + if(line[x]) ++x; + y=0; - while ((line[y++] = line[x++])); + while((line[y++] = line[x++])); } -int -getline(char *s, int n, FILE * f) -{ - register int i = 0; +int getline(char *s, int n, FILE *f) { + register int i=0; - while (1) { - s[i] = (char) fgetc(f); + while(1) { + s[i] = (char)fgetc(f); - if (s[i] == CR) - s[i] = fgetc(f); + if(s[i] == CR) + s[i] = fgetc(f); - if ((s[i] == 0x4) || (s[i] == LF) || (i == (n - 1))) { - s[i] = '\0'; - return (feof(f) ? 1 : 0); - } - ++i; + if((s[i] == 0x4) || (s[i] == LF) || (i == (n-1))) { + s[i] = '\0'; + return (feof(f) ? 1 : 0); + } + ++i; } } -void -putline(FILE * f, char *l) -{ +void putline(FILE *f,char *l) { int x; - for (x = 0; l[x]; x++) - fputc(l[x], f); - fputc('\n', f); + for(x=0;l[x];x++) fputc(l[x],f); + fputc('\n',f); } /* From local_passwd.c (C) Regents of Univ. of California blah blah */ -static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -void -to64(register char *s, register long v, register int n) -{ +void to64(register char *s, register long v, register int n) { while (--n >= 0) { - *s++ = itoa64[v & 0x3f]; - v >>= 6; + *s++ = itoa64[v&0x3f]; + v >>= 6; } } @@ -105,108 +93,102 @@ /* MPE lacks getpass() and a way to suppress stdin echo. So for now, just issue the prompt and read the results with echo. (Ugh). */ -char * -getpass(const char *prompt) -{ +char *getpass(const char *prompt) { - static char password[81]; +static char password[81]; - fputs(prompt, stderr); - gets((char *) &password); +fputs(prompt,stderr); +gets((char *)&password); - if (strlen((char *) &password) > 8) { - password[8] = '\0'; - } +if (strlen((char *)&password) > 8) { + password[8]='\0'; +} - return (char *) &password; +return (char *)&password; } #endif #ifdef WIN32 -int -get_password(char s[], int lim) +int get_password(char s[], int lim) + { - int c, i; + int c,i; - i = 0; - while (--lim > 0 && (c = getch()) != EOF && c != '\n' && c != '\r') { - if (c < ' ') { - lim++; - if (c == '\b' && i > 0) { - i--; - printf("\b \b"); - } - } else { - s[i++] = (char) c; - putchar('*'); + i=0; + while (--lim > 0 && (c = getch()) != EOF && c != '\n' && c != '\r') + { + if (c < ' ') + { + lim++; + if (c == '\b' && i > 0) + { + i--; + printf("\b \b"); + } + } + else + { + s[i++] = (char) c; + putchar('*'); + } } - } - if (c == '\r' || c == '\n') - putchar('\n'); - s[i] = '\0'; - return i; + if (c == '\r' || c == '\n') + putchar('\n'); + s[i] = '\0'; + return i; } -char * -getpass(const char *prompt) +char *getpass(const char *prompt) { - static char password[81]; + static char password[81]; - fputs(prompt, stderr); - get_password((char *) &password, 80); + fputs(prompt,stderr); + get_password((char *)&password, 80); - if (strlen((char *) &password) > 8) { - password[8] = '\0'; - } + if (strlen((char *)&password) > 8) + { + password[8]='\0'; + } - return (char *) &password; + return (char *)&password; } #endif -void -add_password(char *user, FILE * f) -{ +void add_password(char *user, FILE *f) { char *pw, *cpw, salt[3]; pw = strd((char *) getpass("New password:")); - if (strcmp(pw, (char *) getpass("Re-type new password:"))) { - fprintf(stderr, "They don't match, sorry.\n"); - if (tn) - unlink(tn); - exit(1); - } - (void) srand((int) time((time_t *) NULL)); - to64(&salt[0], rand(), 2); - cpw = crypt(pw, salt); + if(strcmp(pw,(char *) getpass("Re-type new password:"))) { + fprintf(stderr,"They don't match, sorry.\n"); + if(tn) + unlink(tn); + exit(1); + } + (void)srand((int)time((time_t *)NULL)); + to64(&salt[0],rand(),2); + cpw = crypt(pw,salt); free(pw); - fprintf(f, "%s:%s\n", user, cpw); + fprintf(f,"%s:%s\n",user,cpw); } -void -usage() -{ - fprintf(stderr, "Usage: htpasswd [-c] passwordfile username\n"); - fprintf(stderr, "The -c flag creates a new file.\n"); +void usage() { + fprintf(stderr,"Usage: htpasswd [-c] passwordfile username\n"); + fprintf(stderr,"The -c flag creates a new file.\n"); exit(1); } -void -interrupted() -{ - fprintf(stderr, "Interrupted.\n"); - if (tn) - unlink(tn); +void interrupted() { + fprintf(stderr,"Interrupted.\n"); + if(tn) unlink(tn); exit(1); } -void -main(int argc, char *argv[]) -{ - FILE *tfp, *f; +void main(int argc, char *argv[]) { + FILE *tfp,*f; char user[MAX_STRING_LEN]; char line[MAX_STRING_LEN]; char l[MAX_STRING_LEN]; @@ -215,61 +197,61 @@ int found; tn = NULL; - signal(SIGINT, (void (*)()) interrupted); - if (argc == 4) { - if (strcmp(argv[1], "-c")) - usage(); - if (!(tfp = fopen(argv[2], "w"))) { - fprintf(stderr, "Could not open passwd file %s for writing.\n", - argv[2]); - perror("fopen"); - exit(1); - } - printf("Adding password for %s.\n", argv[3]); - add_password(argv[3], tfp); - fclose(tfp); - exit(0); - } else if (argc != 3) - usage(); + signal(SIGINT,(void (*)())interrupted); + if(argc == 4) { + if(strcmp(argv[1],"-c")) + usage(); + if(!(tfp = fopen(argv[2],"w"))) { + fprintf(stderr,"Could not open passwd file %s for writing.\n", + argv[2]); + perror("fopen"); + exit(1); + } + printf("Adding password for %s.\n",argv[3]); + add_password(argv[3],tfp); + fclose(tfp); + exit(0); + } else if(argc != 3) usage(); tn = tmpnam(NULL); - if (!(tfp = fopen(tn, "w"))) { - fprintf(stderr, "Could not open temp file.\n"); - exit(1); + if(!(tfp = fopen(tn,"w"))) { + fprintf(stderr,"Could not open temp file.\n"); + exit(1); } - if (!(f = fopen(argv[1], "r"))) { - fprintf(stderr, - "Could not open passwd file %s for reading.\n", argv[1]); - fprintf(stderr, "Use -c option to create new one.\n"); - exit(1); + if(!(f = fopen(argv[1],"r"))) { + fprintf(stderr, + "Could not open passwd file %s for reading.\n",argv[1]); + fprintf(stderr,"Use -c option to create new one.\n"); + exit(1); } - strcpy(user, argv[2]); + strcpy(user,argv[2]); found = 0; - while (!(getline(line, MAX_STRING_LEN, f))) { - if (found || (line[0] == '#') || (!line[0])) { - putline(tfp, line); - continue; - } - strcpy(l, line); - getword(w, l, ':'); - if (strcmp(user, w)) { - putline(tfp, line); - continue; - } else { - printf("Changing password for user %s\n", user); - add_password(user, tfp); - found = 1; - } - } - if (!found) { - printf("Adding user %s\n", user); - add_password(user, tfp); + while(!(getline(line,MAX_STRING_LEN,f))) { + if(found || (line[0] == '#') || (!line[0])) { + putline(tfp,line); + continue; + } + strcpy(l,line); + getword(w,l,':'); + if(strcmp(user,w)) { + putline(tfp,line); + continue; + } + else { + printf("Changing password for user %s\n",user); + add_password(user,tfp); + found = 1; + } + } + if(!found) { + printf("Adding user %s\n",user); + add_password(user,tfp); } fclose(f); fclose(tfp); - sprintf(command, "cmd /C copy %s %s > NUL", tn, argv[1]); + sprintf(command,"cmd /C copy %s %s > NUL",tn,argv[1]); system(command); unlink(tn); }