Opened 3 years ago

Closed 3 years ago

#659 closed defect (fixed)

"update-smart-drivedb" uses old sourceforge HTTP link

Reported by: ackackack Owned by: Christian Franke
Priority: minor Milestone: Release 6.5
Component: drivedb Version: 6.4
Keywords: Cc:

Description

When curl is used in the drivedb update script it does not follow the redirect as given by sourceforge for http to https

Curl can be told to follow redirects with the -L option

Here is a simple patch that seems to solve this issue:

@@ -77,7 +77,7 @@
 for t in $os_dltools; do
   if which $t >/dev/null 2>/dev/null; then
     case $t in
-      curl)  DOWNLOAD="curl ${q:+-s }"'-f -o "$DEST.new" "$SRC"' ;;
+      curl)  DOWNLOAD="curl -L ${q:+-s }"'-f -o "$DEST.new" "$SRC"' ;;
       lynx)  DOWNLOAD='lynx -source "$SRC" >"$DEST.new"' ;;
       wget)  DOWNLOAD="wget $q"'-O "$DEST.new" "$SRC"' ;;
       fetch) DOWNLOAD='fetch -o "$DEST.new" "$SRC"' ;; # FreeBSD

As an alternative the URL for the updates could be modified to look to https instead of http:

@@ -40,7 +40,7 @@
 SMARTCTL="$sbindir/smartctl"

 # Download URL for sourceforge code browser
-SRCEXPR='http://sourceforge.net/p/smartmontools/code/HEAD/tree/$location/smartmontools/drivedb.h?format=raw'
+SRCEXPR='https://sourceforge.net/p/smartmontools/code/HEAD/tree/$location/smartmontools/drivedb.h?format=raw'

 # Parse options
 q="-q "

Change History (3)

comment:1 Changed 3 years ago by Alex Samorukov

I think its a good idea to switch to HTTPS - we had to use http because SF was not supporting https for anonymous fetch for a very long time.

comment:2 Changed 3 years ago by Christian Franke

Keywords: drivedb update curl redirect removed
Milestone: Release 6.5
Owner: set to Christian Franke
Status: newaccepted
Summary: "update-smart-drivedb" use of curl does not follow redirects"update-smart-drivedb" uses old sourceforge HTTP link

The reworked (r4180, r4181, r4182, r4184) version of update-smart-drivedb is not affected unless -u sf option is used. Redirects are disabled intentionally.

Leaving this ticket open because update-smart-drivedb -u sf should be fixed.

Note that the problem will never be fixed in Debian and Ubuntu packages as maintainers decided to remove the script, see Debian Bug #804299.

comment:3 Changed 3 years ago by Christian Franke

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.