desklock - make it fail to lock on non-bsd platforms if no pam support

if no pam support detected at build time, dont even lock to begin
with. this should fix T6779

yes - even better is making pam a requirement for building and to be
optionallhy disabled, but then even if disabled we still need this check.

this has been a long long long standing bug in e. i think this is why
we had some reports of "any password unlocks e" - because it was built
without pam support and before auth was always succeeding without pam.
now it is always FAILING instead (which is probably better).

@fix
This commit is contained in:
Carsten Haitzler 2018-03-20 18:42:18 +09:00
parent 0d9a763165
commit 71d481b4c4
1 changed files with 9 additions and 0 deletions

View File

@ -247,6 +247,15 @@ e_desklock_show(Eina_Bool suspend)
E_Desklock_Hide_Cb hide_cb;
E_Zone *zone;
#if !defined(HAVE_PAM) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
e_util_dialog_show(_("Cannot use password authentication"),
_("Enlightenment was built without PAM support.<br>"
"This means Enlightenment cannot authenticate<br>"
"your password. This means locking makes no<br>"
"sense because we have no other way to authenticate<br>"
"you as a user."));
return EINA_FALSE;
#endif
if (_e_desklock_state) return EINA_TRUE;
if (e_desklock_is_external() && e_config->desklock_custom_desklock_cmd && e_config->desklock_custom_desklock_cmd[0])