Browse Source

Fix deny_remote behavior

master
Pekka Helenius 3 years ago
parent
commit
aa63b60b1e
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/local.c
  2. +2
    -2
      src/pam.c

+ 2
- 2
src/local.c View File

@ -39,7 +39,7 @@ int pusb_local_login(t_pusb_options *opts, const char *user)
if (!from || !(*from))
{
log_debug("Couldn't retrieve the tty name, aborting.\n");
return (1);
return (0);
}
if (!strncmp(from, "/dev/", strlen("/dev/")))
from += strlen("/dev/");
@ -52,7 +52,7 @@ int pusb_local_login(t_pusb_options *opts, const char *user)
{
log_debug("No utmp entry found for tty \"%s\"\n",
from);
return (1);
return (0);
}
for (i = 0; i < 4; ++i)
{


+ 2
- 2
src/pam.c View File

@ -69,7 +69,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
log_info("Authentication request for user \"%s\" (%s)\n",
user, service);
if (pam_get_item(pamh, PAM_TTY,
/* if (pam_get_item(pamh, PAM_TTY,
(const void **)(const void *)&tty) == PAM_SUCCESS)
{
if (tty && !strcmp(tty, "ssh"))
@ -77,7 +77,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
log_debug("SSH Authentication, aborting.\n");
return (PAM_AUTH_ERR);
}
}
}*/
if (!pusb_local_login(&opts, user))
{
log_error("Access denied.\n");


Loading…
Cancel
Save