On 12/31/2025 12:33 PM, [email protected] wrote:
Hi Jeffrey,

I guess the problem is with Illumos / OmniOS having  quite old Kerberos includes.

I don't think so.   The Kerberos definitions you quoted later in the message are the current ones.

Here comes the failure log from the build. If you need, I can send you the log also completely.

/*/afs/unixnews.ch/@sys/solarisstudio12.3/bin/suncc  -I/usr/include/kerberosv5 -DALLOW_REGISTER -Wl,-rpath=/opt/openafs/lib  -m64  -O -dy -Bdynamic -m64  -I/afs/unixnews.ch/user/core/devel/afs/openafs-1.8.14/src/config -I/afs/unixnews.ch/user/core/devel/afs/openafs-1.8.14/include -I. -I.     -mt -DAFS_PTHREAD_ENV  -o aklog.o -c aklog.c*/ /*"aklog.c", line 718: non-unique member requires struct/union pointer: length*/ /*"aklog.c", line 718: left operand of "->" must be pointer to struct/union*/

The statement beginning at line 718 is

    len = min(get_princ_len(context, v5cred->client, 0),
          second_comp(context, v5cred->client) ?
          MAXKTCNAMELEN - 2 : MAXKTCNAMELEN - 1);

and the first error is referring to the expansion of get_princ_len() which is

    #define get_princ_len(c, p, n) krb5_princ_component(c, p, n)->length

The krb5_princ_component is defined as :

/#define krb5_princ_size(context, princ) (princ)->length/
/#define krb5_princ_type(context, princ) (princ)->type/
/#define krb5_princ_name(context, princ) (princ)->data/
/#define krb5_princ_component(context, princ,i)          \/
/            (((i) < krb5_princ_size(context, princ))    \/
/             ? (princ)->data + (i)                      \/
/             : NULL) /
And princ is defined as :
/typedef struct krb5_principal_data {/
/    krb5_magic magic;/
/    krb5_data realm;/
/    krb5_data *data;            /* An array of strings *//
/    krb5_int32 length;/
/    krb5_int32 type;/
/} krb5_principal_data;/

Therefore get_princ_len(context, v5cred->client, 0) expands to

/    ((((0) < krb5_princ_size(context, princ))    \/

/             ? (princ)->data + (0)                      \/

/             : NULL)->length)/

/
/

/which expands to/

/
/

/    ((((0) < //(princ)->length//)    \/

/             ? (princ)->data + (0)                      \/

/             : NULL)->length)/

/
/

I believe the underlying problem is that "princ)->data" has type (krb5_data *) and NULL has type (void *). NULL is not a struct/union pointer.

Please try this patch

diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c
index 3dba5f456..9cfec4ad6 100644
--- a/src/aklog/aklog.c
+++ b/src/aklog/aklog.c
@@ -151,8 +151,8 @@ static int get_user_realm(krb5_context, char **);
 #if defined(HAVE_KRB5_PRINC_SIZE) || defined(krb5_princ_size) -#define get_princ_str(c, p, n) krb5_princ_component(c, p, n)->data
-#define get_princ_len(c, p, n) krb5_princ_component(c, p, n)->length
+#define get_princ_str(c, p, n) ((krb5_data *)krb5_princ_component(c, p, 
n))->data
+#define get_princ_len(c, p, n) ((krb5_data *)krb5_princ_component(c, p, 
n))->length
 #define second_comp(c, p) (krb5_princ_size(c, p) > 1)
 #define realm_data(c, p) krb5_princ_realm(c, p)->data
 #define realm_len(c, p) krb5_princ_realm(c, p)->length


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to