* Fix memory leaks in prpc_sockpath and prpc_main_loop prpc_sockpath allocated home via ppath_home but never freed it before returning. prpc_main_loop had three early-return paths that leaked sockpath before the normal free at bind() success. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix memory leaks and bad-free in cache and crypto sector log pcache.c: cache_timer and pcache_clean called pmem_free(he->value) directly instead of he->free(he->value), skipping the registered free callback. This caused all cached SSL connections, TLS sessions, and crypto decoders to leak their internal mbedtls state on eviction and shutdown. Same bug fixed in pcache_clean_oneof. pfscrypto.c: ptree_for_each_element_call_safe passed bare free() to free psync_sector_inlog_t nodes, but those are allocated via pmem_malloc which prepends a 16-byte header. Add free_sector_inlog() helper that calls pmem_free and use it at both call sites. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix bad-free in psync_interval_tree_free Interval tree nodes are allocated via pmem_malloc, which prepends a 16-byte header. Passing bare free() to ptree_for_each_element_call_safe freed the wrong address. Add free_interval_tree_node() helper that uses pmem_free and use it in psync_interval_tree_free. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix bad-free in pcache callbacks using pmem-allocated values pcache_add callers in ppagecache.c and pfstasks.c registered bare free() as the eviction callback, but the stored values were allocated with pmem_malloc/pmem_malloc_array which prepends a 16-byte header. After the pcache_clean fix that now correctly invokes callbacks, these bad-frees became fatal. Replace with static helpers that call pmem_free with the correct subsystem. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix memory leaks in pfs_reopen_file_for_writing and clean_uploads_for_task pfs.c: encsymkey from pcryptofolder_filencoder_key_get was freed on all error paths in pfs_reopen_file_for_writing but not on the success path that returns 1 after ppagecache_copy_to_file_locked. pfsupload.c: fr from psql_fetchall_int was never freed in clean_uploads_for_task; add pmem_free after the upload loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix spurious 'not mounted' error on FUSE3 shutdown In FUSE3 mode, pfs_do_stop called fuse_unmount followed by fuse_exit. The FUSE thread then called fuse_destroy, which tried to unmount again, producing "fusermount3: not mounted". For FUSE3, fuse_exit is sufficient to stop the loop; fuse_destroy handles the unmount. Restrict the explicit fuse_unmount call to FUSE2 only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Levi Neely <lkn@darkstar.example.net> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| dev | ||
| doc | ||
| pclsync | ||
| tests | ||
| .clang-format | ||
| .clang-tidy | ||
| .envrc | ||
| .gitignore | ||
| CLI11.hpp | ||
| LOG-MANAGEMENT.md | ||
| Makefile | ||
| README.md | ||
| control_tools.cpp | ||
| control_tools.h | ||
| default.nix | ||
| detect_fuse.sh | ||
| flake.lock | ||
| flake.nix | ||
| main.cpp | ||
| pcloudcc.logrotate | ||
| pclsync_lib.cpp | ||
| pclsync_lib.h | ||
| rpcclient.cpp | ||
| rpcclient.h | ||
README.md
Introduction
pcloudcc is simple linux console client for pCloud cloud storage derived from the console-client developed by pCloud. This version is independently maintained by me, whose only affiliation with pCloud is as a user of their services. Due credit goes to Anton Titov, Ivan Stoev, and pCloud.
Supported Platforms & Distributions
The target operating system and platform for this program is linux/amd64, and has been reported to work on linux/aarch64. Program behavior on 32-bit architectures is considered undefined.
I aim to support as many distributions as possible. I maintain a package for AUR and Nix. I do not plan on providing or maintaining any other packages, but encourage anyone interested in doing so for their own distributions.
Compatibility Matrix
| Distribution | FUSE |
|---|---|
| Debian trixie | 2.x |
| Debian trixie | 3.x |
| Arch Linux (rolling) | 3.x latest |
| Fedora 41 | 3.x |
| Fedora (latest) | 3.x latest |
| Debian forky | 3.18+ |
All configurations require mbedTLS 3.x. Runtime mount testing was performed manually on FUSE 2 (libfuse 2.9.x), FUSE 3 (libfuse3 3.10.5), and FUSE 3.18+ (Debian forky container).
Notices
Security Notice
My code audits are best-effort, and I make security enhancements as I identify problems. However, I do not promise that this program is free of even older and well-known security vulnerabilities. Therefore, I recommend using this program only on a trusted single-user system. Security-related code audits and contributions are most welcome!
See Also
-
Contributing: Read this if you're interested in helping out. Short version: do your best to write good code, be courteous to maintainers, and most importantly: have fun!
-
Building: Read this if you're not sure how to build
pcloudcc. For most users,makeandmake installare enough. -
mbedtls 3.x migration notes: Read this if you use an older distribution such as
debian:bookwormand encounter build problems. -
Device Validation Guide: Read this if you're running
pcloudccand encounter device validation-related errors. -
Usage Guide: Read this if you're unsure how to start using
pcloudcc. -
Log Management Guide: Read this to configure log rotation, cache size limits, and custom log paths. To set up automatic log rotation, copy
pcloudcc.logrotateto/etc/logrotate.d/pcloudcc. -
pcloudcc-service: Container-based systemd service for running
pcloudccin userspace with podman. Includes multi-stage Dockerfile that buildspcloudccfrom source and Quadlet systemd unit for automated background syncing.