Skip to content

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

Merged
ehsandeep merged 1 commit intodevfrom
issue-631-store-resp-dir-silently-fails
Jun 2, 2022
Merged

changed warning to error if the directory does not have write permission#650
ehsandeep merged 1 commit intodevfrom
issue-631-store-resp-dir-silently-fails

Conversation

@LuitelSamikshya
Copy link
Copy Markdown
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
Copy Markdown
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