Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

installing dirb fails Errno::ENOTEMPTY #21

Open
gorzilla opened this issue Oct 16, 2018 · 15 comments
Open

installing dirb fails Errno::ENOTEMPTY #21

gorzilla opened this issue Oct 16, 2018 · 15 comments

Comments

@gorzilla
Copy link

I'm using mojave

==> Installing sidaf/pentest/dirb
==> Downloading http://downloads.sourceforge.net/project/dirb/dirb/2.22/dirb222.tar.gz
==> Downloading from https://kent.dl.sourceforge.net/project/dirb/dirb/2.22/dirb222.tar.gz
######################################################################## 100.0%
cp: /private/tmp/d20181016-34625-11yurq4/dirb222/.: Permission denied
Error: An exception occurred within a child process:
Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - /private/tmp/d20181016-34625-11yurq4

@salleh
Copy link

salleh commented Nov 25, 2018

using mojave and having the same problem too.

running brew install with verbose and debug switches on shows this:

== all expected initial output ==
==> Verifying 909dd856145ab18654a4e71ceb4f22cebcead82af6346b217b84864203a2e05a--dirb222.tar.gz checksum
tar xf --removed--dirb222.tar.gz -C /private/tmp/d20181125-45893-15ydh35
cp -pR /private/tmp/d20181125-45893-15ydh35/dirb222/. /private/tmp/dirb-20181125-45893-1m4ygmc/dirb222
cp: /private/tmp/d20181125-45893-15ydh35/dirb222/.: Permission denied

The cp -pR command cause the problem as at that stage, dirb222 directory still has permission 644 when extracted.

why the command >> system "chmod", "-R", "744", "dirb222" did not take place at this time?

I'm quite new to homebrew hence not sure how the homebrew formula steps is being carried out at this point of the execution.

@Ahren-Posthumus
Copy link

So no solution yet?

@Ahren-Posthumus
Copy link

On mac: It seems to be a permission issue, So I tried multiple things. The closest I got was by moving the archive to an accessible directory with
mv /Users/<user>/Library/Caches/Homebrew/downloads/<guid>-dirb222.tar.gz
Then double clicked on that to extract it. I then did a recursive chmod to give permissions on all files inside
chmod -R 774 dirb222/*
Then I re-compressed the directory with the same name as the original (obvs first delete the original to avoid a collision)
tar -zcvf <guid>-dirb222.tar.gz dirb222
Them move that compressed file back to /Users//Library/Caches/Homebrew/downloads/

Now the issue that you will face is that the checksum won't match up. Run brew install dirb again , you will get an error telling you this. Copy the 'actual'. Seeing as you edited the file yourself and can trust it, you can just locate the formula-- The thing that tells brew how to install the package-- (most likely here: /usr/local/Homebrew/Library/Taps/sidaf/homebrew-pentest/dirb.rb) and update the md5 checksum manually. If you open the file with nano or vim you will see the header there. edit it with the 'actual' that you copied.

This gets me past the error, but then the chmod breaks... so i don't know... I tried messing with the formula a little more, to no avail. Hopefully someone else can get us past this next hurdle.

@ghost
Copy link

ghost commented Mar 5, 2019

After following the steps above:

I literally just changed the directories in the tap.rb to the full path in /private/tmp and got as far as it failing to link (at which point I just ran brew link --overwrite dirb).

Seems to work.

@zoro96
Copy link

zoro96 commented Mar 8, 2019

Exactly the same problem

:~$brew install sidaf/pentest/dirb

==> Installing dirb from sidaf/pentest
==> Downloading http://downloads.sourceforge.net/project/dirb/dirb/2.22/dirb222.tar.gz
Already downloaded: /Users/zoro/Library/Caches/Homebrew/downloads/909dd856145ab18654a4e71ceb4f22cebcead82af6346b217b84864203a2e05a--dirb222.tar.gz
cp: /private/tmp/d20190309-17893-1oushhe/dirb222/.: Permission denied
Error: An exception occurred within a child process:
Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - /private/tmp/d20190309-17893-1oushhe

@markroxor
Copy link

same -

Updating Homebrew...
==> Installing dirb from sidaf/pentest
==> Downloading http://downloads.sourceforge.net/project/dirb/dirb/2.22/dirb222.tar.gz
Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/909dd856145ab18654a4e71ceb4f22cebcead82af6346b217b84864203a2e05a--dirb222.tar.gz
cp: /private/tmp/d20190413-8564-1kci0mv/dirb222/.: Permission denied
Error: An exception occurred within a child process:
  Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - /private/tmp/d20190413-8564-1kci0mv

@ghost
Copy link

ghost commented Apr 13, 2019

No-one is going to fix it guys, look at the README just do it yourself. What to do is right here in the above posts :P

@markroxor
Copy link

@6661696c Can you elaborate your solution? Did it really work?

@ghost
Copy link

ghost commented Apr 13, 2019

Unextract, chmod, retar, change checksum, rename directory in tar.rb to where it actually is in /tmp/private, and after linking fails brew link --overwrite dirb

And it worked for me.

@pjpronk
Copy link

pjpronk commented May 31, 2019

The explanation that 6661696c provided is correct, but a bit short and confusing. If you have followed along to the explanation given by Ahren-Posthumus, you have come to a point where the following error occurs.

chmod: dirb222: No such file or directory

This is the error that we have to resolve. We resolve this by changing the following lines in /usr/local/Homebrew/Library/Taps/sidaf/homebrew-pentest/dirb.rb:

system "chmod", "-R", "744", "dirb222"
cd "dirb222" do

We change these line to:

system "chmod", "-R", "744", "/private/tmp/<guid>/dirb222"
cd "/private/tmp/<guid>/dirb222" do

In my case this fix worked and I can simply run dirb from the command line.
If there are still linking issues try brew link --overwrite dirb

@SwordFaith
Copy link

I have forked this repo and got this issue fixed. If anybody want use it, try brew install swordfith/pentest/dirb pls. And I proposed a pull request, hope sidaf can accept that.

@mgoodric
Copy link

@SwordFaith I believe you meant brew install swordfaith/pentest/dirb (missing a in swordfaith)

@sousou39
Copy link

sousou39 commented Oct 8, 2019

Thanks a lot mgoodric for this solution

@armanayvazyan
Copy link

thanks a lot

@bclark08
Copy link

bclark08 commented Nov 3, 2020

@SwordFaith Thank you so much, and I think you were right to issue a pull request. This is a major issue.

@mgoodric Thanks so much for the typo solve.

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

No branches or pull requests