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

ggshield fails with long paths #391

Closed
agateau-gg opened this issue Oct 18, 2022 · 0 comments · Fixed by #392
Closed

ggshield fails with long paths #391

agateau-gg opened this issue Oct 18, 2022 · 0 comments · Fixed by #392
Labels
regression A feature which used to work in the past does not work anymore, or a behavior changed status:confirmed This issue has been reviewed and confirmed type:bug Something isn't working

Comments

@agateau-gg
Copy link
Collaborator

Environment

  • ggshield version: 1.13.5
  • Operating system (Linux, macOS, Windows): any
  • Operating system version: any
  • Python version: 3.8.10

Describe the bug

When scanning a file whose path is longer than 255, ggshield fails.

Steps to reproduce:

  1. Create a long file. Can be done with:
    mkdir tmp  # use a dir because Python does not want to create a file longer than 255 chars
    python -c 'open("tmp/" + "l" * 255, "w").write("foo")'
    
  2. Run command ggshield secret scan path tmp/l*

Actual result:

Scanning Path... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 1 files scanned out of 1 0:00:00
Error: Error scanning, network error occurred: {0: {'filename': ['Longer than maximum length 256.']}}

Expected result: Scan should succeed

@agateau-gg agateau-gg added type:bug Something isn't working status:new This issue needs to be reviewed status:confirmed This issue has been reviewed and confirmed regression A feature which used to work in the past does not work anymore, or a behavior changed and removed status:new This issue needs to be reviewed labels Oct 18, 2022
agateau-gg added a commit that referenced this issue Oct 18, 2022
GitGuardian API does not accept paths longer than 256 characters. Truncate
longer paths to keep only the end.

Fixes a regression introduced in 1.13.3.

Fixes #391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression A feature which used to work in the past does not work anymore, or a behavior changed status:confirmed This issue has been reviewed and confirmed type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant