|
|
|
@ -69,7 +69,7 @@ func ParseFlagsAndSetup(proto string) {
|
|
|
|
|
// Check valid values for BindAddr and Hostname
|
|
|
|
|
if Hostname == "" {
|
|
|
|
|
if Bind == "" {
|
|
|
|
|
SystemLog.Fatalf(hostnameBindEmptyStr)
|
|
|
|
|
SystemLog.Fatal(hostnameBindEmptyStr)
|
|
|
|
|
}
|
|
|
|
|
Hostname = Bind
|
|
|
|
|
}
|
|
|
|
@ -112,40 +112,40 @@ func ParseFlagsAndSetup(proto string) {
|
|
|
|
|
|
|
|
|
|
// If no restricted paths provided, set to the disabled function. Else, compile and enable
|
|
|
|
|
if *restrictedPathsList == "" {
|
|
|
|
|
SystemLog.Infof(pathRestrictionsDisabledStr)
|
|
|
|
|
SystemLog.Info(pathRestrictionsDisabledStr)
|
|
|
|
|
IsRestrictedPath = isRestrictedPathDisabled
|
|
|
|
|
} else {
|
|
|
|
|
SystemLog.Infof(pathRestrictionsEnabledStr)
|
|
|
|
|
SystemLog.Info(pathRestrictionsEnabledStr)
|
|
|
|
|
restrictedPaths = compileRestrictedPathsRegex(*restrictedPathsList)
|
|
|
|
|
IsRestrictedPath = isRestrictedPathEnabled
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If no hidden paths provided, set to the disabled function. Else, compile and enable
|
|
|
|
|
if *hiddenPathsList == "" {
|
|
|
|
|
SystemLog.Infof(pathHidingDisableStr)
|
|
|
|
|
SystemLog.Info(pathHidingDisableStr)
|
|
|
|
|
IsHiddenPath = isHiddenPathDisabled
|
|
|
|
|
} else {
|
|
|
|
|
SystemLog.Infof(pathHidingEnabledStr)
|
|
|
|
|
SystemLog.Info(pathHidingEnabledStr)
|
|
|
|
|
hiddenPaths = compileHiddenPathsRegex(*hiddenPathsList)
|
|
|
|
|
IsHiddenPath = isHiddenPathEnabled
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If no remapped paths provided, set to the disabled function. Else, compile and enable
|
|
|
|
|
if *remapRequestsList == "" {
|
|
|
|
|
SystemLog.Infof(requestRemapDisabledStr)
|
|
|
|
|
SystemLog.Info(requestRemapDisabledStr)
|
|
|
|
|
RemapRequest = remapRequestDisabled
|
|
|
|
|
} else {
|
|
|
|
|
SystemLog.Infof(requestRemapEnabledStr)
|
|
|
|
|
SystemLog.Info(requestRemapEnabledStr)
|
|
|
|
|
requestRemaps = compileRequestRemapRegex(*remapRequestsList)
|
|
|
|
|
RemapRequest = remapRequestEnabled
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If no CGI dir supplied, set to disabled function. Else, compile and enable
|
|
|
|
|
if *cgiDir == "" {
|
|
|
|
|
SystemLog.Infof(cgiSupportDisabledStr)
|
|
|
|
|
SystemLog.Info(cgiSupportDisabledStr)
|
|
|
|
|
WithinCGIDir = withinCGIDirDisabled
|
|
|
|
|
} else {
|
|
|
|
|
SystemLog.Infof(cgiSupportEnabledStr)
|
|
|
|
|
SystemLog.Info(cgiSupportEnabledStr)
|
|
|
|
|
cgiDirRegex = compileCGIRegex(*cgiDir)
|
|
|
|
|
cgiEnv = setupInitialCGIEnv(*safePath)
|
|
|
|
|
WithinCGIDir = withinCGIDirEnabled
|
|
|
|
@ -153,10 +153,10 @@ func ParseFlagsAndSetup(proto string) {
|
|
|
|
|
|
|
|
|
|
// If no user dir supplied, set to disabled function. Else, set user dir and enable
|
|
|
|
|
if userDir == "" {
|
|
|
|
|
SystemLog.Infof(userDirDisabledStr)
|
|
|
|
|
SystemLog.Info(userDirDisabledStr)
|
|
|
|
|
getRequestPath = getRequestPathUserDirDisabled
|
|
|
|
|
} else {
|
|
|
|
|
SystemLog.Infof(userDirEnabledStr)
|
|
|
|
|
SystemLog.Info(userDirEnabledStr)
|
|
|
|
|
getRequestPath = getRequestPathUserDirEnabled
|
|
|
|
|
|
|
|
|
|
// Clean the user dir to be safe
|
|
|
|
|