summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFiles
2018-04-24Minor fixSergey Poznyakoff1
* fileserv.c (http_log): Avoid dereferencing NULL pointers.
2018-04-21Fix typoSergey Poznyakoff1
2018-04-21Minor fixesv0.3Sergey Poznyakoff1
2018-04-21Minor changesSergey Poznyakoff3
* src/Makefile.am: Install fileserv to sbin. * src/fileserv.8: Update. * src/fileserv.c: New option -V
2018-04-21Update docsSergey Poznyakoff1
2018-04-20BugfixSergey Poznyakoff2
2018-04-20Restore the -a, -u, and -g options.Sergey Poznyakoff2
2018-04-20BugfixSergey Poznyakoff1
* src/fileserv.c (urimap_find): Fix eventual null pointer dereference.
2018-04-20Update documentation. Minor bugfixes.Sergey Poznyakoff6
* src/Makefile.am: Install fileserv.conf, unless it already exists. * src/config.c: Rename pid-file to pidfile, and mime-magic-file to mime-types-file. Retain old names for compatibility. * src/defidx.html: Minor fix. * src/fileserv.8: Rewrite. * src/fileserv.conf: New file. * src/idx.c (exp_filetype): Remove useless return.
2018-04-20Start a sentinel process by default.Sergey Poznyakoff1
* src/fileserv.c (http_server) (http_sentinel): New functions. (main): New command line option -s (single process). Start sentinel unless -s is given.
2018-04-20Handle IPv4 mapped addressesSergey Poznyakoff1
2018-04-06BugfixSergey Poznyakoff1
* src/idx.c (directory_index): Fix conditional expression.
2018-02-20One more spelling fixSergey Poznyakoff1
2018-02-20Rewrite HTTP status handlingSergey Poznyakoff15
Provide built-in description pages for HTTP errors. Custom error pages may be supplied in the directory specified with the new configuration statement "error-dir". Error pages can be either static html files, or files with ".html.var" suffix, providing language-specific versions of the error texts, negotiatable using the value of the Accept-Language HTTP header (similar to Apache's mod_negotiation). * src/httperr.c: New file. * src/lang.c: New file. * src/Makefile.am: Add new files. * src/catfile.c (catfile_suf_n) (catfile_suf): New functions. * src/config.c: New global configuration statement: error-dir. * src/fileserv.c (http_error): Remove. Reimplemented in src/httperr.c. (fileserv_handler): Return appropriate HTTP status codes. * src/fileserv.h: Add include files. (error_dir): New extern. (n2realloc) (catfile_suf_n,catfile_suf) (http_error,http_log) (lang_var_list_free,select_language): New protos. * src/mem.c (nrealloc, n2realloc): New functions. * src/icon.c: Reorder includes. * src/idx.c: Likewise. * src/logger.c: Likewise. * src/pidfile.c: Likewise. * src/remoteip.c: Likewise. * src/runas.c: Likewise.
2018-02-17Don't bail out on out-of-memory errors in daemon mode.Sergey Poznyakoff7
* src/catfile.c: Use malloc instead of xmalloc. * src/config.c (dirconfig): Change signature. Return FSE_ constant. (config_init): Use calloc instead of xcalloc. (set_index_files,set_hidden_files): Use nrealloc instead of xnrealloc. (all setters): Use string_copy instead of xstrdup. (config_parse): Return meaningful FSE_ constant. * src/fileserv.c (fse_to_http_code): New function. (find_index_files,get_file_resp): Handle out-of-memory errors. * src/fileserv.h (fileserv_error): New enum. (alloc_warn,nrealloc): New protos. (dirconfig): Change prototype and return value. * src/mem.c (alloc_warn) (nrealloc): New functions.
2018-02-16CleanupSergey Poznyakoff7
Move the directory listing code into a separate module. Improve error reporting in directory index code. Don't bail out on (most of the) out of memory errors. * src/dirls.c: New file. * src/dirls.h: New file. * src/fileserv.c (errno_to_http_code): Increase resolution. * src/fileserv.h (parse_template_string) (parse_template_file): Change return value.
2018-02-15Listen on all available IP addresses if none is explicitly setSergey Poznyakoff1
2018-02-15Fix memory leakSergey Poznyakoff1
* src/idx.c (next_escape_node): Remove unnecessary memory allocation.
2018-02-15Support for configurable icons in fancy listing modeSergey Poznyakoff7
* src/icon.c: New file. * src/Makefile.am: Add new sources. * src/catfile.c (catfile_n): Compress trailing slashes in dir, and remove such in file. This makes sure that the returned value never ends in slash, which is necessary in particular for lstat to work correctly. * src/config.c: New global keywords: name-icon, type-icon and mime-icon. * src/defidx.html: Update. * src/fileserv.h: Update. * src/idx.c: New expansion command: iconlookup. Rename icon to iconsrc, and alt to iconalt.
2018-02-14Fix the sorting order of the mapping listSergey Poznyakoff3
* src/config.c: New global keyword "index-css" * src/fileserv.c (urimap_add): Make sure the list is sorted by uri_len in descending order. (main): Fix the check for empty mapping list. * src/fileserv.h (index_css): New extern.
2018-02-14Rewrite configuration support. Introduce global (system-wide) configuration ↵Sergey Poznyakoff7
file. * src/Makefile.am (AM_CPPFLAGS): Define SYSCONFDIR. * src/dirconfig.c: Rename to src/config.c. Implement global configuration file. * src/fileserv.c: Remove unnecessary options. * src/fileserv.h: Rewrite configuration-related prototypes and declarations.
2018-02-14Move memory and IP address functions to separate files.Sergey Poznyakoff5
* src/Makefile.am: Add new sources. * src/mem.c: New file. * src/remoteip.c: New file.
2018-02-13Improve index generationSergey Poznyakoff2
* mimetypes/eval.c (get_file_type): Return "directory", for directories. * src/defidx.html: Use $FILETYPE if no icon is available. * src/idx.c: New variable $FILETYPE.
2018-02-13BugfixesSergey Poznyakoff2
2018-02-13BugfixesSergey Poznyakoff4
2018-02-13Additional checks for valid file names.Sergey Poznyakoff4
* src/dirconfig.c (set_index_files): Bugfix. (dirconfig_keyword): New keyword hidden-files. (dirconfig_free): Free hidden files regexes. (filename_is_valid, filename_is_special) (filename_is_hidden): New functions. * src/fileserv.c (xnrealloc): New function. (get_file_resp): Additional checks for allowed filenames. * src/fileserv.h (xnrealloc): new proto. (DIRCONFIG): New members: hidden_files_rxv, hidden_files_rxc. (filename_is_special, filename_is_hidden,filename_is_valid): New protos. * src/idx.c: Skip hidden files.
2018-02-13Sort produced directory listings.Sergey Poznyakoff4
* src/defidx.html: Make query arguments configurable. * src/fileserv.c (urimap_find_dir): Match exact directory name, as well as the one followed by sud-directory components. (get_file_resp): Check for symlinks first. Pass sorting arguments to directory_index. * src/fileserv.h (INDEX_SORT_COL, INDEX_SORT_ORD): New datatypes. (directory_index) (index_sort_col_from_arg) (index_sort_col_to_arg) (index_sort_ord_from_arg) (index_sort_ord_to_arg): New protos. * src/idx.c (IDXLIST): Add count member. (idxlist_init,idxlist_append): New functions. (idxlist_scan): Append '/' to the names of subdirectories. (idxlist_qsort): New function. (index_sort_col_from_arg) (index_sort_col_to_arg) (index_sort_ord_from_arg) (index_sort_ord_to_arg): New functions. (EVAL_ENV): Add sorting order and column members (ord, col). (template_command): New commands: updir, sortorder. (directory_index): Sort the listing.
2018-02-13Minor improvementsSergey Poznyakoff1
* fileserv.c (get_file_name): Rename to get_file_resp; Determine file type and return it in FILE_RESP. Make redirect location absolute.
2018-02-13Initial support for auto-generated directory indexesSergey Poznyakoff10
* src/Makefile.am: Add new sources. Build defidx.h * src/defidx.html: New file. * src/dirconfig.c (dirconfig_free): Handle NULL argument. * src/fileserv.c (index_css, tmpdir): New globals. (get_file_name): Rewrite. (fileserv_handler): Rewrite. * src/fileserv.h (index_css, tmpdir): New externs. * src/ftoc.sed: New file. * src/idx.c: New file. * src/wordsplit.c (expvar): Gracefully handle NULL values in ENV_KV environment. * src/wordsplit.h: Fix typo in a comment.
2018-02-12Introduce per-directory configuration files.Sergey Poznyakoff7
* src/fileserv.c: Use sys/queue.h to maintain lists. The header (or its like) will in the future be included in the sources. (index_file): Remove. (get_file_name): Rewrite. Take into account directory configuration. * src/fileserv.h (DIRCONFIG): New data type. (DIRCONFIG_INITIALIZER): New macro. (xstrdup) (dirconfig, dirconfig_parse) (dirconfig_init, dirconfig_free) (catfile_n, catfile): New functions. * src/Makefile.am: Add new sources. * src/catfile.c: New file. * src/dirconfig.c: New file. * src/wordsplit.c: New file. * src/wordsplit.h: New file.
2018-02-09Return correct response code if the file cannot be opened or a directory is ↵Sergey Poznyakoff1
requested * src/fileserv.c (fileserv_handler): Derive the response code from the system errno.
2018-01-13BugfixesSergey Poznyakoff1
* mimetypes/err.c (print_locus_range): Fix output length. * mimetypes/grammar.y (rule_line): Initialize locus range. * mimetypes/prloc.c (locus_range_format): Fix memory overrun; terminate output with null byte. * src/fileserv.c: New option -i (index page).
2018-01-06Switch to the deep directory structure.Sergey Poznyakoff9

Return to:

Send suggestions and report system problems to the System administrator.