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

Don't overwrite directory permissions on --chown #389

Closed
wants to merge 1 commit into from

Conversation

bertinatto
Copy link
Contributor

In a previous PR ( #336) I failed to check if my changes were changing the ownership of:

  1. existent target directory
  2. existing files in the target directory

As a result, I'm proposing these changes to fix that.

I'm happy to re-work my patch if you think the approach isn't appropriate.

Thanks.

@rh-atomic-bot
Copy link
Collaborator

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

@bertinatto bertinatto force-pushed the fix-permission branch 12 times, most recently from 9bb6e72 to 0ed4720 Compare January 13, 2018 19:17
@nalind
Copy link
Member

nalind commented Jan 15, 2018

bot, add author to whitelist

add.go Outdated
return errors.Wrapf(err, "error ensuring directory %q exists", path)
}
if err := os.Chown(path, int(user.UID), int(user.GID)); err != nil {
return errors.Wrapf(err, "error ensuring directory %q exists", path)
Copy link
Member

Choose a reason for hiding this comment

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

SHouldn't this be
"error setting ownership of %q"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing!

add.go Outdated
@@ -154,14 +154,14 @@ func (b *Builder) Add(destination string, extract bool, options AddAndCopyOption
// to create it first, so that if there's a problem,
// we'll discover why that won't work.
d := dest
if err := os.MkdirAll(d, 0755); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Nit, should just remove d and use dest everywhere.

Signed-off-by: Fabio Bertinatto <fbertina@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Jan 24, 2018

LGTM
@nalind PTAL

Copy link
Collaborator

@boaz0 boaz0 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@rhatdan
Copy link
Member

rhatdan commented Jan 30, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 1085598 has been approved by rhatdan

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 1085598 with merge 61f5319...

@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr
Approved by: rhatdan
Pushing 61f5319 to master...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants