The weak/strong symbol approach requires that psql.c undefs the debug
macros to define function implementations. This means functions in psql.c
call psql_lock()/psql_unlock() as functions, not macros.
In debug builds, these must be strong overrides that call the _do_
variants to properly maintain lockctr/rdlockctr. Without these overrides,
the weak stubs are used which don't update counters, causing assertion
failures in psql_unlock().
Added strong overrides in psql_debug.c for:
- psql_lock() -> psql_do_lock(__FILE__, __LINE__)
- psql_rdlock() -> psql_do_rdlock(__FILE__, __LINE__)
- psql_statement() (calls psql_do_lock directly)
Also made psql_statement, psql_start, and all query/prepare functions
weak in psql.c to allow debug overrides.
Fixes#138
Co-authored-by: Levi Neely <lkn@darkstar.example.net>
- Use pkg-config to dynamically detect mbedtls variants (mbedtls3.x, mbedtls)
- Fallback to /usr/local if pkg-config unavailable
- Tested on Fedora 41 (mbedtls3.6), Arch Linux (mbedtls 3.6.5), Debian Bookworm, and Slackware
- Eliminates need for hardcoded version-specific paths
Co-authored-by: Levi Neely <lkn@darkstar.example.net>
* pcommands.h for command ids
* remove compiler compat junk
* transient and unnecessary includes resolved
* unnecessary goto
* function naming and whatnot
* use readline for better command line UX
* add readline to CI workflow
* Revert "migrate mbedtls to 3.x (#89)"
This reverts commit f87367211d.
* prevent multiple execution of psync_fs_do_sotp and use atexit in sig hnd
* remove debug.[ch] in favor of plibs debug
* eliminate pcompat
* Decompose namespaces and other cleanup
* add missing unistd.h to psys.c (#113)
* remove useless comment
* code cleanup and removal
- remove useless wrapper functions
- remove obfuscating typedefs
- code reorganization and reformatting
- function renames for clarification
* prepare pcompat.h for decomposition
* remove dead function psync_rebuild_icons, reorganize pfsstatic.c headers
* separate pdevice from pcompat
* reorg function prototypes, remove more compat stuff
* renamed mutex for brevity
* remove dead debug code; plibs version is more sophisticated
* remove dead code, stale comments
* moved psync_delete_cached_crypto_keys to psynclib
* forgot to remove the function prototype from pdiff.h
* reorganized functions by accessibility, inlined useless psync_cache_contacts function
* remove unused header
* ppath object decomposed from pcompat
* ppath namespace
* ppath struct renames
* ppath final cleanup
* refactor, remove compatibility code
* format
* prun decomposed from pcompat for thread mgmt
* slim down prun.c
* remove useless comments
* move pagesize to pmemlock, pmemlock namespace
* pmem decomposed from pcompat, pmem namespace
* decompose psys from pcompat
* fix psys function names, remove more compatibility junk
* prand decomposed from pcompat
* psock decomposed from pcompat
* types renamed for ns consistency, brevity
* cleanup psock, remove unused proxy code
* remove unused headers psock
* putil for utility macros and functions
* forgot to move some psock constants
* move time macro to psys
* eliminate pcompat completely; new pfile namespace
* cleanup
- moved thread name definition
- explicit externs in implementation instead of headers for now
- better extern name
* migrate mbedtls to 3.x
* update github c-cpp workflow to use trixie
* update README and container-build
- default image and tag for container-build is now debian:trixie
- README for debian bookworm users
* final readme tweaks
* second attempt to update ci build workflow
* third attempt on ci build workflow
* fix deprecated calls in pssl.c
* list_sync_folders seems to work
* list_sync_folders breaks with sync folders in db; message size problem?
* fixed sync folders list
* fix double free and buffer overflow
* wip: add and remove sync folder; need to fix request->value in instance_thread
* remove comment
* removed pclsync_lib_c.{h,cpp}
* cleanup get_answer_to_request
* update comment
* changed reply struct to type response containing payload and msg
* cleanup
* refactored overlay_client, and poverlay; added docs
* better naming
* sock path in poverlay_protocol.h
* clarify comment
* refactor psync_overlay_get_response
* clarifications
* response_messages work with and without payload
* removed commented code
* syncadd works, but i need to fix the error handling
* remove sync folder
* remove commented code, change printfs to debug or simply remove
* removed unnecessary print
* removed more prints
* removed dead var
* update error handling in add_sync_folder, fix memleak
* simplified finalize
* openssl is a dependency
* openssl is not a real dpendency
* static link by default
* wip: build containers
* rm comments
* build containers, fix DEADLYSIGNAL on run with no args
* debug tools in deb/ubuntu, fix#44
* no slack container :(
* ensure P_LINUX_OS always defined
* error check fuse unmount ops
* fsanitize=thread temporarily
* undo
* clang static analysis
* fix dead assignment
* makefile quality of life stuff
* make install and uninstall; ignore scan results
* addressed dead assignments from static analysis
* debug and release builds possible
* gcc still default compiler
* debug symbols on debug build only
* fixed 2 of the 3 memory leaks
* fixed more memleaks
* more leaks
* another one
* BUGHUNT mode to look for more mem leaks
* merge poverlay_linux and pclsync
* reorg source tree, link system mbedtls
* remove cmakelists.txt
* update ci workflow
* -Werror to -Wall
* libpcloudcc_so in makefile
* single makefile works
* removed extra makefiles
* tagged mbedtls lib with version
* added source tree for mbedtls 2.1.14
* pcloudcc compiles with upgraded library mbedtls-2.x
* working on a segfault
* Revert "pcloudcc compiles with upgraded library mbedtls-2.x"
This reverts commit 8ccdb71ab8.
* build with debugging symbols
* trying a different approach; upgrading pupload.c
* updated mbedtls headers, using compat header
* all but pssl now using new headers
* updated pssl.h dependencies
* mbedtls2 rename.pl on all but pssl.{c,h}
* removed more commented code
* removed mbedtls-1.x from cmakelists
* program compiles with mbedtls 2.x, but remains offline.. why?
* removed mbedtls-1.x from source tree
* fixed handshake, now peer cert returning null
* mbedtls upgrade to 2.x completed!
* compat header removed; startcrypto no longer working
* fix start_crypto handler; need to check ret == 0
* fix linking problem on first login
* fixed startcrypto!