You are not logged in.

#1 2024-04-27 21:48:29

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 186

PKGBUILD - file source 403 error code

I'm creating the following PKGBUILD

pkgname=netbios-share-scanner
pkgver=1.0
pkgrel=2
pkgdesc='This tool could be used to check windows workstations and servers if they have accessible shared resources.'
arch=('any')
url='https://www.secpoint.com/netbios-share-scanner.html'
license=('BSD')
depends=('python')
source=("https://www.secpoint.com/freetools/$pkgname-$pkgver.zip")
sha512sums=('7ac4c309c348707015b6e0e77bb1fa9595762b9e0b1ea5dd462a8d9810e6eed5dea8131690e236c91ea399a72ae2aa8a267fd848809c97acda04b7d6f6878568')

package() {
  cd "nb${pkgver/./}"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.txt

  rm README.txt

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

and I note that, during the download of the source, I get the error:

curl: (56) The requested URL returned error: 403
==> ERROR: Failure while downloading https://www.secpoint.com/freetools/netbios-share-scanner-1.0.zip
    Aborting...
==> ERROR: Failed to generate new checksums

while, if I download the file by the browser, I can download it with no issues.

Is there a way to make the process to download it as well with no errors?

Offline

#2 2024-04-27 22:06:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,619

Re: PKGBUILD - file source 403 error code

Going to that URL in a browser throws an error as well. Your link is just bad, it's 'shares', not 'share'.

Offline

#3 2024-04-27 22:23:32

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 186

Re: PKGBUILD - file source 403 error code

Even if I add that "share" like:

source=("https://www.secpoint.com/freetools/netbios-shares-scanner-$pkgver.zip")

I continue to get:

==> ERROR: Failure while downloading https://www.secpoint.com/freetools/netbios-shares-scanner-1.0.zip
    Aborting...

Offline

#4 2024-04-27 22:25:17

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,619

Re: PKGBUILD - file source 403 error code

does it say why?

Offline

#5 2024-04-27 22:54:17

seth
Member
Registered: 2012-09-03
Posts: 51,945

Re: PKGBUILD - file source 403 error code

cloudflare (and 403 is "forbidden")
-b cookies -c cookies will only get you a block warning instead of the target url

It's somwhat possible to get around cloudflares security measures, but I'm not sure you can put that into the AUR.

Offline

#6 2024-04-28 10:58:11

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,982

Re: PKGBUILD - file source 403 error code

https://www.secpoint.com/freetools/netbios-shares-scanner-1.0.zip

does work from within firefox for me.

makepkg & wget are not able to download it though.
Maybe some kind of a redirection issue ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2024-04-28 12:47:25

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 186

Re: PKGBUILD - file source 403 error code

The HTTP response is 403 when using PKGBUILD (curl). By using Chromium, instead, it is downloaded with no errors.

Last edited by D3vil0p3r (2024-04-28 12:48:22)

Offline

#8 2024-04-28 13:42:49

seth
Member
Registered: 2012-09-03
Posts: 51,945

Re: PKGBUILD - file source 403 error code

Faking the user agent will actually do in this particular case.

Offline

#9 2024-04-28 13:53:21

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 186

Re: PKGBUILD - file source 403 error code

How can I fake it in the PKGBUILD?

Offline

#10 2024-04-28 14:12:20

seth
Member
Registered: 2012-09-03
Posts: 51,945

Offline

Board footer

Powered by FluxBB