[PATCH] libwine: Add WINEUSER environment variable

Andrew Eikum aeikum at codeweavers.com
Mon Feb 10 08:11:31 CST 2020


On Sat, Feb 08, 2020 at 07:59:58PM +0100, Myah Caron wrote:
>  * If a user would rather not use their own username in the prefix.
>  * If a user wants multiple users in a wine prefix (e.g. as separate
> profiles for programs).

Wine doesn't handle having multiple "users" nor changing the
Windows-side username very well. I've forgotten the details, and
unfortunately didn't document them very well[1], but I remember this
being very problematic when we tried it for Proton. I don't think
adding a WINEUSER variable makes sense until multiple user profiles
are well supported.

[1] Frustrating lack of information here:
https://github.com/ValveSoftware/Proton/issues/605#issuecomment-416249569

Andrew

>  * If the prefix was created with proton, which replaces the username
> with steamuser, this allows the data under the home directory to be
> usable under vanilla wine without needing symlinks or renaming the
> directory.
>  * Similarly, this allows prefixes created under a different username
> (e.g. transferred from a different system) to be used.
> 
> Signed-off-by: Myah Caron <qsniyg at mail.com>
> ---
>  libs/wine/config.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libs/wine/config.c b/libs/wine/config.c
> index 2a3314cbfd..d05f021267 100644
> --- a/libs/wine/config.c
> +++ b/libs/wine/config.c
> @@ -263,14 +263,14 @@ static void init_paths(void)
>      struct stat st;
> 
>      const char *home = getenv( "HOME" );
> -    const char *user = NULL;
> +    const char *user = getenv( "WINEUSER" );
>      const char *prefix = getenv( "WINEPREFIX" );
>      char uid_str[32];
>      struct passwd *pwd = getpwuid( getuid() );
> 
>      if (pwd)
>      {
> -        user = pwd->pw_name;
> +        if (!user) user = pwd->pw_name;
>          if (!home) home = pwd->pw_dir;
>      }
>      if (!user)
> --
> 2.25.0
> 
> 
> 



More information about the wine-devel mailing list