Linux installation of FreeFileSync versions higher than 11.16 for a regular user (i.e., a user without administrator pri

Get help for specific problems
Posts: 4
Joined: 16 Jan 2023

robix

There are three types of accounts in Linux Mint 20:
Custom
Administrator
Desktop user

During installation of Linux Mint 21.0 XFCE user type "Custom" was created as the default, but it generally plays the role of administrator. I gave it the name "privileged-user".

As usuall after an istallation, I've created another user (name: "regular-user") of "Desktop user" type. User "regular-user" does not have administrator privileges, so it is much more secure type of account.

FreeFileSync can be installed in two ways: for all users (requires root privileges) or locally ("for the current user").

When trying to run FreeFileSync_11.29_Install.run locally, for current user "regular-user" I have:
Accept the FreeFileSync license terms? [y]es, [n]o, or [s]how: [y/n/s] y
Sorry, user regular-user is not allowed to execute '/usr/bin/sh -c echo $HOME' as regular-user on my-rig.
HOME environment variable is not set for user "regular-user".
<Press a key>
Of course, environment variable "HOME" was set for "regular-user":
$ echo $HOME
/home/regular-user
After typing the command
/usr/bin/sh -c echo $HOME
in the terminal for the user "regular-user" the result is an empty line.

It looks like the installer executes
/usr/bin/sh -c echo $HOME
gets an empty line and assumes $HOME is not set.

For user "privileged-user", executing
/usr/bin/sh -c echo $HOME
yields non-empty $HOME: "/home/privileged-user".

So for the user "privileged-user" FreeFileSync_11.29_Install.run is OK.

Hence, you can install FreeFileSync 11.29 for current user only if that user has administrator privileges.

There is a fix: just type for the user "regular-user" in the terminal (note the ' character)
/usr/bin/sh -c 'echo $HOME'
and the result is "/home/regular-user", no administrator privileges are required.

The last version of FreeFileSync that allowed local installation for a non-administrator user was 11.16.

For version 11.17, the changes are described as follows
Show per-file progress in percent when copying large files
Log app initialization errors
Fixed uncaught exception after installation
Defer testing for third-party buggy DLLs until after crashing
Consider ReFS 128-bit file ID failure states (Windows)
Refer to volume by name: support names including brackets
Support local installation with non-standard home (Linux) <--- the "/usr/bin/sh -c echo $HOME" command was probably added here

So please consider for the next version of FreeFileSync change
/usr/bin/sh -c echo $HOME
to
/usr/bin/sh -c 'echo $HOME'
Posts: 4
Joined: 16 Jan 2023

robix

Sorry, the post title was truncated. The full title is
Linux installation of FreeFileSync versions higher than 11.16 for a regular user (i.e., a user without administrator privileges) is impossible (proposed fix)
User avatar
Site Admin
Posts: 7506
Joined: 9 Dec 2007

Zenju

There seems to be something else going on. FreeFileSync is executing something like:
echo $(sudo --user regular-user sh -c 'echo $HOME');
Does this return the correct HOME path on your system?
Posts: 4
Joined: 16 Jan 2023

robix

Thank you for the clarification.
Does this return the correct HOME path on your system?
No, executing
$ echo $(sudo --user regular-user sh -c 'echo $HOME');
returns
Sorry, user regular-user is not allowed to execute '/usr/bin/sh -c echo $HOME' as regular-user on my-rig.
But your post points out the problem. The command uses the "sudo".

The user "regular-user" is not a member of the "sudo" group (as it should be), so the entire command fails and returns an empty line.

Of course, a "privileged-user" can use "sudo", and the command is executed properly.
User avatar
Site Admin
Posts: 7506
Joined: 9 Dec 2007

Zenju

Fixed!
FreeFileSync 12.0
-----------------
Don't require sudo for non-root installation (Linux)
Posts: 4
Joined: 16 Jan 2023

robix

Great news, thanks.