diff --git a/README.md b/README.md index 33cdda6..ee70e61 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,31 @@ A replacement for `/bin/login` which provides a friendly TUI greeter. guarantee that for certain. Use it at your own risk. ## TODO -- [ ] UTF-8 support - [ ] Respect `/etc/login.defs` +- [ ] UTF-8 support - [ ] Appearance customization + +## Install +hlogin depends on ncursesw, panel, and pam. It also requires GNU Autotools and pkg-config. + +Generate autotools files: +``` sh +aclocal +autoheader +automake +autoconf +``` + +Configure, build, and install: +``` sh +./configure --prefix="/usr" +make +sudo make install +``` + +To use hlogin with agetty, add the options `-n -l /usr/bin/hlogin` to it in your inittab, like so: + +``` sh +c1:12345:respawn:/sbin/agetty -n -l /usr/bin/hlogin 38400 tty1 linux +``` + diff --git a/po/en.po b/po/en.po index bc20e48..2612a5b 100644 --- a/po/en.po +++ b/po/en.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: hlogin 0.1\n" "Report-Msgid-Bugs-To: keith+hlogin@keithhacks.cyou\n" -"POT-Creation-Date: 2022-05-15 23:05+0000\n" +"POT-Creation-Date: 2022-05-20 16:32+0000\n" "PO-Revision-Date: 2022-05-15 23:06+0000\n" "Last-Translator: ~keith \n" "Language-Team: English\n" @@ -17,19 +17,192 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: hlogin.c:59 +#: hlogin.c:219 msgid "Login name:" msgstr "Login name:" -#: hlogin.c:68 +#: hlogin.c:227 +#, c-format +msgid "Couldn't set PAM_USER: %s" +msgstr "Couldn't set PAM_USER: %s" + +#: hlogin.c:228 +msgid "Failed to begin authentication." +msgstr "Failed to begin authentication." + +#: hlogin.c:237 +#, c-format +msgid "TOO MANY LOGIN TRIES (%u) FROM '%s' FOR '%s', %s" +msgstr "TOO MANY LOGIN TRIES (%u) FROM '%s' FOR '%s', %s" + +#: hlogin.c:240 +#, c-format +msgid "FAILED LOGIN (%u) FROM '%s' FOR '%s', %s" +msgstr "FAILED LOGIN (%u) FROM '%s' FOR '%s', %s" + +#: hlogin.c:244 +msgid "Authentication failed." +msgstr "Authentication failed." + +#: hlogin.c:340 +msgid "Couldn't determine origin: neither remote host nor TTY" +msgstr "Couldn't determine origin: neither remote host nor TTY" + +#: hlogin.c:347 +#, c-format +msgid "Couldn't initialize PAM: %s" +msgstr "Couldn't initialize PAM: %s" + +#: hlogin.c:348 +#, c-format +msgid "pam_start error: %s. Abort.\n" +msgstr "pam_start error: %s. Abort.\n" + +#: hlogin.c:355 +#, c-format +msgid "Couldn't set PAM_RHOST: %s" +msgstr "Couldn't set PAM_RHOST: %s" + +#: hlogin.c:356 hlogin.c:365 +#, c-format +msgid "pam_set_item error: %s. Abort.\n" +msgstr "pam_set_item error: %s. Abort.\n" + +#: hlogin.c:364 +#, c-format +msgid "Couldn't set PAM_TTY: %s" +msgstr "Couldn't set PAM_TTY: %s" + +#: hlogin.c:381 +#, c-format +msgid "Login from '%s' aborted" +msgstr "Login from '%s' aborted" + +#. TRANSLATORS: default value is 5 +#: hlogin.c:390 +#, c-format +msgid "Exceeded maximum login attempts (%u).\n" +msgstr "Exceeded maximum login attempts (%u).\n" + +#: hlogin.c:404 +#, c-format +msgid "User validation failed for '%s': %s" +msgstr "User validation failed for '%s': %s" + +#: hlogin.c:417 +msgid "Failed to update login credentials." +msgstr "Failed to update login credentials." + +#: hlogin.c:421 +msgid "Cannot log in." +msgstr "Cannot log in." + +#: hlogin.c:432 +#, c-format +msgid "Couldn't get PAM_USER: %s" +msgstr "Couldn't get PAM_USER: %s" + +#: hlogin.c:433 hlogin.c:442 hlogin.c:453 +msgid "Cannot log in. The user account data is missing or invalid." +msgstr "Cannot log in. The user account data is missing or invalid." + +#: hlogin.c:441 +msgid "NULL user name. Abort." +msgstr "NULL user name. Abort." + +#: hlogin.c:452 +#, c-format +msgid "No passwd entry for '%s'. Abort." +msgstr "No passwd entry for '%s'. Abort." + +#: hlogin.c:465 +#, c-format +msgid "groups initialization failed: %m" +msgstr "groups initialization failed: %m" + +#: hlogin.c:466 hlogin.c:478 hlogin.c:489 hlogin.c:500 +msgid "Cannot log in. Unable to establish a session." +msgstr "Cannot log in. Unable to establish a session." + +#: hlogin.c:477 hlogin.c:488 hlogin.c:499 +#, c-format +msgid "Couldn't init PAM session: %s" +msgstr "Couldn't init PAM session: %s" + +#: hlogin.c:513 +#, c-format +msgid "LOGIN FROM '%s' BY '%s'" +msgstr "LOGIN FROM '%s' BY '%s'" + +#: hlogin.c:519 +#, c-format +msgid "failed to chown TTY '%s': %m" +msgstr "failed to chown TTY '%s': %m" + +#: hlogin.c:523 +#, c-format +msgid "setgid() failed: %m" +msgstr "setgid() failed: %m" + +#: hlogin.c:524 +#, c-format +msgid "error applying user GID: %m. Abort.\n" +msgstr "error applying user GID: %m. Abort.\n" + +#: hlogin.c:559 +#, c-format +msgid "error forking: %m. Abort.\n" +msgstr "error forking: %m. Abort.\n" + +#: hlogin.c:561 +#, c-format +msgid "fork() failed: %m" +msgstr "fork() failed: %m" + +#: hlogin.c:601 +#, c-format +msgid "can't reopen tty: %m" +msgstr "can't reopen tty: %m" + +#: hlogin.c:607 +#, c-format +msgid "%s is not a tty" +msgstr "%s is not a tty" + +#: hlogin.c:625 +#, c-format +msgid "TIOCSCTTY failed: %m" +msgstr "TIOCSCTTY failed: %m" + +#: hlogin.c:631 +#, c-format +msgid "setuid() failed: %m" +msgstr "setuid() failed: %m" + +#: hlogin.c:632 +#, c-format +msgid "error applying user UID: %m. Abort.\n" +msgstr "error applying user UID: %m. Abort.\n" + +#: hlogin.c:637 +#, c-format +msgid "failed to chdir to home (%s): %m" +msgstr "failed to chdir to home (%s): %m" + +#: hlogin.c:638 +#, c-format +msgid "error changing to home directory: %m. Abort.\n" +msgstr "error changing to home directory: %m. Abort.\n" + +#: ui.c:238 ui.c:385 ui.c:473 msgid "OK" msgstr "OK" -#: hlogin.c:71 -msgid "Cancel" -msgstr "Cancel" - -#: ui.c:179 +#: ui.c:344 #, c-format msgid "Welcome to %s.%s" msgstr "Welcome to %s.%s" + +#: ui.c:391 +msgid "Cancel" +msgstr "Cancel" diff --git a/po/fr.po b/po/fr.po index 433008e..2a199b2 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: hlogin 0.1\n" "Report-Msgid-Bugs-To: keith+hlogin@keithhacks.cyou\n" -"POT-Creation-Date: 2022-05-15 23:05+0000\n" +"POT-Creation-Date: 2022-05-20 16:32+0000\n" "PO-Revision-Date: 2022-05-15 23:07+0000\n" "Last-Translator: ~keith \n" "Language-Team: French \n" @@ -17,19 +17,192 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: hlogin.c:59 +#: hlogin.c:219 msgid "Login name:" msgstr "Identifiant :" -#: hlogin.c:68 +#: hlogin.c:227 +#, c-format +msgid "Couldn't set PAM_USER: %s" +msgstr "Impossible de définir PAM_USER : %s" + +#: hlogin.c:228 +msgid "Failed to begin authentication." +msgstr "Échec d'initialisation de l'authentification." + +#: hlogin.c:237 +#, c-format +msgid "TOO MANY LOGIN TRIES (%u) FROM '%s' FOR '%s', %s" +msgstr "TROP DE TENTATIVES DE CONNEXION (%u) DE « %s » POUR « %s », %s" + +#: hlogin.c:240 +#, c-format +msgid "FAILED LOGIN (%u) FROM '%s' FOR '%s', %s" +msgstr "ÉCHEC DE CONNEXION (%u) À PARTIR DE « %s » POUR « %s », %s" + +#: hlogin.c:244 +msgid "Authentication failed." +msgstr "Échec de l'authentification." + +#: hlogin.c:340 +msgid "Couldn't determine origin: neither remote host nor TTY" +msgstr "Impossible de déterminer l'origine : ni hôte distant ni terminal" + +#: hlogin.c:347 +#, c-format +msgid "Couldn't initialize PAM: %s" +msgstr "Impossible d'initialiser PAM : %s" + +#: hlogin.c:348 +#, c-format +msgid "pam_start error: %s. Abort.\n" +msgstr "échec de pam_start : %s. Abandon.\n" + +#: hlogin.c:355 +#, c-format +msgid "Couldn't set PAM_RHOST: %s" +msgstr "Impossible de définir PAM_RHOST : %s" + +#: hlogin.c:356 hlogin.c:365 +#, c-format +msgid "pam_set_item error: %s. Abort.\n" +msgstr "échec de pam_set_item : %s. Abandon.\n" + +#: hlogin.c:364 +#, c-format +msgid "Couldn't set PAM_TTY: %s" +msgstr "Impossible de définir PAM_TTY : %s" + +#: hlogin.c:381 +#, c-format +msgid "Login from '%s' aborted" +msgstr "Connexion de « %s » annulée" + +#. TRANSLATORS: default value is 5 +#: hlogin.c:390 +#, c-format +msgid "Exceeded maximum login attempts (%u).\n" +msgstr "" + +#: hlogin.c:404 +#, c-format +msgid "User validation failed for '%s': %s" +msgstr "Échec de validation pour « %s » : %s" + +#: hlogin.c:417 +msgid "Failed to update login credentials." +msgstr "Échec de la modification des identifiants." + +#: hlogin.c:421 +msgid "Cannot log in." +msgstr "Échec de connexion." + +#: hlogin.c:432 +#, c-format +msgid "Couldn't get PAM_USER: %s" +msgstr "Impossible d'obtenir PAM_USER : %s" + +#: hlogin.c:433 hlogin.c:442 hlogin.c:453 +msgid "Cannot log in. The user account data is missing or invalid." +msgstr "Échec de connexion. Les données du compte sont manquantes ou invalides." + +#: hlogin.c:441 +msgid "NULL user name. Abort." +msgstr "Identifiant vide. Abandon." + +#: hlogin.c:452 +#, c-format +msgid "No passwd entry for '%s'. Abort." +msgstr "Aucune entrée passwd pour « %s ». Abandon." + +#: hlogin.c:465 +#, c-format +msgid "groups initialization failed: %m" +msgstr "échec d'initialisation des groupes : %m" + +#: hlogin.c:466 hlogin.c:478 hlogin.c:489 hlogin.c:500 +msgid "Cannot log in. Unable to establish a session." +msgstr "Échec de connexion. Impossible d'ouvrir la session." + +#: hlogin.c:477 hlogin.c:488 hlogin.c:499 +#, c-format +msgid "Couldn't init PAM session: %s" +msgstr "Impossible d'initialiser la session PAM : %s" + +#: hlogin.c:513 +#, c-format +msgid "LOGIN FROM '%s' BY '%s'" +msgstr "CONNEXION DE « %s » FAIT PAR « %s »" + +#: hlogin.c:519 +#, c-format +msgid "failed to chown TTY '%s': %m" +msgstr "échec de chown le terminal « %s » : %m" + +#: hlogin.c:523 +#, c-format +msgid "setgid() failed: %m" +msgstr "échec de setgid() : %m" + +#: hlogin.c:524 +#, c-format +msgid "error applying user GID: %m. Abort.\n" +msgstr "échec d'initialisation de GID : %m. Abandon.\n" + +#: hlogin.c:559 +#, c-format +msgid "error forking: %m. Abort.\n" +msgstr "échec de fork() : %m. Abandon.\n" + +#: hlogin.c:561 +#, c-format +msgid "fork() failed: %m" +msgstr "échec de fork() : %m" + +#: hlogin.c:601 +#, c-format +msgid "can't reopen tty: %m" +msgstr "impossible de rouvrir le terminal : %m" + +#: hlogin.c:607 +#, c-format +msgid "%s is not a tty" +msgstr "%s n'est pas un terminal" + +#: hlogin.c:625 +#, c-format +msgid "TIOCSCTTY failed: %m" +msgstr "échec de TIOCSCTTY : %m" + +#: hlogin.c:631 +#, c-format +msgid "setuid() failed: %m" +msgstr "échec de setuid() : %m" + +#: hlogin.c:632 +#, c-format +msgid "error applying user UID: %m. Abort.\n" +msgstr "échec d'initialisation de UID : %m. Abandon.\n" + +#: hlogin.c:637 +#, c-format +msgid "failed to chdir to home (%s): %m" +msgstr "impossible d'exécuter « chdir » avec « %s » : %m" + +#: hlogin.c:638 +#, c-format +msgid "error changing to home directory: %m. Abort.\n" +msgstr "impossible de changer le répertoire : %m. Abandon.\n" + +#: ui.c:238 ui.c:385 ui.c:473 msgid "OK" msgstr "Ok" -#: hlogin.c:71 -msgid "Cancel" -msgstr "Annuler" - -#: ui.c:179 +#: ui.c:344 #, c-format msgid "Welcome to %s.%s" msgstr "Bienvenue à %s.%s" + +#: ui.c:391 +msgid "Cancel" +msgstr "Annuler" diff --git a/po/hlogin.pot b/po/hlogin.pot index be65cc3..f2d0bae 100644 --- a/po/hlogin.pot +++ b/po/hlogin.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: hlogin 0.1\n" "Report-Msgid-Bugs-To: keith+hlogin@keithhacks.cyou\n" -"POT-Creation-Date: 2022-05-15 23:05+0000\n" +"POT-Creation-Date: 2022-05-20 16:32+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,19 +17,192 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: hlogin.c:59 +#: hlogin.c:219 msgid "Login name:" msgstr "" -#: hlogin.c:68 +#: hlogin.c:227 +#, c-format +msgid "Couldn't set PAM_USER: %s" +msgstr "" + +#: hlogin.c:228 +msgid "Failed to begin authentication." +msgstr "" + +#: hlogin.c:237 +#, c-format +msgid "TOO MANY LOGIN TRIES (%u) FROM '%s' FOR '%s', %s" +msgstr "" + +#: hlogin.c:240 +#, c-format +msgid "FAILED LOGIN (%u) FROM '%s' FOR '%s', %s" +msgstr "" + +#: hlogin.c:244 +msgid "Authentication failed." +msgstr "" + +#: hlogin.c:340 +msgid "Couldn't determine origin: neither remote host nor TTY" +msgstr "" + +#: hlogin.c:347 +#, c-format +msgid "Couldn't initialize PAM: %s" +msgstr "" + +#: hlogin.c:348 +#, c-format +msgid "pam_start error: %s. Abort.\n" +msgstr "" + +#: hlogin.c:355 +#, c-format +msgid "Couldn't set PAM_RHOST: %s" +msgstr "" + +#: hlogin.c:356 hlogin.c:365 +#, c-format +msgid "pam_set_item error: %s. Abort.\n" +msgstr "" + +#: hlogin.c:364 +#, c-format +msgid "Couldn't set PAM_TTY: %s" +msgstr "" + +#: hlogin.c:381 +#, c-format +msgid "Login from '%s' aborted" +msgstr "" + +#. TRANSLATORS: default value is 5 +#: hlogin.c:390 +#, c-format +msgid "Exceeded maximum login attempts (%u).\n" +msgstr "" + +#: hlogin.c:404 +#, c-format +msgid "User validation failed for '%s': %s" +msgstr "" + +#: hlogin.c:417 +msgid "Failed to update login credentials." +msgstr "" + +#: hlogin.c:421 +msgid "Cannot log in." +msgstr "" + +#: hlogin.c:432 +#, c-format +msgid "Couldn't get PAM_USER: %s" +msgstr "" + +#: hlogin.c:433 hlogin.c:442 hlogin.c:453 +msgid "Cannot log in. The user account data is missing or invalid." +msgstr "" + +#: hlogin.c:441 +msgid "NULL user name. Abort." +msgstr "" + +#: hlogin.c:452 +#, c-format +msgid "No passwd entry for '%s'. Abort." +msgstr "" + +#: hlogin.c:465 +#, c-format +msgid "groups initialization failed: %m" +msgstr "" + +#: hlogin.c:466 hlogin.c:478 hlogin.c:489 hlogin.c:500 +msgid "Cannot log in. Unable to establish a session." +msgstr "" + +#: hlogin.c:477 hlogin.c:488 hlogin.c:499 +#, c-format +msgid "Couldn't init PAM session: %s" +msgstr "" + +#: hlogin.c:513 +#, c-format +msgid "LOGIN FROM '%s' BY '%s'" +msgstr "" + +#: hlogin.c:519 +#, c-format +msgid "failed to chown TTY '%s': %m" +msgstr "" + +#: hlogin.c:523 +#, c-format +msgid "setgid() failed: %m" +msgstr "" + +#: hlogin.c:524 +#, c-format +msgid "error applying user GID: %m. Abort.\n" +msgstr "" + +#: hlogin.c:559 +#, c-format +msgid "error forking: %m. Abort.\n" +msgstr "" + +#: hlogin.c:561 +#, c-format +msgid "fork() failed: %m" +msgstr "" + +#: hlogin.c:601 +#, c-format +msgid "can't reopen tty: %m" +msgstr "" + +#: hlogin.c:607 +#, c-format +msgid "%s is not a tty" +msgstr "" + +#: hlogin.c:625 +#, c-format +msgid "TIOCSCTTY failed: %m" +msgstr "" + +#: hlogin.c:631 +#, c-format +msgid "setuid() failed: %m" +msgstr "" + +#: hlogin.c:632 +#, c-format +msgid "error applying user UID: %m. Abort.\n" +msgstr "" + +#: hlogin.c:637 +#, c-format +msgid "failed to chdir to home (%s): %m" +msgstr "" + +#: hlogin.c:638 +#, c-format +msgid "error changing to home directory: %m. Abort.\n" +msgstr "" + +#: ui.c:238 ui.c:385 ui.c:473 msgid "OK" msgstr "" -#: hlogin.c:71 -msgid "Cancel" -msgstr "" - -#: ui.c:179 +#: ui.c:344 #, c-format msgid "Welcome to %s.%s" msgstr "" + +#: ui.c:391 +msgid "Cancel" +msgstr "" diff --git a/ui_old.tar.gz b/ui_old.tar.gz deleted file mode 100644 index 9f70b25..0000000 Binary files a/ui_old.tar.gz and /dev/null differ