Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dont-treat-empty-st…
Browse files Browse the repository at this point in the history
…ring-utaddr-as-remote
  • Loading branch information
mcdope committed Jan 2, 2024
2 parents 35c6ed4 + c5c336f commit 9cf1e0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-build-on-own-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" scp -r ${{ secrets.TEST_RUNNER_USER_NEW }}@${{ secrets.TEST_RUNNER_HOST_NEW }}:/home/${{ secrets.TEST_RUNNER_USER_NEW }}/pam_usb_nightly_$GITHUB_RUN_ID/.build .
run: sshpass -p "$TEST_RUNNER_PASS_NEW" scp -P ${{ secrets.TEST_RUNNER_PORT_NEW }} -r ${{ secrets.TEST_RUNNER_USER_NEW }}@${{ secrets.TEST_RUNNER_HOST_NEW }}:/home/${{ secrets.TEST_RUNNER_USER_NEW }}/pam_usb_nightly_$GITHUB_RUN_ID/.build .
- name: Rename generated package files
run: mv .build/*.zst .build/pam_usb-nightly-`date +%Y%m%d`-x86_64.pkg.tar.zst && mv .build/*.deb .build/pam_usb-nightly-`date +%Y%m%d`_amd64.deb && mv .build/*.rpm .build/pam_usb-nightly-`date +%Y%m%d`.x86_64.rpm && mv .build/*.gz .build/pam_usb-nightly-`date +%Y%m%d`.tar.gz
- name: Upload nightly packages
Expand Down
7 changes: 4 additions & 3 deletions src/local.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ char *pusb_get_tty_by_loginctl()
}
}

char *pusb_is_loginctl_local()
int pusb_is_loginctl_local()
{
char loginctl_cmd[BUFSIZ] = "LOGINCTL_SESSION_ID=`loginctl user-status | grep -m 1 \"├─session-\" | grep -o '[0-9]\\+'`; loginctl show-session $LOGINCTL_SESSION_ID -p Remote | awk -F= '{print $2}'";
char buf[BUFSIZ];
Expand Down Expand Up @@ -363,8 +363,7 @@ int pusb_local_login(t_pusb_options *opts, const char *user, const char *service
{
log_debug(" Trying to check for remote access by loginctl\n");

char *loginctl_remote = (char *)xmalloc(2);
loginctl_remote = pusb_is_loginctl_local(); //@todo: why the heck did i make this return char? oO
int loginctl_remote = pusb_is_loginctl_local();
if (loginctl_remote != 0)
{
log_debug(" loginctl says this session is local\n");
Expand All @@ -385,6 +384,8 @@ int pusb_local_login(t_pusb_options *opts, const char *user, const char *service
{
log_debug(" Failed, could not obtain tty from loginctl - see line before this for reason.\n", loginctl_tty);
}

xfree(loginctl_tty);
}
}
}
Expand Down

0 comments on commit 9cf1e0d

Please sign in to comment.