From 0ab1cf33937a56d3a378ddb14c5b309f1b8b2936 Mon Sep 17 00:00:00 2001 From: Root User Date: Fri, 24 Apr 2020 12:04:03 +0100 Subject: [PATCH] fix for vpath directory traversals --- ChrootHelper.c | 1 - VPath.c | 4 + common.c | 2 +- config.log | 418 ---------------------------------------- config.status | 2 +- directory_listing.c | 41 +++- libUseful/config.log | 96 ++++++--- libUseful/config.status | 2 +- server.c | 4 +- 9 files changed, 112 insertions(+), 458 deletions(-) delete mode 100644 config.log diff --git a/ChrootHelper.c b/ChrootHelper.c index 43215f0..7d01125 100644 --- a/ChrootHelper.c +++ b/ChrootHelper.c @@ -163,7 +163,6 @@ const char *ptr; { Value=UnQuoteStr(Value,Tempstr); - if (strcmp(Name,"User")==0) Response->UserName=CopyStr(Response->UserName,Value); else if (strcmp(Name,"Password")==0) Response->Password=CopyStr(Response->Password,Value); else if (strcmp(Name,"RealUser")==0) Response->RealUser=CopyStr(Response->RealUser,Value); diff --git a/VPath.c b/VPath.c index 2d4cc7e..5946c80 100644 --- a/VPath.c +++ b/VPath.c @@ -168,6 +168,8 @@ int result=FALSE, Flags=0; //Document name here is whatever part of the Path is *beyond* the VPath component DocName=VPathSubstituteArgs(DocName, Session->Path + StrLen(VPath->URL), Session); +//search through all paths that the vpath applies to to see if the document exists in any of them +//this allows us to have a vpath map to more than one directory ptr=GetToken(VPath->Path,":",&Tempstr,0); while (ptr) { @@ -180,9 +182,11 @@ while (ptr) ptr=GetToken(ptr,":",&Tempstr,0); } + Tempstr=CopyStr(Tempstr,""); if (StrValid(LocalPath)) Tempstr=FindFileInPath(Tempstr,DocName,LocalPath); +//if we found a file matching the request, handle it if (StrValid(Tempstr)) { Flags = HEADERS_SENDFILE|HEADERS_USECACHE|HEADERS_KEEPALIVE; diff --git a/common.c b/common.c index ee68fbf..394328c 100644 --- a/common.c +++ b/common.c @@ -6,7 +6,7 @@ #include "Authenticate.h" TSettings Settings; -char *Version="3.1"; +char *Version="3.2"; void SetTimezoneEnv() { diff --git a/config.log b/config.log deleted file mode 100644 index 6cc52cd..0000000 --- a/config.log +++ /dev/null @@ -1,418 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by configure, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ ./configure --enable-ssl - -## --------- ## -## Platform. ## -## --------- ## - -hostname = AX1 -uname -m = x86_64 -uname -r = 5.1.15-64 -uname -s = Linux -uname -v = #1 SMP Mon Jul 1 14:00:23 BST 2019 - -/usr/bin/uname -p = unknown -/bin/uname -X = unknown - -/bin/arch = unknown -/usr/bin/arch -k = unknown -/usr/convex/getsysinfo = unknown -/usr/bin/hostinfo = unknown -/bin/machine = unknown -/usr/bin/oslevel = unknown -/bin/universe = unknown - -PATH: /usr/prebin -PATH: /usr/local/bin -PATH: /usr/bin -PATH: /usr/X11R7/bin -PATH: /bin -PATH: /usr/games/bin - - -## ----------- ## -## Core tests. ## -## ----------- ## - -configure:2093: checking for gcc -configure:2109: found /usr/bin/gcc -configure:2120: result: gcc -configure:2349: checking for C compiler version -configure:2358: gcc --version >&5 -gcc (GCC) 5.3.0 -Copyright (C) 2015 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -configure:2369: $? = 0 -configure:2358: gcc -v >&5 -Using built-in specs. -COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i486-pc-linux-gnu/5.3.0/lto-wrapper -Target: i486-pc-linux-gnu -Configured with: ../gcc-5.3.0-src/configure --prefix=/usr --sysconfdir=/etc --includedir=/usr/include --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,c++,go --host=i486-pc-linux-gnu --build=i486-pc-linux-gnu --target=i486-pc-linux-gnu --enable-bootstrap -Thread model: posix -gcc version 5.3.0 (GCC) -configure:2369: $? = 0 -configure:2358: gcc -V >&5 -gcc: error: unrecognized command line option '-V' -gcc: fatal error: no input files -compilation terminated. -configure:2369: $? = 1 -configure:2358: gcc -qversion >&5 -gcc: error: unrecognized command line option '-qversion' -gcc: fatal error: no input files -compilation terminated. -configure:2369: $? = 1 -configure:2389: checking whether the C compiler works -configure:2411: gcc conftest.c >&5 -configure:2415: $? = 0 -configure:2463: result: yes -configure:2466: checking for C compiler default output file name -configure:2468: result: a.out -configure:2474: checking for suffix of executables -configure:2481: gcc -o conftest conftest.c >&5 -configure:2485: $? = 0 -configure:2507: result: -configure:2529: checking whether we are cross compiling -configure:2537: gcc -o conftest conftest.c >&5 -configure:2541: $? = 0 -configure:2548: ./conftest -configure:2552: $? = 0 -configure:2567: result: no -configure:2572: checking for suffix of object files -configure:2594: gcc -c conftest.c >&5 -configure:2598: $? = 0 -configure:2619: result: o -configure:2623: checking whether we are using the GNU C compiler -configure:2642: gcc -c conftest.c >&5 -configure:2642: $? = 0 -configure:2651: result: yes -configure:2660: checking whether gcc accepts -g -configure:2680: gcc -c -g conftest.c >&5 -configure:2680: $? = 0 -configure:2721: result: yes -configure:2738: checking for gcc option to accept ISO C89 -configure:2801: gcc -c -g -O2 conftest.c >&5 -configure:2801: $? = 0 -configure:2814: result: none needed -configure:2840: checking whether make sets $(MAKE) -configure:2862: result: yes -configure:2914: checking for a BSD-compatible install -configure:2982: result: /bin/install -c -configure:2999: checking how to run the C preprocessor -configure:3030: gcc -E conftest.c -configure:3030: $? = 0 -configure:3044: gcc -E conftest.c -conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory -compilation terminated. -configure:3044: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| /* end confdefs.h. */ -| #include -configure:3069: result: gcc -E -configure:3089: gcc -E conftest.c -configure:3089: $? = 0 -configure:3103: gcc -E conftest.c -conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory -compilation terminated. -configure:3103: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| /* end confdefs.h. */ -| #include -configure:3132: checking for grep that handles long lines and -e -configure:3190: result: /bin/grep -configure:3195: checking for egrep -configure:3257: result: /bin/grep -E -configure:3262: checking for ANSI C header files -configure:3282: gcc -c -g -O2 conftest.c >&5 -configure:3282: $? = 0 -configure:3355: gcc -o conftest -g -O2 conftest.c >&5 -configure:3355: $? = 0 -configure:3355: ./conftest -configure:3355: $? = 0 -configure:3366: result: yes -configure:3381: checking for special C compiler options needed for large files -configure:3426: result: no -configure:3432: checking for _FILE_OFFSET_BITS value needed for large files -configure:3457: gcc -c -g -O2 conftest.c >&5 -conftest.c:15:33: warning: left shift count >= width of type [-Wshift-count-overflow] - #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ -conftest.c:16:23: note: in expansion of macro 'LARGE_OFF_T' - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - ^ -conftest.c:15:57: warning: left shift count >= width of type [-Wshift-count-overflow] - #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ -conftest.c:16:23: note: in expansion of macro 'LARGE_OFF_T' - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - ^ -conftest.c:15:33: warning: left shift count >= width of type [-Wshift-count-overflow] - #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ -conftest.c:17:13: note: in expansion of macro 'LARGE_OFF_T' - && LARGE_OFF_T % 2147483647 == 1) - ^ -conftest.c:15:57: warning: left shift count >= width of type [-Wshift-count-overflow] - #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ -conftest.c:17:13: note: in expansion of macro 'LARGE_OFF_T' - && LARGE_OFF_T % 2147483647 == 1) - ^ -conftest.c:16:7: error: variably modified 'off_t_is_large' at file scope - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - ^ -configure:3457: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| /* end confdefs.h. */ -| #include -| /* Check that off_t can represent 2**63 - 1 correctly. -| We can't simply define LARGE_OFF_T to be 9223372036854775807, -| since some C++ compilers masquerading as C compilers -| incorrectly reject 9223372036854775807. */ -| #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -| int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -| && LARGE_OFF_T % 2147483647 == 1) -| ? 1 : -1]; -| int -| main () -| { -| -| ; -| return 0; -| } -configure:3481: gcc -c -g -O2 conftest.c >&5 -configure:3481: $? = 0 -configure:3489: result: 64 -configure:3575: checking for deflate in -lz -configure:3600: gcc -o conftest -g -O2 conftest.c -lz >&5 -configure:3600: $? = 0 -configure:3609: result: yes -configure:3689: checking sys/capability.h usability -configure:3689: gcc -c -g -O2 conftest.c >&5 -configure:3689: $? = 0 -configure:3689: result: yes -configure:3689: checking sys/capability.h presence -configure:3689: gcc -E conftest.c -configure:3689: $? = 0 -configure:3689: result: yes -configure:3689: checking for sys/capability.h -configure:3689: result: yes -configure:3695: checking linux/capability.h usability -configure:3695: gcc -c -g -O2 conftest.c >&5 -configure:3695: $? = 0 -configure:3695: result: yes -configure:3695: checking linux/capability.h presence -configure:3695: gcc -E conftest.c -configure:3695: $? = 0 -configure:3695: result: yes -configure:3695: checking for linux/capability.h -configure:3695: result: yes -configure:3705: checking for cap_init in -lcap -configure:3730: gcc -o conftest -g -O2 conftest.c -lcap -lz >&5 -configure:3730: $? = 0 -configure:3739: result: yes -configure:3762: checking for pam_start in -lpam -configure:3787: gcc -o conftest -g -O2 conftest.c -lpam -lcap -lz >&5 -configure:3787: $? = 0 -configure:3796: result: yes -configure:3819: checking for SSL_library_init in -lssl -configure:3844: gcc -o conftest -g -O2 conftest.c -lssl -lpam -lcap -lz >&5 -configure:3844: $? = 0 -configure:3853: result: yes -configure:3866: checking for EVP_CIPHER_CTX_init in -lcrypto -configure:3891: gcc -o conftest -g -O2 conftest.c -lcrypto -lssl -lpam -lcap -lz >&5 -configure:3891: $? = 0 -configure:3900: result: yes -configure:3915: checking for crypt in -lcrypt -configure:3940: gcc -o conftest -g -O2 conftest.c -lcrypt -lcrypto -lssl -lpam -lcap -lz >&5 -configure:3940: $? = 0 -configure:3949: result: yes -configure:3962: checking shadow.h usability -configure:3962: gcc -c -g -O2 conftest.c >&5 -configure:3962: $? = 0 -configure:3962: result: yes -configure:3962: checking shadow.h presence -configure:3962: gcc -E conftest.c -configure:3962: $? = 0 -configure:3962: result: yes -configure:3962: checking for shadow.h -configure:3962: result: yes -configure:4366: creating ./config.status - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by config.status, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status - -on AX1 - -config.status:730: creating Makefile -configure:5443: === configuring in libUseful (/home/engineering/alaya-3.1/libUseful) -configure:5506: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local' '--enable-ssl' --cache-file=/dev/null --srcdir=. - -## ---------------- ## -## Cache variables. ## -## ---------------- ## - -ac_cv_c_compiler_gnu=yes -ac_cv_env_CC_set= -ac_cv_env_CC_value= -ac_cv_env_CFLAGS_set= -ac_cv_env_CFLAGS_value= -ac_cv_env_CPPFLAGS_set= -ac_cv_env_CPPFLAGS_value= -ac_cv_env_CPP_set= -ac_cv_env_CPP_value= -ac_cv_env_LDFLAGS_set= -ac_cv_env_LDFLAGS_value= -ac_cv_env_LIBS_set= -ac_cv_env_LIBS_value= -ac_cv_env_build_alias_set= -ac_cv_env_build_alias_value= -ac_cv_env_host_alias_set= -ac_cv_env_host_alias_value= -ac_cv_env_target_alias_set= -ac_cv_env_target_alias_value= -ac_cv_header_linux_capability_h=yes -ac_cv_header_shadow_h=yes -ac_cv_header_stdc=yes -ac_cv_header_sys_capability_h=yes -ac_cv_lib_cap_cap_init=yes -ac_cv_lib_crypt_crypt=yes -ac_cv_lib_crypto_EVP_CIPHER_CTX_init=yes -ac_cv_lib_pam_pam_start=yes -ac_cv_lib_ssl_SSL_library_init=yes -ac_cv_lib_z_deflate=yes -ac_cv_objext=o -ac_cv_path_EGREP='/bin/grep -E' -ac_cv_path_GREP=/bin/grep -ac_cv_path_install='/bin/install -c' -ac_cv_prog_CPP='gcc -E' -ac_cv_prog_ac_ct_CC=gcc -ac_cv_prog_cc_c89= -ac_cv_prog_cc_g=yes -ac_cv_prog_make_make_set=yes -ac_cv_sys_file_offset_bits=64 -ac_cv_sys_largefile_CC=no - -## ----------------- ## -## Output variables. ## -## ----------------- ## - -CC='gcc' -CFLAGS='-g -O2' -CPP='gcc -E' -CPPFLAGS='' -DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBZ=1 -DHAVE_LIBCAP=1 -DUSE_LINUX_CAPABILITIES=1 -DHAVE_LIBPAM=1 -DHAVE_LIBSSL=1 -DHAVE_LIBCRYPTO=1 -DHAVE_LIBCRYPT=1 -DHAVE_SHADOW_H=1' -ECHO_C='' -ECHO_N='-n' -ECHO_T='' -EGREP='/bin/grep -E' -EXEEXT='' -GREP='/bin/grep' -INSTALL_DATA='${INSTALL} -m 644' -INSTALL_PROGRAM='${INSTALL}' -INSTALL_SCRIPT='${INSTALL}' -LDFLAGS='' -LIBOBJS='' -LIBS='-lcrypt -lcrypto -lssl -lpam -lcap -lz ' -LTLIBOBJS='' -OBJEXT='o' -PACKAGE_BUGREPORT='' -PACKAGE_NAME='' -PACKAGE_STRING='' -PACKAGE_TARNAME='' -PACKAGE_URL='' -PACKAGE_VERSION='' -PATH_SEPARATOR=':' -SET_MAKE='' -SHELL='/bin/sh' -STATIC_LIBS='libUseful/libUseful.a' -ac_ct_CC='gcc' -bindir='${exec_prefix}/bin' -build_alias='' -datadir='${datarootdir}' -datarootdir='${prefix}/share' -docdir='${datarootdir}/doc/${PACKAGE}' -dvidir='${docdir}' -exec_prefix='${prefix}' -host_alias='' -htmldir='${docdir}' -includedir='${prefix}/include' -infodir='${datarootdir}/info' -libdir='${exec_prefix}/lib' -libexecdir='${exec_prefix}/libexec' -localedir='${datarootdir}/locale' -localstatedir='${prefix}/var' -mandir='${datarootdir}/man' -oldincludedir='/usr/include' -pdfdir='${docdir}' -prefix='/usr/local' -program_transform_name='s,x,x,' -psdir='${docdir}' -sbindir='${exec_prefix}/sbin' -sharedstatedir='${prefix}/com' -subdirs=' libUseful' -sysconfdir='${prefix}/etc' -target_alias='' - -## ----------- ## -## confdefs.h. ## -## ----------- ## - -/* confdefs.h */ -#define PACKAGE_NAME "" -#define PACKAGE_TARNAME "" -#define PACKAGE_VERSION "" -#define PACKAGE_STRING "" -#define PACKAGE_BUGREPORT "" -#define PACKAGE_URL "" -#define STDC_HEADERS 1 -#define _FILE_OFFSET_BITS 64 -#define HAVE_LIBZ 1 -#define HAVE_LIBCAP 1 -#define USE_LINUX_CAPABILITIES 1 -#define HAVE_LIBPAM 1 -#define HAVE_LIBSSL 1 -#define HAVE_LIBCRYPTO 1 -#define HAVE_LIBCRYPT 1 -#define HAVE_SHADOW_H 1 - -configure: exit 0 diff --git a/config.status b/config.status index f25c7c5..ec5d3c8 100755 --- a/config.status +++ b/config.status @@ -427,7 +427,7 @@ Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/engineering/alaya-3.1' +ac_pwd='/home/colum/alaya' srcdir='.' INSTALL='/bin/install -c' test -n "$AWK" || AWK=awk diff --git a/directory_listing.c b/directory_listing.c index 1b98ee2..ef989d8 100644 --- a/directory_listing.c +++ b/directory_listing.c @@ -30,6 +30,34 @@ typedef enum {ACTION_HTML,ACTION_CSV,ACTION_M3U,ACTION_RSS,ACTION_PACK,ACTION_UP time_t Now; + +static char *DirectoryGetTopLevel(char *RetStr, const char *URL) +{ +const char *ptr; + +ptr=URL; +//if URL lacks a protocol, then we can just use it as is +if (*ptr != '/') +{ + //if we have a full url , we have to turn it into a relative url, so we remove the + //protocol and the host/port etc + if (strncasecmp(ptr, "http:", 5)==0) ptr+=5; + if (strncasecmp(ptr, "https:", 6)==0) ptr+=6; + while (*ptr=='/') ptr++; + + ptr=strchr(ptr, '/'); +} + +//yes, ptr can be null, because the url lacks any '/' path, like 'http://myhost'. In that case this copy string +//will create an empty string, and then SlashTerminateDirectoryPath will turn that into '/' +RetStr=CopyStr(RetStr, ptr); +StrRTruncChar(RetStr, '?'); +RetStr=SlashTerminateDirectoryPath(RetStr); + +return(RetStr); +} + + static int InFileTypeList(char *FilePath, char *FileTypes) { char *Token=NULL; @@ -148,6 +176,8 @@ TPathItem *File, **Files; ListNode *Curr; int i, val, fcount=0; + +Dir=DirectoryGetTopLevel(Dir, Session->URL); Tempstr=MCopyStr(Tempstr,Path,"/*",NULL); glob(Tempstr,0,0,&Glob); @@ -162,9 +192,9 @@ Files=*fl_ptr; //if we are at '/' then don't offer a parent directory if (StrLen(Path) > 1) { -URL=ParentDirectory(URL, Session->Path); -Files[0]=PathItemCreate(PATHTYPE_DIR, URL, ".."); -fcount++; + URL=ParentDirectory(URL, Dir); + Files[0]=PathItemCreate(PATHTYPE_DIR, URL, ".."); + fcount++; } @@ -188,14 +218,11 @@ if (Settings.DirListFlags & DIR_SHOW_VPATHS) } -Dir=CopyStr(Dir,Session->Path); -Dir=SlashTerminateDirectoryPath(Dir); - for (i=0; i < Glob.gl_pathc; i++) { if (stat(Glob.gl_pathv[i], &Stat) > -1) { - URL=MCopyStr(URL, Dir,GetBasename(Glob.gl_pathv[i]),NULL); + URL=MCopyStr(URL, Dir, GetBasename(Glob.gl_pathv[i]),NULL); if (S_ISDIR(Stat.st_mode)) File=PathItemCreate(PATHTYPE_DIR, URL, Glob.gl_pathv[i]); else File=PathItemCreate(PATHTYPE_FILE, URL, Glob.gl_pathv[i]); File->Mtime=Stat.st_mtime; diff --git a/libUseful/config.log b/libUseful/config.log index 1f89c14..9fc7707 100644 --- a/libUseful/config.log +++ b/libUseful/config.log @@ -10,11 +10,11 @@ generated by GNU Autoconf 2.69. Invocation command line was ## Platform. ## ## --------- ## -hostname = AX1 +hostname = DellM6400 uname -m = x86_64 -uname -r = 5.1.15-64 +uname -r = 5.6.5-64 uname -s = Linux -uname -v = #1 SMP Mon Jul 1 14:00:23 BST 2019 +uname -v = #6 SMP Sun Apr 19 22:31:45 BST 2020 /usr/bin/uname -p = unknown /bin/uname -X = unknown @@ -33,6 +33,44 @@ PATH: /usr/bin PATH: /usr/X11R7/bin PATH: /bin PATH: /usr/games/bin +PATH: . +PATH: /opt/Csound-6.05/bin +PATH: /opt/Drawing/bin +PATH: /opt/FLTK/bin +PATH: /opt/GTK/bin +PATH: /opt/LibreCAD/bin +PATH: /opt/Python-3.5.6/bin +PATH: /opt/Qt5/bin +PATH: /opt/SDL/bin +PATH: /opt/SDL2/bin +PATH: /opt/blender-2.79b/bin +PATH: /opt/brlcad-7.26.4/bin +PATH: /opt/chess/bin +PATH: /opt/clamav-0.100.1/bin +PATH: /opt/games/bin +PATH: /opt/ghostscript-9.26/bin +PATH: /opt/ghostscript-9.28rc2/bin +PATH: /opt/gifprogs-5.1.2/bin +PATH: /opt/git-2.21.0/bin +PATH: /opt/graphviz-2.40.1/bin +PATH: /opt/jpegprogs-9c/bin +PATH: /opt/lua-5.3.4/bin +PATH: /opt/luajid-2.0.4/bin +PATH: /opt/mono-5.20.1.27/bin +PATH: /opt/mujs-1.0.5/bin +PATH: /opt/netpbm-10.66.02/bin +PATH: /opt/ogre-3d/bin +PATH: /opt/opengl/bin +PATH: /opt/panda3d/bin +PATH: /opt/perl-5.24.1/bin +PATH: /opt/pngprogs-1.6.30/bin +PATH: /opt/qemu-3.1.0_SDL/bin +PATH: /opt/rust-1.36.0/bin +PATH: /opt/sound-studio/bin +PATH: /opt/tcl-8.6.9/bin +PATH: /opt/tiffprogs-4.0.8/bin +PATH: /opt/wine-5.5/bin +PATH: /opt/xboinc_client-7.14.2/bin ## ----------- ## @@ -44,8 +82,8 @@ configure:2213: found /usr/bin/gcc configure:2224: result: gcc configure:2453: checking for C compiler version configure:2462: gcc --version >&5 -gcc (GCC) 5.3.0 -Copyright (C) 2015 Free Software Foundation, Inc. +gcc (GCC) 8.3.0 +Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -53,11 +91,11 @@ configure:2473: $? = 0 configure:2462: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i486-pc-linux-gnu/5.3.0/lto-wrapper +COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i486-pc-linux-gnu/8.3.0/lto-wrapper Target: i486-pc-linux-gnu -Configured with: ../gcc-5.3.0-src/configure --prefix=/usr --sysconfdir=/etc --includedir=/usr/include --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,c++,go --host=i486-pc-linux-gnu --build=i486-pc-linux-gnu --target=i486-pc-linux-gnu --enable-bootstrap +Configured with: ../gcc-8.3.0-src/configure --enable-languages=c,c++,go --disable-nls --disable-multilib --prefix=/usr --sysconfdir=/etc --includedir=/usr/include --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --host=i486-pc-linux-gnu --build=i486-pc-linux-gnu --target=i486-pc-linux-gnu Thread model: posix -gcc version 5.3.0 (GCC) +gcc version 8.3.0 (GCC) configure:2473: $? = 0 configure:2462: gcc -V >&5 gcc: error: unrecognized command line option '-V' @@ -65,7 +103,7 @@ gcc: fatal error: no input files compilation terminated. configure:2473: $? = 1 configure:2462: gcc -qversion >&5 -gcc: error: unrecognized command line option '-qversion' +gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? gcc: fatal error: no input files compilation terminated. configure:2473: $? = 1 @@ -107,7 +145,9 @@ configure:2981: checking how to run the C preprocessor configure:3012: gcc -E conftest.c configure:3012: $? = 0 configure:3026: gcc -E conftest.c -conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory +conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory + #include + ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:3026: $? = 1 configure: failed program was: @@ -124,7 +164,9 @@ configure:3051: result: gcc -E configure:3071: gcc -E conftest.c configure:3071: $? = 0 configure:3085: gcc -E conftest.c -conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory +conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory + #include + ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:3085: $? = 1 configure: failed program was: @@ -155,31 +197,31 @@ configure:3414: checking for _FILE_OFFSET_BITS value needed for large files configure:3439: gcc -c -g -O2 conftest.c >&5 conftest.c:15:33: warning: left shift count >= width of type [-Wshift-count-overflow] #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ + ^~ conftest.c:16:23: note: in expansion of macro 'LARGE_OFF_T' int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - ^ + ^~~~~~~~~~~ conftest.c:15:57: warning: left shift count >= width of type [-Wshift-count-overflow] #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ + ^~ conftest.c:16:23: note: in expansion of macro 'LARGE_OFF_T' int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - ^ + ^~~~~~~~~~~ conftest.c:15:33: warning: left shift count >= width of type [-Wshift-count-overflow] #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ + ^~ conftest.c:17:13: note: in expansion of macro 'LARGE_OFF_T' && LARGE_OFF_T % 2147483647 == 1) - ^ + ^~~~~~~~~~~ conftest.c:15:57: warning: left shift count >= width of type [-Wshift-count-overflow] #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - ^ + ^~ conftest.c:17:13: note: in expansion of macro 'LARGE_OFF_T' && LARGE_OFF_T % 2147483647 == 1) - ^ + ^~~~~~~~~~~ conftest.c:16:7: error: variably modified 'off_t_is_large' at file scope int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - ^ + ^~~~~~~~~~~~~~ configure:3439: $? = 1 configure: failed program was: | /* confdefs.h */ @@ -272,8 +314,8 @@ configure:4379: $? = 0 configure:4388: result: yes configure:4406: checking for OpenSSL_add_all_algorithms configure:4406: gcc -o conftest -g -O2 conftest.c -lcrypto -lssl -lc -lc -lc -lc -lc -lc -lc -lc >&5 -/tmp/ccSOZMdG.o: In function `main': -/home/engineering/alaya-3.1/libUseful/conftest.c:63: undefined reference to `OpenSSL_add_all_algorithms' +/usr/lib/gcc/i486-pc-linux-gnu/8.3.0/../../../../i486-pc-linux-gnu/bin/ld: /tmp/ccq0BHdb.o: in function `main': +/home/colum/alaya/libUseful/conftest.c:63: undefined reference to `OpenSSL_add_all_algorithms' collect2: error: ld returned 1 exit status configure:4406: $? = 1 configure: failed program was: @@ -358,8 +400,8 @@ configure:4406: $? = 0 configure:4406: result: yes configure:4406: checking for EVP_rc5_32_12_16_cbc configure:4406: gcc -o conftest -g -O2 conftest.c -lcrypto -lssl -lc -lc -lc -lc -lc -lc -lc -lc >&5 -/tmp/ccsgLz5B.o: In function `main': -/home/engineering/alaya-3.1/libUseful/conftest.c:66: undefined reference to `EVP_rc5_32_12_16_cbc' +/usr/lib/gcc/i486-pc-linux-gnu/8.3.0/../../../../i486-pc-linux-gnu/bin/ld: /tmp/ccICoqNX.o: in function `main': +/home/colum/alaya/libUseful/conftest.c:66: undefined reference to `EVP_rc5_32_12_16_cbc' collect2: error: ld returned 1 exit status configure:4406: $? = 1 configure: failed program was: @@ -463,8 +505,8 @@ configure:4406: $? = 0 configure:4406: result: yes configure:4406: checking for SSL_set_tlsext_host_name configure:4406: gcc -o conftest -g -O2 conftest.c -lcrypto -lssl -lc -lc -lc -lc -lc -lc -lc -lc >&5 -/tmp/ccqtGgdK.o: In function `main': -/home/engineering/alaya-3.1/libUseful/conftest.c:73: undefined reference to `SSL_set_tlsext_host_name' +/usr/lib/gcc/i486-pc-linux-gnu/8.3.0/../../../../i486-pc-linux-gnu/bin/ld: /tmp/ccKh1zIc.o: in function `main': +/home/colum/alaya/libUseful/conftest.c:73: undefined reference to `SSL_set_tlsext_host_name' collect2: error: ld returned 1 exit status configure:4406: $? = 1 configure: failed program was: @@ -570,7 +612,7 @@ generated by GNU Autoconf 2.69. Invocation command line was CONFIG_COMMANDS = $ ./config.status -on AX1 +on DellM6400 config.status:728: creating Makefile diff --git a/libUseful/config.status b/libUseful/config.status index 1087b4c..45dd961 100755 --- a/libUseful/config.status +++ b/libUseful/config.status @@ -427,7 +427,7 @@ Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/engineering/alaya-3.1/libUseful' +ac_pwd='/home/colum/alaya/libUseful' srcdir='.' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. diff --git a/server.c b/server.c index 902134f..4f3e683 100644 --- a/server.c +++ b/server.c @@ -810,6 +810,7 @@ TPathItem *PI=NULL; { //filetype VPATHS can override some settings + //note, this vpath check is ONLY for settings. We are not mapping a VPath here, that's already beendone PI=VPathFind(PATHTYPE_FILETYPE, Session->Path); if (PI) { @@ -818,8 +819,6 @@ TPathItem *PI=NULL; if (PI->CacheTime > 0) Session->CacheTime=PI->CacheTime; if (StrValid(PI->ContentType)) SetVar(Vars, "ContentType", PI->ContentType); } - - //Set 'LastModified' so we can use it if the server sends 'If-Modified-Since' Session->LastModified=atoi(GetVar(Vars,"MTime-secs")); @@ -1585,6 +1584,7 @@ char *Path=NULL; const char *ptr; ListNode *Curr; +//THIS IS WHERE WE MAP VPATHS!! If a document is a VPATH, it's handled in VPathProcess if (! VPathProcess(S, Session, Flags)) { ptr=Session->StartDir;