Skip to content

Commit

Permalink
Fix deny_remote behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Fincer committed May 21, 2020
1 parent e8e44fd commit aa63b60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/local.c
Original file line number Diff line number Diff line change
Expand Up @@ -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/");
Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/pam.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ 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"))
{
log_debug("SSH Authentication, aborting.\n");
return (PAM_AUTH_ERR);
}
}
}*/
if (!pusb_local_login(&opts, user))
{
log_error("Access denied.\n");
Expand Down

0 comments on commit aa63b60

Please sign in to comment.