Fossil

Ticket Change Details
Login
Overview

Artifact ID: bd6d1958ba0a71ba16a8b481d6b9c2951daf452e
Ticket: e704dbd96760f6817bc156a8b510bd15430e81b9
server command doesn't accept --localhost
User & Date: mjanssen 2013-06-24 08:58:42
Changes

  1. foundin changed to: "ae0124439685c110"
  2. icomment:
    The server command doesn't accept --localhost. The reason is that in main.c the argument count check for the server command is done before the check for the --localhost option.
    
    Diff below should fix it (can't test atm)
    
    Index: src/main.c
    ==================================================================
    --- src/main.c
    +++ src/main.c
    @@ -1803,18 +1803,19 @@
       zPort = find_option("port", "P", 1);
       zNotFound = find_option("notfound", 0, 1);
       zAltBase = find_option("baseurl", 0, 1);
       if( zAltBase ){
         set_base_url(zAltBase);
    +  }
    +  if ( find_option("localhost", 0, 0)!=0 ){
    +    flags |= HTTP_SERVER_LOCALHOST;
       }
       if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
       isUiCmd = g.argv[1][0]=='u';
       if( isUiCmd ){
         flags |= HTTP_SERVER_LOCALHOST;
         g.useLocalauth = 1;
    -  }else if ( find_option("localhost", 0, 0)!=0 ){
    -    flags |= HTTP_SERVER_LOCALHOST;
       }
       find_server_repository(isUiCmd && zNotFound==0);
       if( zPort ){
         int i;
         for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){}
    
  3. login: "mjanssen"
  4. mimetype: "text/x-fossil-plain"
  5. severity changed to: "Important"
  6. status changed to: "Open"
  7. title changed to: "server command doesn't accept --localhost"
  8. type changed to: "Code_Defect"