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

Fixed permission issues on client #1960

Merged
merged 2 commits into from
Nov 8, 2016
Merged

Fixed permission issues on client #1960

merged 2 commits into from
Nov 8, 2016

Conversation

diptanu
Copy link
Contributor

@diptanu diptanu commented Nov 8, 2016

Fixes #1916

destDir := filepath.Join(taskdir, dest)
if err := os.MkdirAll(destDir, s.Mode().Perm()); err != nil {
return fmt.Errorf("Couldn't create destination directory %v: %v", destDir, err)
// Create destination directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move the comment above or leave a blank line in-between

if err := os.MkdirAll(destDir, s.Mode().Perm()); err != nil {
return fmt.Errorf("Couldn't create destination directory %v: %v", destDir, err)
if err := d.createDir(taskdir, filepath.Dir(dest)); err != nil {
return fmt.Errorf("Couldn't create destination directory 11 %v: %v", dest, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

directory 11?

return fmt.Errorf("Couldn't create destination directory %v: %v", destDir, err)
// Create destination directory.
if err := d.createDir(taskdir, dest); err != nil {
return fmt.Errorf("Couldn't create destination directory 22 %v: %v", destDir, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

22

if err != nil {
return err
}
for i := len(filePerms) - 1; i >= 0; i-- {
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment why you are going backwards

Perm os.FileMode
}

// splitPath stats each subdirectory of a path
Copy link
Contributor

Choose a reason for hiding this comment

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

The order that is returned?

var mode os.FileMode
i, err := os.Stat(path)
if err != nil {
mode = os.ModePerm
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment what this is doing

@diptanu diptanu merged commit c226599 into master Nov 8, 2016
@diptanu diptanu deleted the fix-perm-issues branch November 8, 2016 20:57
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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

Successfully merging this pull request may close these issues.

None yet

2 participants