Re: [hackers] [slock] Unify how we check passwords between different OSes

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Wed, 7 Sep 2016 11:42:04 +0200

Heyho Quentin,

thanks for the update.

Quentin Rameau wrote:
> diff --git a/config.mk b/config.mk
> …
> -# Install mode. On BSD systems MODE=2755 and GROUP=auth
> -# On others MODE=4755 and GROUP=root
> -#MODE=2755
> -#GROUP=auth

There was a patch some time ago making use of those variables. If the file
permissions and owner/group have to be different on BSD, this should be kept
(but actually updated in the Makefile to be used), since config.mk is the place
for system dependent adaptions of the build, not Makefile. If they are the same
on the BSDs, this block can be removed of course.

> diff --git a/slock.c b/slock.c
> …
> +#else
> + if (rval[0] == '*' && rval[1] == '\0') {
> +#ifdef __OpenBSD__
> + if (!(pw = getpwnam_shadow(getenv("USER"))))
> + die("cannot retrieve shadow entry (make sure to suid or sgid slock)\n");
> + rval = pw->pw_passwd;
> +#else
> + die("cannot retrieve shadow entry (make sure to suid or sgid slock)\n");
> +#endif /* __OpenBSD__ */
> + }
> +#endif /* HAVE_SHADOW_H */

We should probably use another error message in the not __OpenBSD__ case, maybe
something like "slock: unknown shadow passwd system\n". Also please add the
"slock: " prefix to the other die() call.

--Markus
Received on Wed Sep 07 2016 - 11:42:04 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 07 2016 - 11:48:17 CEST