|
1 # |
|
2 # Defines several macros in a public header. |
|
3 # |
|
4 # MIT defines g_OID_equal, g_OID_copy and GSS_EMPTY_BUFFER in private header |
|
5 # files. Solaris testsuite usr/ontest/lib/libgss/gss_api references them. |
|
6 # |
|
7 # This patch is unlikely to be accepted upstream. |
|
8 # Patch source: in-house |
|
9 # |
|
10 diff -pur old/src/lib/gssapi/generic/gssapiP_generic.h new/src/lib/gssapi/generic/gssapiP_generic.h |
|
11 --- old/src/lib/gssapi/generic/gssapiP_generic.h 2015-05-08 16:27:02.000000000 -0700 |
|
12 +++ new/src/lib/gssapi/generic/gssapiP_generic.h 2015-06-11 12:39:09.937906716 -0700 |
|
13 @@ -49,10 +49,11 @@ |
|
14 #include "k5-buf.h" |
|
15 |
|
16 /** helper macros **/ |
|
17 - |
|
18 +#ifndef g_OID_equal |
|
19 #define g_OID_equal(o1, o2) \ |
|
20 (((o1)->length == (o2)->length) && \ |
|
21 (memcmp((o1)->elements, (o2)->elements, (o1)->length) == 0)) |
|
22 +#endif |
|
23 |
|
24 /* this code knows that an int on the wire is 32 bits. The type of |
|
25 num should be at least this big, or the extra shifts may do weird |
|
26 diff -pur old/src/lib/gssapi/generic/gssapi_ext.h new/src/lib/gssapi/generic/gssapi_ext.h |
|
27 --- old/src/lib/gssapi/generic/gssapi_ext.h 2015-05-08 16:27:02.000000000 -0700 |
|
28 +++ new/src/lib/gssapi/generic/gssapi_ext.h 2015-06-11 12:40:45.859478118 -0700 |
|
29 @@ -43,6 +43,26 @@ gss_pname_to_uid |
|
30 uid_t *uidOut); |
|
31 #endif |
|
32 |
|
33 + |
|
34 +#ifndef GSS_EMPTY_BUFFER |
|
35 +#define GSS_EMPTY_BUFFER(buf) ((buf) == NULL || \ |
|
36 + (buf)->value == NULL || (buf)->length == 0) |
|
37 +#endif |
|
38 + |
|
39 +#ifndef g_OID_equal |
|
40 +#define g_OID_equal(o1, o2) \ |
|
41 + (((o1)->length == (o2)->length) && \ |
|
42 + (memcmp((o1)->elements, (o2)->elements, (o1)->length) == 0)) |
|
43 +#endif |
|
44 + |
|
45 +#ifndef g_OID_copy |
|
46 +#define g_OID_copy(o1, o2) \ |
|
47 +do { \ |
|
48 + memcpy((o1)->elements, (o2)->elements, (o2)->length); \ |
|
49 + (o1)->length = (o2)->length; \ |
|
50 +} while (0) |
|
51 +#endif |
|
52 + |
|
53 /** |
|
54 * Provides a platform-specific name for a GSSAPI name as interpreted by a |
|
55 * given mechanism. |
|
56 diff -pur old/src/lib/gssapi/generic/gssapi_generic.h new/src/lib/gssapi/generic/gssapi_generic.h |
|
57 --- old/src/lib/gssapi/generic/gssapi_generic.h 2015-05-08 16:27:02.000000000 -0700 |
|
58 +++ new/src/lib/gssapi/generic/gssapi_generic.h 2015-06-11 12:35:47.817578844 -0700 |
|
59 @@ -38,8 +38,10 @@ |
|
60 #define GSSAPIGENERIC_END_DECLS |
|
61 #endif |
|
62 |
|
63 +#ifndef GSS_EMPTY_BUFFER |
|
64 #define GSS_EMPTY_BUFFER(buf) ((buf) == NULL || \ |
|
65 (buf)->value == NULL || (buf)->length == 0) |
|
66 +#endif |
|
67 |
|
68 GSSAPIGENERIC_BEGIN_DECLS |
|
69 |
|
70 diff -pur old/src/lib/gssapi/mechglue/mglueP.h new/src/lib/gssapi/mechglue/mglueP.h |
|
71 --- old/src/lib/gssapi/mechglue/mglueP.h 2015-06-11 12:28:43.196963587 -0700 |
|
72 +++ new/src/lib/gssapi/mechglue/mglueP.h 2015-06-11 12:40:27.690166071 -0700 |
|
73 @@ -14,11 +14,13 @@ |
|
74 #include "mechglue.h" |
|
75 #include "gssapiP_generic.h" |
|
76 |
|
77 +#ifndef g_OID_copy |
|
78 #define g_OID_copy(o1, o2) \ |
|
79 do { \ |
|
80 memcpy((o1)->elements, (o2)->elements, (o2)->length); \ |
|
81 (o1)->length = (o2)->length; \ |
|
82 } while (0) |
|
83 +#endif |
|
84 |
|
85 /* |
|
86 * Array of context IDs typed by mechanism OID |