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

[fix]: permissions for keploy folder #1699

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AhmedLotfy02
Copy link
Contributor

Related Issue

  • Unable to delete keploy generated folder due to permission

Closes: #1696

Describe the changes you've made

  • Adding permissions to the folder

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Please let us know if any test cases are added

Please describe the tests(if any). Provide instructions how its affecting the coverage.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

A clear and concise description of it.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Screenshots (if any)

Original Updated
original screenshot updated screenshot

@@ -155,6 +157,14 @@
utils.LogError(Logger, err, "failed to close the yaml file", zap.String("path directory", path), zap.String("yaml", fileName))
return false, err
}

basePath := path[:strings.LastIndex(path, "/")]
cmd := exec.Command("sudo", "chmod", "-R", "777", basePath)

Check failure

Code scanning / CodeQL

Command built from user-controlled sources Critical

This command depends on a
user-provided value
.
This command depends on a
user-provided value
.
@EraKin575
Copy link
Contributor

@AhmedLotfy02 the CI is failing. please check

Signed-off-by: AhmedLotfy02 <[email protected]>
Signed-off-by: AhmedLotfy02 <[email protected]>
Copy link
Contributor Author

@AhmedLotfy02 AhmedLotfy02 left a comment

Choose a reason for hiding this comment

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

@EraKin575 I added path validation and sanitization but still the same.

@AhmedLotfy02
Copy link
Contributor Author

AhmedLotfy02 commented Mar 16, 2024

I checked os.Chmod instead of exec.Command but it gives permissions to the directory but not for the inside folders
image

@shivamsouravjha
Copy link
Contributor

tried this locally, doesn't work, not only does the Keploy folder isn't deleted, even normal keploy doesn't work
image

@shivamsouravjha
Copy link
Contributor

image solve this as well

@shivamsouravjha
Copy link
Contributor

@AhmedLotfy02 please update the PR as pipeline is failing, also fix the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: unable to delete keploy generated folder due to permission
3 participants