os: auth: improve readability and robustness of auth proto list
The code is easier to understand, but also more robust (eg. against struct layout changes) if structs are initialized with explicit field names instead of as lists. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
030b441e21
commit
58e661e1cc
27
os/auth.c
27
os/auth.c
|
@ -66,20 +66,27 @@ struct protocol {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct protocol protocols[] = {
|
static struct protocol protocols[] = {
|
||||||
{(unsigned short) 18, "MIT-MAGIC-COOKIE-1",
|
{
|
||||||
MitAddCookie, MitCheckCookie, MitResetCookie,
|
.name_length = 18,
|
||||||
MitFromID, MitRemoveCookie,
|
.name = "MIT-MAGIC-COOKIE-1",
|
||||||
|
.Add = MitAddCookie,
|
||||||
|
.Check = MitCheckCookie,
|
||||||
|
.Reset = MitResetCookie,
|
||||||
|
.FromID = MitFromID,
|
||||||
|
.Remove = MitRemoveCookie,
|
||||||
#ifdef XCSECURITY
|
#ifdef XCSECURITY
|
||||||
MitGenerateCookie
|
.Generate = MitGenerateCookie
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
#ifdef HASXDMAUTH
|
#ifdef HASXDMAUTH
|
||||||
{(unsigned short) 19, "XDM-AUTHORIZATION-1",
|
{
|
||||||
XdmAddCookie, XdmCheckCookie, XdmResetCookie,
|
.name_length = 19,
|
||||||
XdmFromID, XdmRemoveCookie,
|
.name = "XDM-AUTHORIZATION-1",
|
||||||
#ifdef XCSECURITY
|
.Add = XdmAddCookie,
|
||||||
NULL
|
.Check = XdmCheckCookie,
|
||||||
#endif
|
.Reset = XdmResetCookie,
|
||||||
|
.FromID = XdmFromID,
|
||||||
|
.Remove = XdmRemoveCookie,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue