Mirror of pcloudcc-lneely, an independent fork of pcloudcom/console-client hosted on Github.
Go to file
Jonathan Senkerik f445e80930 Merge branch 'fixes'
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
2026-02-18 22:08:15 -05:00
.github/workflows upgrade to mbedtls 3.x (#118) 2025-03-09 15:16:46 +01:00
dev arm64 arch devhost 2025-07-20 16:01:47 +02:00
doc update documenation, add FUSE options 2025-11-23 22:39:18 -05:00
pclsync fixes for MR 2026-02-17 23:06:35 -05:00
.clang-format manual formatting (#136) 2025-03-11 21:36:26 +01:00
.envrc enable direnv for dev shell 2025-04-13 08:47:23 +02:00
.gitignore Merge branch 'main' into nix-shell 2025-04-13 08:52:37 +02:00
CLI11.hpp Revert "Streamline CLI11.hpp to functionality actually used by pcloudcc" (#81) 2024-12-10 21:48:15 +01:00
LOG-MANAGEMENT.md update documenation, add FUSE options 2025-11-23 22:39:18 -05:00
Makefile Refactor logging, add cache-size, fs-event-log 2025-11-14 23:11:47 -05:00
README.md update documenation, add FUSE options 2025-11-23 22:39:18 -05:00
control_tools.cpp use process_command in process_commands (#135) 2025-03-11 20:49:22 +01:00
control_tools.h non interactive command processing (#123) 2025-03-09 19:18:38 +01:00
default.nix nix dev shell (#146) 2025-04-11 00:44:35 +02:00
flake.lock Nix shell uses flakes (#147) 2025-04-11 20:55:58 +02:00
flake.nix add watchexec to dev shell 2025-04-18 11:32:16 +02:00
main.cpp Merge branch 'fixes' 2026-02-18 22:08:15 -05:00
pcloudcc.logrotate Refactor logging, add cache-size, fs-event-log 2025-11-14 23:11:47 -05:00
pclsync_lib.cpp Merge branch 'fixes' 2026-02-18 22:08:15 -05:00
pclsync_lib.h Add support for account login by env vars 2026-02-18 22:02:49 -05:00
rpcclient.cpp 98 create a pdbg namespace (#139) 2025-03-13 20:28:09 +01:00
rpcclient.h 130 use trustworthy location for log and socket (#134) 2025-03-11 19:03:58 +01:00

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, make and make install are enough.

  • mbedtls 3.x migration notes: Read this if you use an older distribution such as debian:bookworm and encounter build problems.

  • Device Validation Guide: Read this if you're running pcloudcc and 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.logrotate to /etc/logrotate.d/pcloudcc.