Go to file
jolavillette 6622cb9526 service: harden the terminal account creation
Follow-up to "Added account creation for retroshare service", touching
only that feature's own paths.

**-U create could only mint a brand-new PGP profile.** A null RsPgpId was
always passed to createLocationV2(), so a user who already has a profile,
sees it in the -U list output and picks [c] silently got a second
identity: their friends no longer recognise them and every certificate
has to be exchanged again. createLocationV2() takes pgpId as in/out and
reuses it when non-null (rsinit.cc:2247), and it explicitly accepts an
empty pgpName in that case (rsinit.cc:2243), so the profiles known to
RsAccounts::GetPGPLogins() are now listed first and reusing one just adds
this machine as another node. The prompt spells out what a new profile
costs.

**Ctrl-C at a prompt reported the wrong thing.** On glibc signal()
installs the handler with SA_RESTART, so the read blocked behind getline
is restarted and keepRunning is only seen once the user also presses
Enter. Control then fell out of the selector with prefUserString still
"list", RsPeerId("list") null, and the user who had just cancelled was
told their location id was invalid, with exit -EINVAL. Cancelling now
returns 0. doTerminalCreateAccount() returns a three-state result so a
deliberate abort is no longer reported as a failure, and the failure
paths use -RsInit::ERR_* instead of a bare -1 (exit 255).

**-U list failed on a non-tty even when accounts existed.** It returned
ERR_NO_AVAILABLE_ACCOUNT whenever stdin was not a terminal, while the
option is documented as a way to list accounts and retroshare-webui's
README puts it in the first-start flow. It now prints the list and
returns 0, keeping the error for the case it names: nothing to list. The
[c] line moved below that check, so a non-interactive run no longer
advertises an option it then refuses.

**Every prompt is bounded.** A terminal dying mid-prompt -- an ssh
session dropping, a container losing its tty -- turns each following read
into an immediate EOF, and all these loops re-ask on empty or mismatched
input. Three attempts then a clear message. This also covers the -W web
interface password loop, which had the same shape before this feature
existed.

**A passphrase is no longer asked of an absent terminal.** The
PASSWORD_REQUESTED handler now checks for an interactive stdin first, so
-U <hexid> under systemd or docker fails with a readable message instead
of prompting nothing.

Selections are trimmed, so "1 " and a CRLF line are no longer rejected as
invalid, and MAX_PROMPT_ATTEMPTS sits outside the terminal-login guard
because the web interface password prompt has its own build option.
Compile-checked in all four RS_SERVICE_TERMINAL_LOGIN /
RS_SERVICE_TERMINAL_WEBUI_PASSWORD combinations, warning-free.

Note that the underlying spin is a libretroshare bug: rs_getpass() stored
getchar()'s EOF in an unsigned char, where -1 becomes 0xFF and never ends
the loop. Fixed separately in libretroshare; the bounds here are useful
on their own and do not depend on it.
2026-08-28 13:50:32 +02:00
.github/workflows Fix GitLab mirror failing on GitHub PR refs 2026-07-23 18:10:46 +02:00
.reuse Improve license according to REUSE 3.0 2019-12-18 17:57:20 +01:00
build_scripts Fix and upgrade GitlabCI 2026-06-17 01:31:19 +02:00
data .desktop file remove absolute path for icons; fixes #2925 2025-08-12 22:39:27 +02:00
jsonapi-generator Integrate python3 JSON API generator into libretroshare 2021-12-13 18:46:56 +01:00
libbitdht@4355ea96b2 Purge retroshare-service stale Android code 2026-06-14 16:24:55 +02:00
libretroshare@cafaaa1964 Update submodules 2026-06-14 15:53:03 +02:00
LICENSES Improve license according to REUSE 3.0 2019-12-18 17:57:20 +01:00
openpgpsdk@40db9d6bfe Purge retroshare-service stale Android code 2026-06-14 16:24:55 +02:00
plugins fix(voip): keep aspect ratio in camera preview 2026-08-16 18:24:46 +02:00
retroshare-friendserver build(friendserver): link OpenSSL again (needed via inlined libretroshare headers) 2026-06-06 19:01:11 +02:00
retroshare-gui Merge pull request #3276 from csoler/v0.6-IdentityDialog3 2026-08-28 12:21:25 +02:00
retroshare-service service: harden the terminal account creation 2026-08-28 13:50:32 +02:00
retroshare-webui@a28d77fe9a Purge retroshare-service stale Android code 2026-06-14 16:24:55 +02:00
supportlibs Merge branch 'master' into CMakeMigration-Modular-CrossPlatform 2026-06-15 00:20:57 +02:00
tests Fix G10h4ck contributions copyright attribution 2026-06-14 16:10:56 +02:00
.gitignore Wiki: Core event logic and cleanup 2026-01-05 23:16:00 +00:00
.gitlab-ci.yml More attempts at fixing GitlabCI 2023-11-27 02:08:21 +01:00
.gitmodules use absolute URLs for submodules 2026-01-18 10:05:39 -05:00
.travis.yml Disable Travis CI Linux to save scarce credits 2021-09-02 12:07:04 +02:00
BUILD-cmake.md docs: add packaging and deployment section for Windows/MSYS2 in BUILD-cmake.md 2026-07-15 13:34:59 +02:00
CMakeLists.txt refactor(cmake): rename "monorepo" -> super-project terminology 2026-06-15 19:41:45 +02:00
COPYING Add COPYING 2020-04-01 16:35:22 +02:00
README.md Fix & improve guide 2025-09-17 21:43:51 +02:00
retroshare.pri fix(gui): give RetroShare GUI its own version, independent from libretroshare 2026-07-04 11:40:36 +02:00
RetroShare.pro added switch to compile with rnp or openpgp-sdk 2024-08-11 16:43:20 +02:00

RetroShare

RetroShare is a decentralized, private, secure, cross-platform, communication toolkit. RetroShare provides file sharing, chat, messages, forums, channels, boards and more.

GitHub release Downloads MINGW64 Qt5 Build UCRT64 Qt5 Build MINGW64 Qt6 Build GNU/Linux (via Gitlab CI) libretroshare GNU/Linux, Android (via Gitlab CI) Ask DeepWiki

Get the source

Clone this repository, enter the directory and then get the submodules with the following command

git submodule update --init --remote --force libbitdht/ libretroshare/ openpgpsdk/

Compilation

Short of comprehensive and updated documentation on how to build RetroShare (for the many supported platforms it runs on), scripts and recipes are provided in the aim of creating packages for the supported platforms (and more) in the build_scripts directory of this repository.

Compilation on Windows

Follow this file : WindowsMSys2_InstallGuide

With QtCreator : Windows-QtCreator-InstallGuide

Compilation on MacOSX

Follow this file : MacOS_X_InstallGuide

Compilation on Linux

Follow this file : Linux_InstallGuide

Releases

Latest release here

Other Builds RetroShare Downloads

Documentation