Fossil SCM

server command doesn't accept --localhost

Fixed

e704dbd96760f68… · opened 12 years, 9 months ago

Type
Code_Defect
Priority
Severity
Important
Resolution
Fixed
Subsystem
Created
June 24, 2013 8:58 a.m.

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--){}

Comments (1)

mjanssen 12 years, 9 months ago

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--){}

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button