aboutsummaryrefslogtreecommitdiff
path: root/src/lib/fs
AgeCommit message (Collapse)Author
2021-03-26Fix glob processing on BSD systems. #40318Daniel Pinto
On Linux systems, glob automatically ignores the errors ENOENT and ENOTDIR because they are expected during glob expansion. But BSD systems do not ignore these, resulting in glob failing when globs expand to invalid paths. This is fixed by adding a custom error handler that ignores only these two errors and removing the GLOB_ERR flag as it makes glob fail even if the error handler ignores the error and is unnecessary as the error handler will make glob fail on all other errors anyway.
2020-12-15Merge remote-tracking branch 'tor-gitlab/mr/205' into maint-0.4.5George Kadianakis
2020-12-08Avoid sandbox bug warning when unglobbing patterns #40094Daniel Pinto
Adds a more user-friendly error message when the configuration is reloaded and a new %include is added that makes its unglobbing access files/folders not allowed by the seccomp sandbox.
2020-12-08Fix a couple of documentation comments related to #40094Nick Mathewson
2020-11-12When handling includes, detect missing interned strings earlier.Nick Mathewson
There were three separate places where we were hitting a sandbox Bug warning before we actually exited. Fixes #40094; bugfix on 0.3.1.1-alpha when %includes were introduced.
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-10-03Fix %include bug with pattern with */ on glibc < 2.19 #40141Daniel Pinto
Fix bug where %including a pattern ending in */ would include files and folders (instead of folders only) in versions of glibc < 2.19.
2020-09-10Check if glob() is available at build-time.Alexander Færøy
This patch disables the glob() support in the path library if glob() is unavailable at build-time. This currently happens with the Android NDK used for Tor Browser. See: https://bugs.torproject.org/tpo/core/tor/40114
2020-08-12Use correct type for gl_closedir to avoid a compiler warningNick Mathewson
2020-08-12Merge remote-tracking branch 'tor-gitlab/mr/62'Nick Mathewson
2020-08-11Improved documentation and comments #25140Daniel Pinto
2020-07-30Introduce write_str_if_not_equal()Neel Chauhan
2020-07-15Add support for patterns on %include #25140Daniel Pinto
Also adds generic tor_glob function to expand globs.
2020-07-14Merge remote-tracking branch 'tor-gitlab/mr/50'Nick Mathewson
2020-07-14Update docstring for read_file_to_str() on stripping of CR characters.Alexander Færøy
See: https://bugs.torproject.org/tpo/core/tor/33781
2020-07-14Strip '\r' characters when reading text files on Unix.Alexander Færøy
This patch ensures that we strip "\r" characters on both Windows as well as Unix when we read text files. This should prevent the issue where some Tor state files have been moved from a Windows machine, and thus contains CRLF line ending, to a Unix machine where only \n is needed. We add a test-case to ensure that we handle this properly on all our platforms. See: https://bugs.torproject.org/tpo/core/tor/33781
2020-05-08Improve logging of included config filesDaniel Pinto
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-11-18Merge remote-tracking branch 'tor-github/pr/1517'teor
2019-11-15Doxygen: rename all .dox files to end with .mdNick Mathewson
Using a standard ending here will let other tools that expect markdown understand our output here. This commit was automatically generated with: for fn in $(find src -name '*.dox'); do \ git mv "$fn" "${fn%.dox}.md"; \ done
2019-11-15Doxygen: remove /** and **/ from all .dox filesNick Mathewson
This is an automatically generated commit, made with: find src -name '*.dox' | \ xargs perl -i -ne 'print unless (m#^\s*/?\*\*/?\s*$#);'
2019-11-07Make all our struct names end with "_t".Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ address_ttl_s address_ttl_t \ aes_cnt_cipher aes_cnt_cipher_t \ authchallenge_data_s authchallenge_data_t \ authenticate_data_s authenticate_data_t \ cached_bw_event_s cached_bw_event_t \ cbuf cbuf_t \ cell_ewma_s cell_ewma_t \ certs_data_s certs_data_t \ channel_idmap_entry_s channel_idmap_entry_t \ channel_listener_s channel_listener_t \ channel_s channel_t \ channel_tls_s channel_tls_t \ circuit_build_times_s circuit_build_times_t \ circuit_muxinfo_s circuit_muxinfo_t \ circuitmux_policy_circ_data_s circuitmux_policy_circ_data_t \ circuitmux_policy_data_s circuitmux_policy_data_t \ circuitmux_policy_s circuitmux_policy_t \ circuitmux_s circuitmux_t \ coord coord_t \ cpuworker_job_u cpuworker_job_u_t \ cv_testinfo_s cv_testinfo_t \ ddmap_entry_s ddmap_entry_t \ dircollator_s dircollator_t \ dist_ops dist_ops_t \ ecdh_work_s ecdh_work_t \ ewma_policy_circ_data_s ewma_policy_circ_data_t \ ewma_policy_data_s ewma_policy_data_t \ fp_pair_map_entry_s fp_pair_map_entry_t \ fp_pair_map_s fp_pair_map_t \ guard_selection_s guard_selection_t \ mbw_cache_entry_s mbw_cache_entry_t \ outbuf_table_ent_s outbuf_table_ent_t \ queued_event_s queued_event_t \ replyqueue_s replyqueue_t \ rsa_work_s rsa_work_t \ sandbox_cfg_elem sandbox_cfg_elem_t \ scheduler_s scheduler_t \ smp_param smp_param_t \ socket_table_ent_s socket_table_ent_t \ state_s state_t \ threadpool_s threadpool_t \ timeout_cb timeout_cb_t \ tor_libevent_cfg tor_libevent_cfg_t \ tor_threadlocal_s tor_threadlocal_t \ url_table_ent_s url_table_ent_t \ worker_state_s worker_state_t \ workerthread_s workerthread_t \ workqueue_entry_s workqueue_entry_t
2019-11-04Doxygen: document the rest of the directories in lib.Nick Mathewson
(This copies documentation from doc/HACKING/design, and edits for concisensess and clarity.)
2019-11-04Doxygen: Avoid ambiguity in @dir directivesNick Mathewson
This commit was automatically generated with: find src -name '*.dox' |xargs perl -i -pe 's{\@dir ([^/])}{\@dir /$1};'
2019-11-04Add stub directory-level documentation for most source directoriesNick Mathewson
This includes app, core, feature, lib, and tools, but excludes ext, test, and trunnel. This was generated by the following shell script: cd src for dname in $(find lib core feature app tools -type d |grep -v \\.deps$); do keyword="$(echo "$dname" |sed -e "s/\//_/" )" target="${dname}/${keyword}.dox" echo "$target" cat <<EOF >"$target" /** @dir ${dname} @brief ${dname} **/ EOF git add "$target" done
2019-10-31config: Give warn_about_relative_paths() const argsteor
Also gives make_path_absolute() const args. Obviously correct fixes to already reviewed code.
2019-10-30fs: Clarify an ambiguous comment about string/pointer equalityteor
2019-10-21Merge remote-tracking branch 'tor-github/pr/1434'teor
2019-10-21control: Add GETINFO support for dumping microdesc consensusAmreshVenugopal
- Allows control port to read microdesc consensus using: GETINFO dir/status-vote/microdesc/consensus add: Helper function `getinfo_helper_current_consensus` test: check if GETINFO commands return expected consensus data. Resolves 31684.
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-30Merge branch 'tor-github/pr/1339'George Kadianakis
2019-09-26Run "make autostyle" with new "annotate_ifdef_directives"Nick Mathewson
2019-09-24Merge branch 'bug31408_035' into bug31408_masterteor
2019-09-23Fix bug when %including folder with comment only files. #31408Daniel Pinto
When processing a %included folder, a bug caused the pointer to the last element of the options list to be set to NULL when processing a file with only comments or whitepace. This could cause options from other files on the same folder to be discarded depending on the lines after the affected %include.
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-02Add comments to include.am files to note where new sources goNick Mathewson
This mechanism isn't perfect, and sometimes it will guess wrong, but it will help our automation.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-02Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-02Add an errno.h include to freespace.c to fix bug 28974.Nick Mathewson
2018-11-14Normalize .may_include to always have paths, and paths to includeNick Mathewson
2018-07-10Merge branch 'ticket26223'Nick Mathewson
2018-07-10Document compat_getdelim_.Nick Mathewson
2018-07-10Rename torlog.[ch] to log.[ch]Nick Mathewson
Fun fact: these files used to be called log.[ch] until we ran into conflicts with systems having a log.h file. But now that we always include "lib/log/log.h", we should be fine.
2018-07-10Rename util_malloc to malloc.Nick Mathewson
2018-07-10Integrate getdelim() and getline() support into Tor.Nick Mathewson
2018-07-03Remove ATTR_NONNULL macrorl1987
2018-07-01File-level documentation for some of src/lib.Nick Mathewson
2018-06-29Move tor_get_avail_disk_space() to lib/fsNick Mathewson
2018-06-28Move DLL support to lib/fsNick Mathewson