Bug 204488 - anaconda's stage 1 doesn't follow http redirects
Summary: anaconda's stage 1 doesn't follow http redirects
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: anaconda
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: David Cantrell
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-08-29 14:52 UTC by Joshua Jensen
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-14 18:41:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joshua Jensen 2006-08-29 14:52:03 UTC
Description of problem:
If you have your kickstart file on the web, and point to it using a URL that
needs a redirect (via a 301 with a Location: line), it doesn't find it.  Since I
don't really know the correct terminology for what I'm saying here, an example
is in order:
   http://www.uiuc.edu/~menscher/
should redirect to:
   http://w3.physics.uiuc.edu/~menscher/

The linux installer isn't following that redirect.  It works fine if I point it
straight at the "final" destination.


How reproducible:
Always

Steps to Reproduce:
1.create a webpage with a redirect
2.put a kickstart file there
3.point anaconda at the webpage
    

Actual Results:  It tried a non-kickstart install.

Expected Results:  Should have followed the redirect.  Or at least warned that
it couldn't find it.  Doing something completely different is unacceptable.

Comment 1 Joshua Jensen 2006-08-29 14:56:04 UTC
This is not a duplicate of BZ #91488.  That bug is 3 years old, for RH9.  The
same problem occurs, but the product name is now RHEL4.  Please fix!  Many
content systems use redirects for optimizing server location and download speed.
 Anaconda is very basically broken on such networks.

Comment 3 Doug Scoular 2006-09-13 10:29:55 UTC
Hi,
Just to add to Joshua's report. This issue is 100% repeatable. The anaconda
"loader2" C code doesn't expect any HTTP response other than 200 (Success OK) or
404 (File not found) meaning that all other valid responses are not handled
correctly. There are, in fact, five broad categorisations of HTTP responses: 1XX
are informational, 2XX are success related, 3XX are redirection related, 4XX are
client error related and 5XX are server error related. Our interest here is the
fact that valid 3XX responses are completely ignored by Anaconda's "loader2" C code.

For a complete list of HTTP response codes please consult:

   http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

The problem code can be found in the anaconda-10.1.1.37 SRPM in the file:

anaconda-10.1.1.37/loader2/ftp.c

Starting at line 547 we see:

            if (!strcmp(start, "404")) {
                close(sock);
                return FTPERR_FILE_NOT_FOUND;
            } else if (strcmp(start, "200")) {
                close(sock);
                return FTPERR_BAD_SERVER_RESPONSE;
            }

This code can be trivially expanded to deal with 3XX redirection related responses.

Since transparent redirection is very common in global enterprises and ISPs
please consider implementing a fix for this issue.

Many thanks,

Doug Scoular



Comment 4 Doug Scoular 2006-09-13 10:47:52 UTC
Hi,

I just checked the anaconda-11.1.0.95 source and can confirm that it still has
this issue. Looking at line 694 of anaconda-11.1.0.95/loader2/ftp.c we see the
problem code has been enhanced slightly to deal with 403 (Forbidden) but still
nothing to handle 3XX (Redirection):

            if (!strcmp(start, "404")) {
                close(sock);
                return FTPERR_FILE_NOT_FOUND;
            } else if (!strcmp(start, "403")) {
                close(sock);
                return FTPERR_PERMISSION_DENIED;
            } else if (strcmp(start, "200")) {
                close(sock);
                logMessage(ERROR, "bad HTTP response: %s", start);
                return FTPERR_BAD_SERVER_RESPONSE;
            }

Cheers,

Doug Scoular


Comment 5 Chris Lumens 2006-09-14 18:41:13 UTC
This will be fixed in the next build of anaconda (and therefore FC6 and RHEL5).
 If you require this functionality in an update release of RHEL4, please talk to
your support representative who will raise the issue through the appropriate
support channels.


Note You need to log in before you can comment on or make changes to this bug.