Skip to content

Commit

Permalink
local.c: #8: Fix local detection once more, this time for gdm etc
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdope committed Aug 23, 2020
1 parent a08d741 commit 9766b13
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/local.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ int pusb_local_login(t_pusb_options *opts, const char *user)
from = ttyname(STDIN_FILENO);
if (!from || !(*from))
{
log_debug("Couldn't retrieve the tty name, aborting.\n");
return (0);
if (!opts->unknown_pts_as_local) {
log_debug("Couldn't retrieve the tty name, aborting.\n");
return (0);
}

log_debug("Couldn't retrieve the tty name, assuming local pseudo terminal\n");
return (1);
}
if (!strncmp(from, "/dev/", strlen("/dev/")))
from += strlen("/dev/");
Expand Down

0 comments on commit 9766b13

Please sign in to comment.