Fixes recommended by maintainer. 1. Buffer Overflow in FUSE Options Parsing (pfs.c) - Fixed 2. Base64 Padding Bug (putil.c) - I believe the padding logic at lines 273-284 is not a bug - it's correct per RFC 4648 base64 specification. Padding is only added when length != 0 (i.e., when there's a partial final block), and the correct number of "=" characters are added based on whether 1 or 2 bytes remain. 3. Memory Leaks in pdiff.c - Fixed 4. Race Condition in Log Rotation (pdbg.c) - I believe the code is actually already correct. - The code at line 20 already uses volatile sig_atomic_t: static volatile sig_atomic_t log_reopen_requested = 0; This is the correct and safe pattern for signal handler communication: 1. sig_atomic_t - Guarantees atomic read/write operations (no partial updates) 2. volatile - Prevents the compiler from optimizing away accesses The pattern is correct: - Signal handler (pdbg_reopen_log at line 178-180) only sets the flag - async-signal-safe - Main code checks/resets the flag inside pthread_mutex_lock() (lines 133-136, 231-234) - Actual log reopening (do_reopen_log) happens in the main thread, not signal context This is a well-established and safe pattern. The mutex ensures the check-and-reset is serialized with other logging, and sig_atomic_t ensures the signal-to-main-thread communication is atomic. 5. Hardcoded RSA Padding (pssl.c) - Fixed 6. Unchecked Exception (pclsync_lib.cpp) - Fixed 7. Missing Input Validation - Fixed Issue #1: Double Logging and Memory Leak in `process_deletefile()` - Fixed duplicate log. - Note: There was no actual memory leak - the first path allocation at line 1731 was properly freed at line 1735 before the second allocation at line 1739. Issue #2: FUSE Options Parsing Problems - Fixed |
||
|---|---|---|
| .github/workflows | ||
| dev | ||
| doc | ||
| pclsync | ||
| .clang-format | ||
| .envrc | ||
| .gitignore | ||
| CLI11.hpp | ||
| LOG-MANAGEMENT.md | ||
| Makefile | ||
| README.md | ||
| control_tools.cpp | ||
| control_tools.h | ||
| default.nix | ||
| 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.
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!
Pending Transfers
Stopping the daemon will break pending background transfers!
pcloudcc does not currently provide a command to check for pending
transfers. You can currently check this by ensuring there is only one
file named cached in ~/.pcloud/Cache. Usually this is a large
file.
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.