Menu

#31 Authentincation bug with wget options

v1.0_(example)
closed-fixed
None
5
2014-12-12
2014-12-02
Dan Rich
No

There is a typo in the options to the --user option to wget in version 0.7.4 of podget. The code is adding a second equals sign which gets passed as the first character of the username.

--- /usr/bin/podget.orig    2014-12-02 11:21:32.954427328 -0800
+++ /usr/bin/podget 2014-12-02 11:37:03.646860926 -0800
@@ -1412,7 +1412,7 @@
             # Options --user and --password are used for both FTP and HTTP sessions.  Using --ftp-user and --http-user would require
                      # being able to selectively use the correct one based on the URL.  Same for --ftp-password and --http-password.
                                   if [ ! -z "${URL_USERNAME+set}" ]; then
                                   -                WGET_OPTIONS="${WGET_OPTIONS} --user==${URL_USERNAME}"
                                   +                WGET_OPTIONS="${WGET_OPTIONS} --user=${URL_USERNAME}"
                                                    echo "${WGET_OPTIONS}"
                                                                 fi

Discussion

  • Dan Rich

    Dan Rich - 2014-12-02

    I found a related bug. Having USER and PASS in the serverlist file will cause the directory name to have a trailing space. This is because the space stripping code only pulls off a single space and after removing the USER and PASS options there are two spaces. The following patch addresses that as well as fixing the formatting in the one above.

    --- /usr/bin/podget.orig    2014-12-02 11:21:32.954427328 -0800
    +++ /usr/bin/podget 2014-12-02 12:52:34.689228506 -0800
    @@ -1399,20 +1399,20 @@
                 fi
    
                 # Remove any residual trailing spaces from ${FEED_NAME}
    -            if [ "$(expr "${FEED_NAME}" : ".*[ ]\+$")" -gt 0 ]; then
    +            while [ "$(expr "${FEED_NAME}" : ".*[ ]\+$")" -gt 0 ]; do
                     FEED_NAME=${FEED_NAME%[ ]*}
    -            fi
    +            done
    
                 # Remove any residual leading spaces from ${FEED_NAME}
    -            if [ "$(expr "${FEED_NAME}" : "[ ]\+.*$")" -gt 0 ]; then
    +            while [ "$(expr "${FEED_NAME}" : "[ ]\+.*$")" -gt 0 ]; do
                     FEED_NAME=${FEED_NAME#[ ]*}
    -            fi
    +            done
    
                 # Add Username and Password to wget options if found.
                 # Options --user and --password are used for both FTP and HTTP sessions.  Using --ftp-user and --http-user would require
                 # being able to selectively use the correct one based on the URL.  Same for --ftp-password and --http-password.
                 if [ ! -z "${URL_USERNAME+set}" ]; then
    -                WGET_OPTIONS="${WGET_OPTIONS} --user==${URL_USERNAME}"
    +                WGET_OPTIONS="${WGET_OPTIONS} --user=${URL_USERNAME}"
                     echo "${WGET_OPTIONS}"
                 fi
    
     
  • Dave Vehrs

    Dave Vehrs - 2014-12-12
    • status: open --> closed-fixed
    • assigned_to: Dave Vehrs
     
  • Dave Vehrs

    Dave Vehrs - 2014-12-12

    The use of while loops to check for extra spaces rather than a simple loop is a nice touch and seems to guarantee that it will work in most cases.

    The extra equals sign, well what I can say I must have been staring at the code for long enough that it just blended together for me.

    Thanks for the patches! And if I haven't made any more slip-ups then version 0.7.5 should be ready for download today.

    Dave

     

Log in to post a comment.