dri2: Fix authentication for < v8 clients (v2).

The legacy logic was embarassingly wrong; AuthMagic should return errno,
so returning FALSE only when AuthMagic returns nonzero is exactly wrong.

v2: Match drmAuthMagic by returning -EINVAL rather than EINVAL
    Fix trailing whitespace

https://bugs.freedesktop.org/show_bug.cgi?id=51400
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Knut Petersen <knut_petersen@t-online.de>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Christopher James Halse Rogers 2012-06-28 12:07:11 +10:00 committed by Keith Packard
parent 8b4f0a4fdd
commit a7b97b0fa8
1 changed files with 4 additions and 4 deletions

View File

@ -1111,14 +1111,14 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
return TRUE;
}
static Bool
static int
DRI2AuthMagic (ScreenPtr pScreen, uint32_t magic)
{
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
if (ds == NULL || (*ds->LegacyAuthMagic) (ds->fd, magic))
return FALSE;
if (ds == NULL)
return -EINVAL;
return TRUE;
return (*ds->LegacyAuthMagic) (ds->fd, magic);
}
Bool