On docker, `/proc/self/loginuid` is -1 by default, while on podman it is
0 (root), which makes aTrust services refuse to start, because after they
use `getlogin_r`, which is affected by `/proc/self/loginuid`, to get the
username successfully, they give up trying any other way (such as
`loginctl`) to get the non-root user used to start the http server (port
54631), even if the username they got is root.
This commit adds a LD_PRELOAD hook named fake-getlogin, which hooks
`getlogin` and `getlogin_r` to provide the non-root username directly.
This commit also:
- reduces errors when running postinst script of aTrust;
- uses LD_LIBRARY_PATH to make aTrust use its versions of libraries,
especially those very old and no longer getatable from debian
packages.
ECPASSWORD is used to set clipboard text in VNC, but its name is
confusing. So rename it to a more exact name.
This issue also adds document about clipboard in VNC.
Solve #251.
A component of aTrust, /usr/share/sangfor/aTrust/resources/bin/dmidecode_processor_tool,
seems to search for and try to run dmidecode in /usr/{bin,sbin}.
Exactly, it runs `sh -c 'path-to-dmidecode -t processor'` periodically
(or it is called periodically). If there is no dmidecode command in
/usr/bin or /usr/sbin, it runs `sh -c '-t processor'` instead, which
throws the `sh: 1: -t: not found` spam in console.
This commit creates a symbolic link to /bin/false in /usr/sbin/dmidecode
to suppress the spam.
To start danted successfully, all network interfaces listed in the
configuration of danted should occur and has ip(s). After started
successfully, danted can run without troubles even after the status
of thoes network interfaces is changed (such as deleted and recreated).
This commit creates a temporary tun interface with same name as Sangfor
VPN, assigns an ip, starts danted, and then deletes the interface.