History of src/util.c of 9472f708c99b4325
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History of file src/util.c at check-in 9472f708c99b4325

2026-01-23
14:29
Fix an incorrect comment in terms of content. file: [cc7d7c9d72] check-in: [d83de4a2d3] user: danield branch: trunk, size: 27352
2026-01-10
11:52
Do not try to use "notepad" as a text editor on non-windows systems. file: [99f3092e94] check-in: [9b263d87c1] user: drh branch: trunk, size: 27352
2025-12-23
16:06
Assorted fixes of typos and grammar in code comments. No functional changes. file: [26b025564d] check-in: [e2bdc10572] user: danield branch: trunk, size: 27314
2025-11-01
21:13
Add the new "fossil system" command (expected to abbreviate to "fossil sys" with commands that are useful on unprovisioned Windows machines, such as "ls". The "fossil which" command is change to "fossil sys which". Still a work in progress. file: [76b679f295] check-in: [27baef45ca] user: drh branch: system-cmd, size: 27314
2025-07-30
17:48
Fix a compiler warning in the previous check-in. file: [e202d80826] check-in: [a8ef11b63c] user: danield branch: trunk, size: 27973
2025-07-23
16:01
Replace a call to mprintf() with fossil_strdup(). file: [93b628d56f] check-in: [44e5125f8f] user: danield branch: gen-uuid, size: 27966
2025-07-07
15:11
Add a function for generating a random (v4) UUID and a test command using it. file: [6d57431160] check-in: [9472f708c9] user: danield branch: gen-uuid, size: 27966
2025-04-16
16:22
Add the --editor option to "fossil commit" and "fossil uv edit". file: [51d7aadf87] check-in: [7675987551] user: drh branch: trunk, size: 26830
2025-03-19
11:08
Add "jove" to the list of text editors that Fossil searches for if the "editor" setting and the VISUAL and EDITOR environment variables are not available. file: [837e0e86a9] check-in: [486f81b931] user: drh branch: trunk, size: 26521
2025-03-17
12:04
Setting the text editor (either the "editor" setting, or the VISUAL or EDITOR environment variables) to "off", "no", "false", or "0" cause the use of a text editor for checkin comment entry to be bypassed. [forum:/forumpost/9b613281b45a3df7|Forum post 9b613281b] file: [cc0f6d12d0] check-in: [cd03acbde2] user: drh branch: trunk, size: 26507
2025-03-16
19:15
Add the "fossil which" command, which even works on Windows. Enhance the fossil_text_editor() function so that it looks for common text editor names if it does not find a user-specified preference. file: [8ced81a2df] check-in: [fc60e44417] user: drh branch: trunk, size: 26457
2025-01-11
13:07
Change the previous check-in so that "2>/dev/null" is only added on unix, not on Windows or Mac. Suggested by [forum:/forumpost/ae7ed5b615|forum post ae7ed5b615]. file: [9ae31611c5] check-in: [36bd54234b] user: drh branch: trunk, size: 25156
2024-08-27
11:06
Move the file-specific definitions of the isatty() and fileno() macros into util.c's fossil_isatty() and fossil_fileno() in prep for an upcoming change which needs isatty(). file: [a390168e49] check-in: [898a70ce82] user: stephan branch: trunk, size: 25104
2024-08-23
20:51
Replace calls to strcpy() with a tree-local strcpy() clone to squelch unwarranted link-time warnings when building on OpenBSD. There is still one strcpy() instance in the upstream extsrc/shell.c. file: [745c823dcd] check-in: [c0b9b4487f] user: stephan branch: trunk, size: 24736
13:05
Fix missing "return" in the new fossil_strdup_nn() routine from the previous check-in. file: [ad6dc27b22] check-in: [a04d18198d] user: drh branch: trunk, size: 24570
13:00
Move the fossil_strdup() implementation from import.c over to util.c where it belongs. Add a new fossil_strdup_nn() that mimics the behavior of mprintf("%s",...), only faster. file: [57391f9b98] check-in: [0c9dff644e] user: drh branch: trunk, size: 24563
2023-02-17
14:37
A large collection of compiler warning fixes re. signed/unsigned comparison from Daniel D. file: [2779c06549] check-in: [c71f711ec9] user: stephan branch: compiler-warnings, size: 24119
2022-04-26
14:27
Fix a few **unused-but-set-variable** warnings. (reported by recent clang on MacOS at least). Also fix a **warn_unused_result** warning when calling nice() (gcc 7.5.0 on Ubuntu-18.04 and gcc 9.3.0 on Ubuntu-20.04) file: [da69b3c5ef] check-in: [74250821b1] user: mgagnon branch: trunk, size: 24105
2022-04-21
15:45
Changed fossil_nice_default() to use nice level 19 instead of 20, as 19 is the documented max. file: [3e7d8d2521] check-in: [2c8920296c] user: stephan branch: trunk, size: 23985
2022-04-14
16:58
Per /chat discussion, replace load_control() calls in selective pages with nice() and move load_control() into process_one_web_page(). There is still work to do here, e.g. allowing certain pages through (namely /chat, to facilitate coordination of site defense) and perhaps checking credentials if the load is too high and always allowing admin users. file: [f4daee2e3e] check-in: [9b0ebcaf23] user: stephan branch: load-control-rework, size: 23985
2021-12-22
15:17
Add comments to the 3 different temp-filename generator routines to cross-link them to one another. Add fossil_temp_filename() as an option to the "test-tempfile" command. file: [3d241c367e] check-in: [1aff463371] user: drh branch: trunk, size: 23670
2021-09-15
19:43
Fix harmless compiler warning on Win32. file: [5f0d2fcdb6] check-in: [e1996e2558] user: mistachkin branch: trunk, size: 23611
2021-08-31
10:39
Refactor the previous commit by adding a wrapper for `freopen()', and use the Cygwin-aware routines to convert path names to/from UTF-16. file: [0db7e9c877] check-in: [963de841f2] user: florian branch: win32-temppath-mojibake, size: 23611
07:01
On Windows, make sure temporary path names containing non-ASCII characters are accessible, for example if the default temporary path "C:\Users\«Username»\AppData\Local\Temp" contains a user name with extended characters, of if the %TEMP% environment variable points to a directory name with extended characters. file: [673d1b545a] check-in: [102339828b] user: florian branch: win32-temppath-mojibake, size: 23617
2021-08-28
16:36
Further improvements to fossil_temp_filename() to help ensure that the correct directory separators are used on both unix and windows. file: [5d3a4d946c] check-in: [5434d2e32c] user: drh branch: trunk, size: 23329
15:46
More robust implementation of fossil_temp_filename that does not require an open connection to a real database. file: [12e1e2904f] check-in: [939696667a] user: drh branch: trunk, size: 23146
2021-08-27
11:29
Fix the goofy non-quoting of URL arguments to "start" on windows by including an extra quoted empty term. [forum:/forumpost/9600b10ffd0a7483|Forum post 9600b10ffd0a7483]. file: [ea2c37550c] check-in: [0d8c92882a] user: drh branch: trunk, size: 22458
2021-08-07
17:28
Improved error message upon timeout. Combine redundant implementations of the function that finds user and kernel CPU usage. file: [b395caf6be] check-in: [6c3d370496] user: drh branch: trunk, size: 22453
2021-06-24
16:40
Improvements to comments on the filename shell quoting logic and test logic. No changes to code. file: [333d90cb48] check-in: [255a28b37a] user: drh branch: trunk, size: 22454
16:31
Improvements to command-line safety checks for Windows. Enhance the command-line argument quoting fuzzer to inject all kinds of multi-byte UTF-8 characters. file: [63b4f26bf6] check-in: [6d2e48b4cd] user: drh branch: trunk, size: 22437
2021-06-22
17:28
There is a fossil_spawn() implementation for windows here, using _wspawnvp(). But it does not work. Apparently _wspawnvp() does not preserve the argument boundaries. file: [8599231549] check-in: [be6aa9e637] user: drh branch: demo-windows-wspawn-error, size: 24796
07:56
Constness fix to the new fossil_spawn() function to avoid compiler complaints on current macOS. file: [21da6c2f3b] check-in: [eefb8e64ed] user: wyoung branch: fossil-spawn, size: 24011
2021-06-21
22:37
Created fossil_spawn() as a dumb-as-rocks wrapper for posix_spawnp(2) and created tests to prove that it doesn't double-interpret its args as fossil_system() does. This isn't portable yet; it's just a seed we can use to bring this branch to a PoC state. file: [15f68d2a6a] check-in: [fb7c579736] user: wyoung branch: fossil-spawn, size: 24010
13:53
Add the "fossil bisect run" command. file: [1fbe5a057c] check-in: [7d4cf0ed69] user: drh branch: trunk, size: 22558
12:35
In the test-fossil-system command, show the result code coming back from each command. file: [d731cfbf21] check-in: [f6b67e157e] user: drh branch: trunk, size: 21907
2021-03-25
01:32
Reduce fossil_panic() calls to those indicating bugs and internal errors. Also clarify effects and purposes of fossil_fatal() vs. fossil_panic(). file: [cc4ade164c] check-in: [91a4652f22] user: larrybr branch: panic-reduction, size: 21858
2021-01-27
13:32
More TH1 performance optimizations: Go directly to malloc() rather than through the Th_Malloc() intermediary. file: [0ab500757e] check-in: [9b4f2d8e98] user: drh branch: trunk, size: 21858
2021-01-07
20:48
Show the resident set size (RSS) on the /test_env page. file: [9dd3ee766a] check-in: [b00e20c7ec] user: drh branch: trunk, size: 21711
2021-01-03
16:40
Use the "plunk" sound for audiable alert in chat. Back out the "ping" processing logic. file: [5cb7845c9a] check-in: [f2fcdbc505] user: drh branch: trunk, size: 21504
2021-01-02
12:58
Improvements to the test-random-password command. file: [d3c6aa0b33] check-in: [931b97e8ae] user: drh branch: trunk, size: 20135
2020-08-21
23:20
Rework forum post serial IDs to include a revision number when edited. This fixes buggy sids displayed in thread https://fossil-scm.org/forum/forumpost/6737a387fe?t=c&threadtable. file: [65c28c9c9f] check-in: [dd47b8c311] user: andygoth branch: andygoth-forum-refactor, size: 19474
2020-06-09
23:32
Improvements to fossil_assert_safe_command_string(), especially for windows. file: [de0723ef68] check-in: [ce16c59499] user: drh branch: trunk, size: 19141
17:32
Improvements to command-string sanitizing and the the sanitizer test command. file: [6ad3d4313c] check-in: [e3185aee7f] user: drh branch: safe-fossil-system-test, size: 18878
16:47
Begin splitting up fossil_assert_safe_command_string() into separate windows and unix implementions. Add the test-fossil-system command for testing. file: [33335ba55f] check-in: [9c38a004ad] user: drh branch: safe-fossil-system-test, size: 17910
00:38
Allow '&' as the last character in a fossil_system() string. file: [850cb989a3] check-in: [84346a317b] user: drh branch: trunk, size: 17366
2020-06-08
23:37
Add a safety scan of all strings passed into fossil_system(). Fatal error if the input string seems unsafe. file: [ed308b4eaf] check-in: [a046f916d3] user: drh branch: trunk, size: 17259
2020-05-27
22:14
Updated all user-facing documentation and "fossil help" output (plus select internal comments and function names) to use "hash" rather than "UUID". No functional changes. (Yet?) See forum thread https://www.fossil-scm.org/forum/forumpost/ddc14c6866 for discussion. file: [b774c15249] check-in: [df5201950e] user: wyoung branch: uuid-to-hash, size: 15728
2020-04-23
18:36
Begin adding the ability to restrict self-registration to people with a particular email address pattern. This check-in provides the setting to specify the authorized email addresses, but an attacker can still lie about his email address and sneak in that way. Still a work-in-progress. file: [ba9c17c604] check-in: [7916dbaa03] user: drh branch: restricted-self-registration, size: 15719
2020-04-05
23:45
Match the COMMAND and WEBPAGE names with _cmd and _page functions; forumpost/045bffda68 file: [ded7fa205b] check-in: [06afb7022f] user: ashepilko branch: api-cleanup, size: 15456
2019-09-10
11:30
Performance optimization in fossil_strcmp(). file: [907ebfaf83] check-in: [72a4b61347] user: drh branch: trunk, size: 15452
2019-08-23
12:42
Add the fossil_random_password() utility function and use it to generate a stronger initial admin-user password in the "fossil new" command. file: [28a9c1dd25] check-in: [23a9f9bac2] user: drh branch: trunk, size: 15560
2018-07-15
19:56
Clarify the difference between fossil_fatal() and fossil_panic(). The fossil_panic() interface puts a message on the error log when generating webpages. Otherwise the two routines are identical. Convert some fossil_fatal() calls into fossil_panic() where appropriate. The goal here is to limit messages on the error log to things that require attention from the system administrator, or represent bugs. file: [8c7d4b565f] check-in: [3f5ab71744] user: drh branch: trunk, size: 14086
2018-07-13
21:36
Improved process debugging for "fossil ui" and "fossil server". Sanely close the open database connection upon receiving SIGPIPE. file: [49632b4886] check-in: [83b171bcd1] user: drh branch: trunk, size: 14086
2018-03-17
22:33
Merge updates from trunk. file: [74d0258c52] check-in: [5447bc9028] user: mistachkin branch: withMman, size: 13942
22:32
Fix harmless compiler warning. file: [a633e66042] check-in: [e2a90ed56e] user: mistachkin branch: trunk, size: 13358
21:16
POSIX enhancements for fossil_get_page_size(). file: [f7610cb50e] check-in: [fd1bee7279] user: mistachkin branch: withMman, size: 13938
20:31
Experimental support for using 'mman.h' when compiling for POSIX. file: [c61345cfc3] check-in: [37b69e7d0c] user: mistachkin branch: withMman, size: 13843
2018-03-07
19:46
Rid the code of the legacy UUID_SIZE macro. Replace it everywhere with either HNAME_MAX or HNAME_LEN_SHA1 or HNAME_LEN_K256, as appropriate. file: [a9ee84f1f2] check-in: [323299cb56] user: drh branch: trunk, size: 13354
2018-01-17
19:29
Only make the first argument to pledge() available using the fossil_pledge() interface. The second argument is always NULL. file: [c4d7bb8b1f] check-in: [91ccde50a0] user: drh branch: trunk, size: 13296
19:04
Automatically detect the presence of the pledge() system interface and use it if it is available. file: [220c702369] check-in: [64def88f8b] user: drh branch: trunk, size: 13350
2018-01-15
21:50
Remove unnecessary whitespace. file: [d3a811d45f] check-in: [73d0734a4b] user: andybradford branch: mistake, size: 13364
21:48
Update the comment for fossil_pledge to reflect the new change in [1180676e]. file: [0b1ad26c58] check-in: [8993c3324a] user: andybradford branch: trunk, size: 13365
21:43
Only #define fossil_pledge in config.h if FOSSIL_HAVE_PLEDGE is not defined so that makeheaders can pick up the function prototype for checkin.h when FOSSIL_HAVE_PLEDGE is defined. file: [4ca8629c10] check-in: [1180676e9b] user: andybradford branch: trunk, size: 13364
17:35
End comment with matching #define for new fossil_pledge_impl() routine---no functional change. file: [c9a07aa86c] check-in: [cefcc87e08] user: andybradford branch: trunk, size: 13369
16:18
Add the fossil_pledge() utility routine, that is a no-op unless compiled with FOSSIL_HAVE_PLEDGE. file: [f537e9698f] check-in: [7b81a9993b] user: drh branch: trunk, size: 13362
2017-12-15
18:27
Remove pointless code that initializes a BSS data structure to zeros, even though it is already all-zero. This avoids a compiler warning in GCC7. file: [89f917cf84] check-in: [5419e7fcec] user: drh branch: trunk, size: 12829
2017-06-24
16:28
Fixed "integer constant is too large for long type" warning on 32-bit Linux file: [5882876217] check-in: [caf2681720] user: andygoth branch: trunk, size: 12952
13:59
Increase the stack size limit to 8MB. Disable stack and heap size limits prior to invoking subprocesses. file: [2634b30182] check-in: [3f193ba610] user: drh branch: trunk, size: 12944
2017-06-20
13:35
On unix, use setrlimit() to limit total heap space usage to 1GB on 32-bit systems and 10GB on 64-bit systems, and total stack space to 2MB, as a proactive defense again the "stack clash" vulnerability found on many unix-like OSes. I do not yet know if these limits are reasonable. file: [ae9317b099] check-in: [6e6e4b1d26] user: drh branch: trunk, size: 12452
2016-10-04
19:05
Add an assert(). file: [9a3cc502aa] check-in: [e6a5634f24] user: mistachkin branch: seeEnhanced, size: 11784
2016-09-23
02:28
Merge updates from trunk. file: [7260892081] check-in: [4f619c020a] user: mistachkin branch: seeEnhanced, size: 11757
2016-08-24
14:56
Unbreak compilation on Cygwin. Allow notepad to be used as unversioned content editor (notepad cannot handle UNIX line-endings) file: [08c5fc011a] check-in: [6728970b76] user: jan.nijtmans branch: trunk, size: 10319
2016-08-23
13:01
Add the "fossil unversioned edit UVFILE" command. file: [cad066defc] check-in: [1d6b67822a] user: drh branch: trunk, size: 10345
2016-05-28
21:23
Enhancements to SEE integration. file: [2b396c37cc] check-in: [4e34191c3d] user: mistachkin branch: seeEnhanced, size: 10602
2015-01-21
18:55
Enhance the ad-unit processing to allow for tall right-side column ads as an alternative to banner ads. file: [9f02b01358] check-in: [4bc5b6cf9b] user: drh branch: ad-unit-enhancement, size: 9164
2014-10-21
09:27
merge trunk file: [e515fb3284] check-in: [154abe4d47] user: baruch branch: svn-import, size: 8932
09:22
Very very basic svn-dump import. Can not handle anything realistic yet file: [8c95679104] check-in: [287cd78e27] user: baruch branch: svn-import, size: 8571
2014-10-06
00:58
Add an assert() to prove that Fossil server instances are not vulnerable to the ShellShock bug because it never shells-out while processing an HTTP request. file: [227890c094] check-in: [82e30c0000] user: drh branch: trunk, size: 8919
2014-08-07
10:02
"char const" -> "const char" and various other coding style improvements. No functional change. file: [d776ecabc6] check-in: [4e18dba698] user: jan.nijtmans branch: trunk, size: 8558
2014-04-11
15:44
Refactored ATTACHMENT crosslinking a bit to remove some duplicate code (tested on libfossil repo). Replaced free() with fossil_free() (consistency). Added fossil_is_uuid(), the c-string counterpart of blob_is_uuid(). file: [369a0bac84] check-in: [b7ff537dca] user: stephan branch: trunk, size: 8559
2013-09-19
11:48
Fix MSVC build error and warnings: c:\localdata\workspace\fossil\src\util.c(249) : warning C4715: 'fossil_timer_fetch' : not all control paths return a value c:\localdata\workspace\fossil\src\util.c(270) : warning C4715: 'fossil_timer_reset' : not all control paths return a value file: [7054510104] check-in: [6e1e4bb83d] user: jan.nijtmans branch: trunk, size: 8314
2013-08-30
12:18
Add the --errorlog command-line option and the errorlog: parameter to CGI scripts. Log all panics, fatal errors, and warnings to the error log, if defined. Panic if file descriptor 2 is not open on unix. Clean up some routines that deal with close(). file: [a2369fb973] check-in: [4727ef4a8e] user: drh branch: trunk, size: 8330
2013-05-13
10:50
unused variable "fossilTimer" file: [d31f9b9215] check-in: [55d7e2c14a] user: jan.nijtmans branch: trunk, size: 8016
2013-05-08
20:18
Fixed a logic error in the only-run-once timer init code. file: [a20136c976] check-in: [9fab0f8125] user: stephan branch: trunk, size: 8100
20:09
Reworked the timer IDs to be positive values to simplify error checking a bit. file: [445d442155] check-in: [799458977e] user: stephan branch: trunk, size: 8086
19:54
Added fossil_timer_is_active(timerId), removed fossil_has_timer(). file: [09d6313070] check-in: [590406df3c] user: stephan branch: trunk, size: 7911
19:45
Added fossil_timer_xxx() family of functions and g.mainTimerId. file: [68ce23613a] check-in: [e28433a692] user: stephan branch: trunk, size: 7725
2013-02-21
15:50
Make win32 build compile again: - missing headers <io.h> and <fcntl.h> - WCHAR -> wchar_t file: [40229a2f25] check-in: [e3add2c115] user: jan.nijtmans branch: trunk, size: 3260
14:24
Added: Code refactoring: Move utility routines (ex: fossil_malloc()) out of main.c and into a new file util.c. Try to gather I/O routines into the printf.c source file. file: [bb167adb41] check-in: [bb0cedb15a] user: drh branch: trunk, size: 3258