kdump.etc, submit-report.sh: Enhance Steam ID/Account obtaining

Currently we hardcode the account-related VDF file path in kdump,
and expose it in "/etc/default/kdump" - this is unnecessary since
this path is not expected to change nor users to mess with it; thanks
Emil (@xexaxo) for this suggestion.

So, this patch improves things in some ways:

(a) Do not expose VDF path or Valve's server URL in user configurable
file - no reasons for users to mess with that.

(b) Generate "/home" mount point based on DEVNODE, also determine
the username based on "getent'ing" the passwd database. See CAVEAT
below.

(c) Move the VDF parsing to a separate function to clean up the
submit log path on submit-report.sh .

No functional change is expected after this commit.

CAVEAT: Notice that "getent passwd" is *VERY* slow, and if we follow
a generic approach of doing it for UID_MIN..UID_MAX, it takes quite
some time. So, instead we simplify and just query the user 1000; this
might be a bit incomplete, but it's still better than hardcoding a
username as it's done until now.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
Guilherme G. Piccoli
2022-02-23 16:25:13 -03:00
parent f6897255a2
commit d279ea84aa
3 changed files with 50 additions and 32 deletions

View File

@ -43,9 +43,3 @@ USE_PSTORE_RAM=1
# Setting LOG_SUBMISSION to '0' will disable this behavior; but notice that
# even with the log submission disabled, the logs are saved locally.
LOG_SUBMISSION=1
# Below some log submission settings, based on Steam config files and Valve
# URLs. These settings *should not* be changed, or else the log sending
# mechanism will be impaired.
LOGINVDF="/home/doorstop/.local/share/Steam/config/loginusers.vdf"
POST_URL="https://api.steampowered.com/ICrashReportService/ACTIONCrashUpload/v1"