Commit Graph

149 Commits

Author SHA1 Message Date
prx 1e13a08865 improve check of cgi_dir request 2022-09-20 12:57:45 +02:00
prx aa6f001022 follow manpage for tests 2022-09-20 12:39:21 +02:00
prx 86626e77f2 fix indent 2022-09-20 12:39:09 +02:00
prx c09063b10e -c is now relative to chroot and can be used with multiple vhosts 2022-09-19 22:10:09 +02:00
solene de579c346a Merge pull request 'replace strlcpy and strlcat by snprintf to reduce calls' (#8) from simpler_string_handling into master
Reviewed-on: #8
2022-08-31 16:19:43 +00:00
prx 62bc1d852f use fork() to get the real byte size sent when using cgi 2022-08-22 14:25:26 +02:00
prx 750ca51e43 rename function name 2022-08-22 13:49:38 +02:00
prx bc306eaf8a remove '../' after percent decoding 2022-08-22 11:20:24 +02:00
prx 46f2c7238a replace strlcpy and strlcat by snprintf to reduce calls 2022-08-20 15:10:05 +02:00
solene 3ca16cf38f Merge pull request 'regex' (#7) from regex into master
Reviewed-on: #7
2022-08-19 13:13:19 +00:00
prx 9d23a48ae2 remove useless functions 2022-08-18 22:23:59 +02:00
prx 875f167eb9 skip useless test 2022-08-18 15:27:44 +02:00
prx 75bfaee73e remove useless function && reorder declarations 2022-08-18 14:34:04 +02:00
prx 45e5ae32fa useless line 2022-08-18 14:32:19 +02:00
prx b1f92f7c9c fix indent 2022-08-18 14:27:52 +02:00
prx fc5c2a1b41 fix cgi and simplify now we use regex 2022-08-18 14:12:38 +02:00
prx 34667eb018 Revert "test no longer required since path can't be empty with set_path"
This reverts commit 5cb310dd1b.
2022-08-18 14:02:45 +02:00
prx 5cb310dd1b test no longer required since path can't be empty with set_path 2022-08-18 14:01:12 +02:00
prx 63616a97fc remove unused function 2022-08-18 14:00:51 +02:00
prx 27549119ef simplify and fix redirections after regex 2022-08-18 13:59:54 +02:00
prx e3932483ef remove unused parameter 2022-08-18 11:06:37 +02:00
prx f8d215869d remove unused function 2022-08-18 11:05:56 +02:00
prx e2567fcf01 modify function to set path according to virtualhost 2022-08-18 11:05:21 +02:00
prx b18f3a3c7b rename function 2022-08-18 10:58:38 +02:00
prx 504dd3f759 rename check_request to read_request 2022-08-18 10:54:13 +02:00
prx f388d2a57a improve regex to handle :1234 in url 2022-08-18 10:53:08 +02:00
prx 5063f3e95b ensure errors msg are followed by \n, specify in a define the number of matches we need, remove bad structure init 2022-08-17 22:08:16 +02:00
prx be0f86df8d keep globals notation 2022-08-17 21:36:54 +02:00
prx 883bfed7a7 make tests easier to read 2022-08-17 21:34:37 +02:00
prx 26ca6c422d move regex to vger.h 2022-08-17 21:32:06 +02:00
prx 2b835bc39c import regex functions to parse request 2022-08-17 21:28:09 +02:00
solene bfd713c131 Merge pull request 'Reorganize vger code into functions' (#6) from nospaghettis into master
Reviewed-on: #6
2022-08-12 12:51:35 +00:00
prx fd0e70ab5b really fix size computation 2022-08-08 23:16:55 +02:00
prx 4d3b585951 fix wrong data size calculation 2022-08-08 23:12:12 +02:00
prx f973351945 reformat as much as possible.
Now main() is much simpler.
Removed all goto.
Less variables in main.
Simplified status_ to status().
Use a stop() function to log, send messages to stderr if necessary and close vger.
Minor fixes with defaults, mimes
There is still work to do to compare path using stat().
2022-08-08 22:57:03 +02:00
Solene Rapenne 76fafe0a9d fix a makefile source requirement 2022-07-04 21:52:45 +02:00
Solene Rapenne 4496e744e8 introduce the unit tests file 2022-07-04 21:52:20 +02:00
Solene Rapenne 9cca2408c3 Separate vger functions into a new file
This will ease the creation of unit tests
and code reusability
2022-07-04 21:00:31 +02:00
Solene Rapenne 8bd1144178 README: use repology to list where vger is packaged 2022-05-01 23:53:37 +02:00
Solene Rapenne 6743c54359 README: openbsd and arch linux has a package, mentions nix shell 2022-05-01 23:50:03 +02:00
solene bbd0f05663 Merge pull request 'fix cgi support for PATH_INFO' (#3) from phoebos/vger:merge into master
Reviewed-on: #3
2022-03-31 08:07:06 +00:00
aabacchus aa1affb6c2
fix cgi support for PATH_INFO
looks for files immediately after the cgidir, and anything after that file
if there are '/'s becomes PATH_INFO.

also adds a function strip_trailing_slash which may be useful in other parts too.
2022-03-26 20:31:50 +00:00
solene 8efcdb7512 Merge pull request 'remove any query_string before chdir' (#4) from phoebos/vger:query_string_slashes into master
Reviewed-on: #4
2022-03-26 08:27:24 +00:00
aabacchus 394b86bca8
remove any query_string before chdir
a query string could contain a '/' character, which would make vger try
to chdir to an incorrect directory. remove the query_string before this,
and before percent-decoding (in case there is an encoded '?'). This
should happen even if we are not doing cgi, because some clients might
send a query_string anyway, which should be ignored.
2022-03-19 14:49:44 +00:00
Solene Rapenne 01f2503376 fix NetBSD macro check 2022-01-26 13:04:04 +01:00
Solene Rapenne ed6dc1ed12 add .gitignore for build artifacts 2021-12-13 21:44:03 +01:00
Solene Rapenne 0d3d453498 test.sh should be executable out of the box 2021-12-13 21:34:49 +01:00
Solene Rapenne 914a143c3f add Nix shell file 2021-12-13 21:34:35 +01:00
Solene Rapenne a319de23f7 Add configure script 2021-12-13 21:32:08 +01:00
prx 15d09d2c01 fix user chroot issue + style 2021-10-21 11:41:22 +02:00