mcdope/pam_usb

pamusb-check works on tty1, but not tty2

Closed this issue · 5 comments

Which version of pam_usb are you running?

latest aur (0.8.3?)

Which distribution are you using?

CachyOS (Arch)

Which login manager and desktop environment are you using?

ly and openbox

What happened?

When I try running pamusb-check (username) on my normal window manager session, which runs in tty2, this is the debug output I get:

  • Authentication request for user "sixene" (pamusb-check)
    [src/local.c:227] Checking whether the caller (pamusb-check) is local or not...
    [src/local.c:238] Checking pid 56413 (pamusb-check)...
    [src/local.c:238] Checking pid 21800 (fish)...
    [src/local.c:238] Checking pid 2139 (urxvtd)...
    [src/local.c:238] Checking pid 1 (/sbin/init)...
    [src/local.c:296] Using DISPLAY :0 for utmp search
    [src/local.c:050] No utmp entry found for tty ":0"
    [src/local.c:312] Trying to get tty from display server
    [src/local.c:317] Retrying with tty /dev/tty2, obtained from display server, for utmp search
    [src/local.c:053] utmp entry for tty "tty2" found
    [src/local.c:054] utmp->ut_pid: 1991
    [src/local.c:055] utmp->ut_user: sixene
    [src/local.c:071] Checking utmp->ut_addr_v6[0]
    [src/local.c:071] Checking utmp->ut_addr_v6[1]
    [src/local.c:071] Checking utmp->ut_addr_v6[2]
  • Remote authentication request:
    [src/local.c:382] Confirmed remote request - denying.
  • Access denied.

This works fine on tty1, but I'm running my session on tty2, and attempting to change it to tty1 has been catastrophic.

Output of "pamusb-check --debug whoami"

Command listed here doesn't worked, however I have already attached the output of 'pamusb-check --debug sixene'

Output of "w"

❯ w
 19:59:50 up 31 min,  1 user,  load average: 0.62, 0.60, 0.73
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
sixene   tty2      19:29    5:16   9:55   0.09s /usr/lib/cachy-browser/cachy-b

Output of "loginctl"

❯ loginctl
SESSION  UID USER   SEAT  TTY 
      1 1000 sixene seat0 tty2

1 sessions listed.

This is pretty sure not related to the tty, but the session having ut_addr_v6 elements set while they should be null for a local session. Guess your login manager or something sets it to an empty string - in that case it will be easy to workaround. I will take a look somewhen in the next days. Expect to be tagged for testing a fixed build.

btw, no clue what version you have when using AUR - it's not maintained by myself :D

Alright, thank you! It’s amazing to see this repo be so active, I was kind of feeling hopeless when I saw that it was discontinued when researching 😅 I’d love to help test!

(also yeah, aur is 0.8.3, i just checked again)

mcdope commented

In case you would be still up for, I just pushed a branch that should fix your issue

Please try building & installing from branch dont-treat-empty-string-utaddr-as-remote

Considered fixed, please reopen if it still appears.