Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

agent: add --key-dir as a flag, and warn if key dir is a symlink.#14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@andersju
Copy link
Contributor

@andersjuandersju commentedAug 2, 2023
edited
Loading

I noticed thatssh-tpm-agent won't load keys if$HOME/.ssh is a symlink (and won't complain either), becausefilepath.WalkDir doesn't follow symbolic links. Made me scratch my head for a minute :) I really don't know much about Go, but this seems like a simple fix. Thanks for a sweet tool!


Edit - changed to: add--key-dir as a flag, and warn if key dir is a symlink. (See below.)

@Foxboron
Copy link
Owner

Symlinks are generally a bit iffy so I need to think alittle bit about scenarios here.

Usually you don't want to arbitrary eval these things. Thoughts@stigtsp?

Can run the test suite and probably iterate on it thought, thanks!

@andersjuandersju temporarily deployed to Build, sign, release binariesAugust 2, 2023 21:13 — withGitHub Actions Inactive
@andersjuandersju temporarily deployed to Build, sign, release binariesAugust 2, 2023 21:13 — withGitHub Actions Inactive
@andersjuandersju temporarily deployed to Build, sign, release binariesAugust 2, 2023 21:13 — withGitHub Actions Inactive
@andersju
Copy link
ContributorAuthor

Yeah, I wasn't sure; maybe just warn if~/.ssh is not a directory, or if no keys were loaded, and/or make the path configurable (this comment might be better suited for#3 I realize).

@stigtsp
Copy link
Contributor

Imho, an argument to the agent specifying a key dir makes more sense, for cases where you want keys to be stored somewhere else.

@Foxboron
Copy link
Owner

Yeah, I wasn't sure; maybe just warn if ~/.ssh is not a directory, or if no keys were loaded, and/or make the path configurable (this comment might be better suited for#3 I realize).

Lets implement--key-dir as a flag and rather warn if~/.ssh is a symlink :)

Would you be interested doing the work? It shouldn't be very hard.

@andersjuandersjuforce-pushed thefix/follow-sshdir-symlink branch from14a1f24 toffeafa3CompareAugust 5, 2023 22:39
@andersju
Copy link
ContributorAuthor

Yeah, I wasn't sure; maybe just warn if ~/.ssh is not a directory, or if no keys were loaded, and/or make the path configurable (this comment might be better suited for#3 I realize).

Lets implement--key-dir as a flag and rather warn if~/.ssh is a symlink :)

Would you be interested doing the work? It shouldn't be very hard.

Sure! See latest commit. I rebased and added--key-dir and a warning. MovedGetSSHDir() to utils (couldn't think of anything better than misc at the moment, and it felt misc-y).

@Foxboron
Copy link
Owner

Looks great, thank you!

utils (couldn't think of anything better than misc at the moment, and it felt misc-y).

It could probably just stay insideutils.go frankly. No use having a single file for one function :)

@andersjuandersju temporarily deployed to Build, sign, release binariesAugust 6, 2023 09:09 — withGitHub Actions Inactive
@andersjuandersju temporarily deployed to Build, sign, release binariesAugust 6, 2023 09:09 — withGitHub Actions Inactive
@andersjuandersju temporarily deployed to Build, sign, release binariesAugust 6, 2023 09:09 — withGitHub Actions Inactive
@FoxboronFoxboron changed the titleagent: evaluate symlinks in GetSSHDiragent: add --key-dir as a flag, and warn if key dir is a symlink.Aug 6, 2023
@andersju
Copy link
ContributorAuthor

It could probably just stay insideutils.go frankly. No use having a single file for one function :)

👍 renamed it

@Foxboron
Copy link
Owner

Thanks!

@FoxboronFoxboron merged commit88453f0 intoFoxboron:masterAug 6, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@andersju@Foxboron@stigtsp

[8]ページ先頭

©2009-2025 Movatter.jp