logo

skeud

Simple and portable utilities to deal with user accounts (su, login)git clone https://anongit.hacktivis.me/git/skeud.git/
commit: 30c49724fd5111e3c1e5497ecabfc919877d22d1
parent e3a6b1d54d7afc1d0cacedef1c0fb2ba1809cf0f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 23 Sep 2025 11:06:11 +0200

login: return 1 instead of assert on empty username

Diffstat:

Mlogin.c3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/login.c b/login.c @@ -12,7 +12,6 @@ #include "common.h" // skeud_getpass, skeud_crypt_check -#include <assert.h> // assert #include <errno.h> // errno #include <grp.h> // getgrnam, initgroups #include <pwd.h> // getpwnam @@ -110,7 +109,7 @@ main(int argc, char *argv[]) username[got - 1] = 0; } - assert(username != NULL); + if(username == NULL) return 1; errno = 0; pwent = getpwnam(username);