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

changed warning to error if the directory does not have write permission #650

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

LuitelSamikshya
Copy link
Contributor

@LuitelSamikshya LuitelSamikshya commented Jun 1, 2022

This PR displays an error if the user attempts to store response in a directory with no write permission.
Test: Create a directory without write permission, run echo 'example.com' | ./httpx -store-response-dir ./no_write_permission_dir/

@LuitelSamikshya LuitelSamikshya self-assigned this Jun 1, 2022
@LuitelSamikshya LuitelSamikshya added Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Jun 1, 2022
@LuitelSamikshya LuitelSamikshya requested a review from Mzack9999 June 1, 2022 18:34
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

$ mkdir dir_no_write
$ chmod 400 dir_no_write/
$ touch dir_no_write/test.txt
touch: dir_no_write/test.txt: Permission denied
$ echo 'example.com' | go run . -store-response-dir ./dir_no_write/

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/              v1.2.1

                projectdiscovery.io

Use with caution. You are responsible for your actions.
Developers assume no liability and are not responsible for any misuse or damage.
[ERR] Could not write response at path 'dir_no_write/example.com.txt', to disk: open dir_no_write/example.com.txt: permission denied
https://example.com

@Mzack9999 Mzack9999 requested a review from ehsandeep June 1, 2022 21:16
@ehsandeep ehsandeep merged commit b52da3a into dev Jun 2, 2022
@ehsandeep ehsandeep deleted the issue-631-store-resp-dir-silently-fails branch June 2, 2022 17:28
@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"-store-response-dir" silently fails if the directory is not writeable
3 participants