[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#927139: [src:wine-development] wineserver doesn't work when /run/user/uid/ is not available



Hi Jens!

I've discovered this issue during own custom Wine build. Latest
upstream version (4.6) has no references to HAVE_GETUID and uses
getuid() directly, assuming it's available by default. I'm using
debhelper 12 with autoreconf, that's why HAVE_GETUID was absent and
wineserver directory setup via /run/user/uid/ was not compiled.

To trigger this bug on top of current version in Debian (4.2-2) just
replace "#if defined(HAVE_GETUID)" with "#if 0" in
debian/patches/fixes/temporary-directory.patch.
Nota bene: in that case almost any wine binary segfaults with malloc
issue, so you must call wineserver manually to discover pathname
issue.

2019-04-20 18:34 GMT+03:00, Jens Reyer <jre.winesim@gmail.com>:
> cotrol: tags -1 + moreinfo
>
>
> Hi Konstantin,
>
> On 15.04.19 15:11, Konstantin Demin wrote:
>> Source: wine-development
>> Version: 4.2-2
>>
>> wineserver fails to setup it's directory when /run/user/${pid} is not
>> available due to buggy patch.
>> please fix debian/patches/fixes/temporary-directory.patch:
>>
>> line 65:
>> -+            tmp_dir = xmalloc( sizeof(tmp_env) );
>> ++            tmp_dir = xmalloc( strlen(tmp_env) + 1 );
>>
>> line 110:
>> -+            n = fputs( root + sizeof(tmp_dir) + 1, stream );
>> ++            n = fputs( root + strlen(tmp_dir) + 1, stream );
>>
>> bug is caused by copy-paste mistake, because tmp_env and tmp_dir are
>> type of "char *", not "char []", therefore sizeof() isn't equal to
>> strlen() + 1.
>
> Thanks for your report.  I can' reproduce the issue here, but
> /run/user/$uid exists here (btw: typo pid/uid in your mail).  So can you
> please explain more specifically how to trigger this bug?  I'd like to
> know if this needs to be fixed for buster.
>
> Besides that, I rebuilt Wine with your fixes and all seems fine.  Your
> explanations sound good, but I have to admit I can't really verify them
> due to lack of C skills, and in-depth Wine code knowledge.
>
> Greets
> jre

-- 
SY,
Konstantin Demin


Reply to: