pcloudcc-lneely/pclsync
Levi Neely bccf00ba52 Fix #90: Support 2FA when running as a daemon
In daemon mode, when PSTATUS_TFA_REQUIRED fires:
- Automatically send an SMS 2FA code via psync_tfa_send_sms()
- Log delivery details to syslog with instructions to use
  `echo 'tfa CODE' | pcloudcc -k`
- Block on a condition variable until the code arrives via RPC

Add a new `tfa <code>` command to the pcloudcc -k control interface.
This sends the code to the daemon over the existing Unix socket RPC
channel (SENDTFA message type).

Bad codes (PSTATUS_BAD_TFA_CODE) are handled: the daemon logs a syslog
warning and waits for a corrected code without re-sending SMS.

Devices are trusted by default (trusted=1 in psync_tfa_set_code) so
repeated 2FA prompts are avoided for the configured trust period.
TFA codes are wiped from memory after use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 21:11:07 +01:00
..
LICENSE reorg source tree, link system mbedtls (#38) 2024-08-15 19:49:57 +02:00
paccountevents.h reorg source tree, link system mbedtls (#38) 2024-08-15 19:49:57 +02:00
papi.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
papi.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pbusinessaccount.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pbusinessaccount.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pcache.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pcache.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pcommands.h Fix #90: Support 2FA when running as a daemon 2026-03-02 21:11:07 +01:00
pcompiler.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
pcontacts.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pcontacts.h reorg source tree, link system mbedtls (#38) 2024-08-15 19:49:57 +02:00
pcrc32c.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pcrc32c.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pcrypto.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pcrypto.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pcryptofolder.c fix compile errors (#155) 2025-05-15 19:14:57 +02:00
pcryptofolder.h access pcryptofolder directly from pclsync_lib (#125) 2025-03-09 19:58:00 +01:00
pdatabase.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
pdbg.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
pdbg.h Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
pdeflate.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pdeflate.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pdevice.c fix: add stdlib to fix build (#153) 2025-04-20 22:41:33 +02:00
pdevice.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
pdevmon.c fix compile errors (#155) 2025-05-15 19:14:57 +02:00
pdevmon.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pdiff.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
pdiff.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pdownload.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
pdownload.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
pfile.c Retry opening without the O_NOATIME flag (#167) 2026-02-27 08:40:38 +01:00
pfile.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
pfileops.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pfileops.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pfolder.c move folder-related code from psynclib to pfolder 2025-04-18 15:23:50 +02:00
pfoldersync.h move folder-related code from psynclib to pfolder 2025-04-18 15:23:50 +02:00
pfs.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
pfs.h 98 create a pdbg namespace (#139) 2025-03-13 20:28:09 +01:00
pfscrypto.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pfscrypto.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pfsfolder.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pfsfolder.h reorg source tree, link system mbedtls (#38) 2024-08-15 19:49:57 +02:00
pfsstatic.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pfsstatic.h reorg source tree, link system mbedtls (#38) 2024-08-15 19:49:57 +02:00
pfstasks.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pfstasks.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
pfsupload.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pfsupload.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
pfsxattr.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pfsxattr.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
pintervaltree.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pintervaltree.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
plibs.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
plibs.h 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
plist.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
plist.h 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
plocalnotify.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
plocalnotify.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
plocalscan.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
plocalscan.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
plocks.c 98 create a pdbg namespace (#139) 2025-03-13 20:28:09 +01:00
plocks.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pmem.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pmem.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
pnetlibs.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pnetlibs.h 98 create a pdbg namespace (#139) 2025-03-13 20:28:09 +01:00
pnotify.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pnotify.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pp2p.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pp2p.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
ppagecache.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
ppagecache.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
ppassword.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ppassword.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
ppassworddict.h reorg source tree, link system mbedtls (#38) 2024-08-15 19:49:57 +02:00
ppath.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ppath.h Musl fixes (#143) 2025-04-13 09:11:11 +02:00
ppathstatus.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ppathstatus.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pqevent.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pqevent.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
prand.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
prand.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
prpc.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
prpc.h 130 use trustworthy location for log and socket (#134) 2025-03-11 19:03:58 +01:00
prun.c fix: add stdlib to fix build (#153) 2025-04-20 22:41:33 +02:00
prun.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
prunthrottled.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
prunthrottled.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pscanexts.h Appease the LSP server (#73) 2024-11-26 19:36:49 +01:00
psettings.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
psettings.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
pshm.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pshm.h #64 simplify messaging and #71 deserialize failed (#88) 2025-02-25 09:46:46 +01:00
psock.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
psock.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
psql.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
psql.h 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pssl.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
pssl.h 98 create a pdbg namespace (#139) 2025-03-13 20:28:09 +01:00
psslcerts.h Add new pCloud SSL certificate fingerprint (#172) 2026-03-01 09:14:29 +01:00
pstatus.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pstatus.h Code cleanup and readline for better CLI UX (#116) 2025-03-09 09:14:12 +01:00
psuggest.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
psuggest.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
psyncer.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
psynclib.c Remove unused psync_status_file/folder wrappers 2026-02-14 20:08:01 +01:00
psynclib.h Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
psys.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
psys.h eliminate pcompat (#92) 2025-02-28 22:47:32 +01:00
ptask.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ptask.h 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ptevent.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ptevent.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
ptimer.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ptimer.h 98 create a pdbg namespace (#139) 2025-03-13 20:28:09 +01:00
ptools.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ptools.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
ptree.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
ptree.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
ptypes.h Appease the LSP server (#73) 2024-11-26 19:36:49 +01:00
publiclinks.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
publiclinks.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
pupload.c 102 create a psql namespace (#142) 2025-03-18 19:52:15 +01:00
pupload.h WIP: Decompose namespaces and other cleanup (#94) 2025-03-01 22:21:54 +01:00
putil.c Refactor logging, add cache-size, fs-event-log (#163) 2026-02-27 08:38:28 +01:00
putil.h move folder-related code from psynclib to pfolder 2025-04-18 15:23:50 +02:00
sockets.h Merge pclsync and poverlay_linux (#46) 2024-08-18 15:09:21 +02:00