logo

skeud

Simple and portable utilities to deal with user accounts (su, login)
commit: ad5eda7959bcf348aba69f972b493e063fd3a6f5
parent bad8fe03edbade65b8d3f0824d74d013452547bd
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  1 Nov 2022 17:42:21 +0100

common.c: Always prefix error messages

Diffstat:

Mcommon.c14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/common.c b/common.c @@ -49,7 +49,7 @@ skeud_crypt_check(char *hash, char *password) char *chk_hash = crypt(password, hash); if(chk_hash == NULL) { - perror("crypt"); + perror("skeud_crypt_check: crypt"); return false; } @@ -71,19 +71,19 @@ skeud_getpass(char **password) FILE *tty = fopen("/dev/tty", "rb+"); if(tty == NULL) { - perror("open(\"/dev/tty\")"); + perror("skeud_getpass: open(\"/dev/tty\")"); return got; } int tty_fd = fileno(tty); if(tty_fd < 0) { - perror("fileno(tty)"); + perror("skeud_getpass: fileno(tty)"); goto getpass_end; } if(tcgetattr(tty_fd, &t) < 0) { - perror("tcgetattr"); + perror("skeud_getpass: tcgetattr"); goto getpass_end; } @@ -91,7 +91,7 @@ skeud_getpass(char **password) t.c_lflag &= ~ECHO; if(tcsetattr(tty_fd, TCSANOW, &t) < 0) { - perror("tcsetattr(~ECHO)"); + perror("skeud_getpass: tcsetattr(~ECHO)"); goto getpass_end; } @@ -103,7 +103,7 @@ skeud_getpass(char **password) t.c_lflag &= ECHO; tcsetattr(tty_fd, TCSANOW, &t); - if(errno != 0) perror("getline"); + if(errno != 0) perror("skeud_getpass: getline"); goto getpass_end; } (*password)[got] = 0; @@ -113,7 +113,7 @@ skeud_getpass(char **password) t.c_lflag &= ECHO; if(tcsetattr(tty_fd, TCSANOW, &t) < 0) { - perror("tcsetattr(ECHO)"); + perror("skeud_getpass: tcsetattr(ECHO)"); explicit_bzero(password, got); got = -1; goto getpass_end;