Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo testing using -l #221

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
c.sudofunc = sudoNoop
return
}
if c.Exec(`sudo -n true`) == nil {
if c.Exec(`sudo -n -l`) == nil {
// user has passwordless sudo
c.sudofunc = sudoSudo
return
Expand Down Expand Up @@ -382,8 +382,8 @@

// Upload copies a file from a local path src to the remote host path dst. For
// smaller files you should probably use os.WriteFile
func (c *Connection) Upload(src, dst string, opts ...exec.Option) error {

Check failure on line 385 in connection.go

View workflow job for this annotation

GitHub Actions / Lint

unnecessary leading newline (whitespace)

Check failure on line 386 in connection.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofumpt`-ed (gofumpt)
if err := c.checkConnected(); err != nil {
return err
}
Expand Down
Loading