Skip to content

[redhat,upload] Fix issue with upload permission error due to not#4275

Merged
TurboTurtle merged 1 commit intososreport:mainfrom
dwolstroRH:upload_issues
Apr 9, 2026
Merged

[redhat,upload] Fix issue with upload permission error due to not#4275
TurboTurtle merged 1 commit intososreport:mainfrom
dwolstroRH:upload_issues

Conversation

@dwolstroRH
Copy link
Copy Markdown
Contributor

            switching into the user directory prior to
            putting the file to the sftp directory.

Related: RHEL-52919


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/sosreport-sos-4275
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Comment thread sos/upload/targets/__init__.py Outdated
# already in the user directory so set user_dir to None
if user_dir:
ret.sendline('pwd')
ret.expect('sftp> ')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's worth adding more to the pattern, like in:
https://github.com/dwolstroRH/sos/blob/f8c2d94a3e98d86c1fb20dae58ea6b80c059a43d/sos/upload/targets/__init__.py#L523
At least adding:

            pexpect.TIMEOUT,
            pexpect.EOF

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And perhaps also things like "command not found" or similar, in case the server doesn't support PWD

Comment thread sos/upload/targets/__init__.py Outdated
if user_dir:
ret.sendline('pwd')
ret.expect('sftp> ')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And check the result and print a message for the end user, i.e.:

pwd_expects =  [
            'sftp>',
            'Invalid command.',
            pexpect.TIMEOUT,
            pexpect.EOF
        ]
pwd_cmd = ret.expect('sftp> ')
if pwd_cmd == 1:
    self.ui_log.info(
            _("The server doesn't support the PWD command")
    )

Perhaps not using ui_log, it's just a suggestion.

@pmoravec
Copy link
Copy Markdown
Contributor

Ack up to the Jose's comments.

                switching into the user directory prior to
                putting the file to the sftp directory.

Related: RHEL-52919

Signed-off-by: David Wolstromer <dwolstro@redhat.com>
@jcastill jcastill added Kind/Upload upload component of sos Reviewed/Needs 2nd Ack Require a 2nd ack from a maintainer labels Apr 9, 2026
@TurboTurtle TurboTurtle added Reviewed/Ready for Merge Has been reviewed, ready for merge and removed Reviewed/Needs 2nd Ack Require a 2nd ack from a maintainer labels Apr 9, 2026
@TurboTurtle TurboTurtle merged commit c5a276c into sosreport:main Apr 9, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind/Upload upload component of sos Reviewed/Ready for Merge Has been reviewed, ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants