From 5418817c52366e2f4e59c3c371e2c1e05b1a56ef Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Tue, 21 Mar 2006 16:46:55 +0000 Subject: [PATCH] * minor new ports: i386-pc-linux-fc5. * amd/info_ldap.c: as of Linux Fedora Core 5 (which comes with openldap-2.3.9), the ldap.h headers deprecate several functions used in this file, such as ldap_unbind. You get compile errors about missing extern definitions. Those externs are still in , but surrounded by an ifdef LDAP_DEPRECATED. I am turning on that ifdef at the top of info_ldap.c, under the assumption that the functions may be deprecated, but they still work for this (older?) version of the LDAP API. It gets am-utils to compile, but it is not clear if it will work perfectly. * libamu/xdr_func.c (xdr_am_mountres3_ok), amq/amq_xdr.c (xdr_amq_mount_tree, xdr_amq_mount_tree_p, xdr_amq_mount_info_list, xdr_amq_mount_tree_list), amq/amq.c (show_mti), amd/amq_subr.c (xdr_amq_setopt, xdr_amq_mount_subtree, xdr_amq_mount_tree, xdr_amq_mount_tree_list, xdr_amq_mount_tree), libamu/xdr_func.c (xdr_am_mountres3_ok): use casing magic to stop GCC-4.1 from complaining about "dereferencing type-punned pointer will break strict-aliasing rules" here (but not elsewhere). --- .cvsignore | 1 + ChangeLog | 23 +++++++++++++++++++++++ NEWS | 1 + amd/amq_subr.c | 24 ++++++++++++++++++------ amd/info_ldap.c | 14 ++++++++++++++ amq/amq.c | 4 ++-- amq/amq_xdr.c | 19 ++++++++++++++----- libamu/xdr_func.c | 4 ++-- 8 files changed, 75 insertions(+), 15 deletions(-) diff --git a/.cvsignore b/.cvsignore index 5c7826cb..8940a954 100644 --- a/.cvsignore +++ b/.cvsignore @@ -163,3 +163,4 @@ A.i386-unknown-netbsdelf3.0 A.i386-unknown-netbsdelf2.1 A.i386-unknown-openbsd3.8 A.powerpc-ibm-aix5.2.0.0-cc +A.i386-pc-linux-fc5 diff --git a/ChangeLog b/ChangeLog index 975f5ce6..9f521f60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2006-03-21 Erez Zadok + + * minor new ports: i386-pc-linux-fc5. + + * amd/info_ldap.c: as of Linux Fedora Core 5 (which comes with + openldap-2.3.9), the ldap.h headers deprecate several functions + used in this file, such as ldap_unbind. You get compile errors + about missing extern definitions. Those externs are still in + , but surrounded by an ifdef LDAP_DEPRECATED. I am + turning on that ifdef at the top of info_ldap.c, under the + assumption that the functions may be deprecated, but they still + work for this (older?) version of the LDAP API. It gets am-utils + to compile, but it is not clear if it will work perfectly. + + * libamu/xdr_func.c (xdr_am_mountres3_ok), amq/amq_xdr.c + (xdr_amq_mount_tree, xdr_amq_mount_tree_p, + xdr_amq_mount_info_list, xdr_amq_mount_tree_list), amq/amq.c + (show_mti), amd/amq_subr.c (xdr_amq_setopt, xdr_amq_mount_subtree, + xdr_amq_mount_tree, xdr_amq_mount_tree_list, xdr_amq_mount_tree), + libamu/xdr_func.c (xdr_am_mountres3_ok): use casing magic to stop + GCC-4.1 from complaining about "dereferencing type-punned pointer + will break strict-aliasing rules" here (but not elsewhere). + 2006-03-20 Christos Zoulas * libamu/wire.c: avoid potential dereferencing of a NULL pointer diff --git a/NEWS b/NEWS index 963b42b7..021cae60 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Support new mount options for type:=pcfs mounts: longname, nowin95, shortname, user=N, group=N, mask=N, and dirmask=N. - minor new ports: + i386-pc-linux-fc5 (Fedora Core 5) i386-unknown-freebsd6.0 (RELEASE) i386-unknown-netbsdelf2.1 i386-unknown-netbsdelf3.0 (RELEASE) diff --git a/amd/amq_subr.c b/amd/amq_subr.c index 2244ce8d..79ecafc3 100644 --- a/amd/amq_subr.c +++ b/amd/amq_subr.c @@ -258,7 +258,7 @@ amqproc_pawd_1_svc(voidp argp, struct svc_req *rqstp) bool_t xdr_amq_setopt(XDR *xdrs, amq_setopt *objp) { - if (!xdr_enum(xdrs, (enum_t *) & objp->as_opt)) { + if (!xdr_enum(xdrs, (enum_t *) ((voidp) &objp->as_opt))) { return (FALSE); } if (!xdr_string(xdrs, &objp->as_str, AMQ_STRLEN)) { @@ -323,10 +323,16 @@ xdr_amq_mount_subtree(XDR *xdrs, amq_mount_tree *objp) if (!xdr_amq_mount_tree_node(xdrs, objp)) { return (FALSE); } - if (!xdr_pointer(xdrs, (char **) &mp->am_osib, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { + if (!xdr_pointer(xdrs, + (char **) ((voidp) &mp->am_osib), + sizeof(amq_mount_tree), + (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { return (FALSE); } - if (!xdr_pointer(xdrs, (char **) &mp->am_child, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { + if (!xdr_pointer(xdrs, + (char **) ((voidp) &mp->am_child), + sizeof(amq_mount_tree), + (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { return (FALSE); } return (TRUE); @@ -342,10 +348,16 @@ xdr_amq_mount_tree(XDR *xdrs, amq_mount_tree *objp) if (!xdr_amq_mount_tree_node(xdrs, objp)) { return (FALSE); } - if (!xdr_pointer(xdrs, (char **) ((void *)&mnil), sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { + if (!xdr_pointer(xdrs, + (char **) ((voidp) &mnil), + sizeof(amq_mount_tree), + (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { return (FALSE); } - if (!xdr_pointer(xdrs, (char **) &mp->am_child, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { + if (!xdr_pointer(xdrs, + (char **) ((voidp) &mp->am_child), + sizeof(amq_mount_tree), + (XDRPROC_T_TYPE) xdr_amq_mount_subtree)) { return (FALSE); } return (TRUE); @@ -389,7 +401,7 @@ bool_t xdr_amq_mount_tree_list(XDR *xdrs, amq_mount_tree_list *objp) { if (!xdr_array(xdrs, - (char **) &objp->amq_mount_tree_list_val, + (char **) ((voidp) &objp->amq_mount_tree_list_val), (u_int *) &objp->amq_mount_tree_list_len, ~0, sizeof(amq_mount_tree_p), diff --git a/amd/info_ldap.c b/amd/info_ldap.c index 6abe1790..f36908c2 100644 --- a/amd/info_ldap.c +++ b/amd/info_ldap.c @@ -47,6 +47,20 @@ * LDAP Home Page: http://www.umich.edu/~rsug/ldap/ */ +/* + * WARNING: as of Linux Fedora Core 5 (which comes with openldap-2.3.9), the + * ldap.h headers deprecate several functions used in this file, such as + * ldap_unbind. You get compile errors about missing extern definitions. + * Those externs are still in , but surrounded by an ifdef + * LDAP_DEPRECATED. I am turning on that ifdef here, under the assumption + * that the functions may be deprecated, but they still work for this + * (older?) version of the LDAP API. It gets am-utils to compile, but it is + * not clear if it will work perfectly. + */ +#ifndef LDAP_DEPRECATED +# define LDAP_DEPRECATED 1 +#endif /* not LDAP_DEPRECATED */ + #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ diff --git a/amq/amq.c b/amq/amq.c index 57cecfb0..6f65cdcb 100644 --- a/amq/amq.c +++ b/amq/amq.c @@ -101,7 +101,7 @@ show_mti(amq_mount_tree *mt, enum show_opt e, int *mwid, int *dwid, int *twid) case Full: { - struct tm *tp = localtime((time_t *) &mt->mt_mounttime); + struct tm *tp = localtime((time_t *) ((voidp) &mt->mt_mounttime)); printf("%-*.*s %-*.*s %-*.*s %s\n\t%-5d %-7d %-6d %-7d %-7d %-6d %02d/%02d/%04d %02d:%02d:%02d\n", *dwid, *dwid, *mt->mt_directory ? mt->mt_directory : "/", /* XXX */ @@ -126,7 +126,7 @@ show_mti(amq_mount_tree *mt, enum show_opt e, int *mwid, int *dwid, int *twid) case Stats: { - struct tm *tp = localtime((time_t *) &mt->mt_mounttime); + struct tm *tp = localtime((time_t *) ((voidp) &mt->mt_mounttime)); printf("%-*.*s %-5d %-7d %-6d %-7d %-7d %-6d %02d/%02d/%02d %02d:%02d:%04d\n", *dwid, *dwid, *mt->mt_directory ? mt->mt_directory : "/", /* XXX */ diff --git a/amq/amq_xdr.c b/amq/amq_xdr.c index 359d31f0..692a0a40 100644 --- a/amq/amq_xdr.c +++ b/amq/amq_xdr.c @@ -106,11 +106,17 @@ xdr_amq_mount_tree(XDR *xdrs, amq_mount_tree *objp) return (FALSE); } - if (!xdr_pointer(xdrs, (char **) &objp->mt_next, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_tree)) { + if (!xdr_pointer(xdrs, + (char **) ((voidp) &objp->mt_next), + sizeof(amq_mount_tree), + (XDRPROC_T_TYPE) xdr_amq_mount_tree)) { return (FALSE); } - if (!xdr_pointer(xdrs, (char **) &objp->mt_child, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_tree)) { + if (!xdr_pointer(xdrs, + (char **) ((voidp) &objp->mt_child), + sizeof(amq_mount_tree), + (XDRPROC_T_TYPE) xdr_amq_mount_tree)) { return (FALSE); } @@ -121,7 +127,10 @@ xdr_amq_mount_tree(XDR *xdrs, amq_mount_tree *objp) bool_t xdr_amq_mount_tree_p(XDR *xdrs, amq_mount_tree_p *objp) { - if (!xdr_pointer(xdrs, (char **) objp, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_tree)) { + if (!xdr_pointer(xdrs, + (char **) objp, + sizeof(amq_mount_tree), + (XDRPROC_T_TYPE) xdr_amq_mount_tree)) { return (FALSE); } return (TRUE); @@ -168,7 +177,7 @@ bool_t xdr_amq_mount_info_list(XDR *xdrs, amq_mount_info_list *objp) { if (!xdr_array(xdrs, - (char **) &objp->amq_mount_info_list_val, + (char **) ((voidp) &objp->amq_mount_info_list_val), (u_int *) &objp->amq_mount_info_list_len, ~0, sizeof(amq_mount_info), @@ -183,7 +192,7 @@ bool_t xdr_amq_mount_tree_list(XDR *xdrs, amq_mount_tree_list *objp) { if (!xdr_array(xdrs, - (char **) &objp->amq_mount_tree_list_val, + (char **) ((voidp) &objp->amq_mount_tree_list_val), (u_int *) &objp->amq_mount_tree_list_len, ~0, sizeof(amq_mount_tree_p), diff --git a/libamu/xdr_func.c b/libamu/xdr_func.c index 34d4c328..d29c4c7f 100644 --- a/libamu/xdr_func.c +++ b/libamu/xdr_func.c @@ -942,11 +942,11 @@ xdr_am_mountres3_ok(XDR *xdrs, am_mountres3_ok *objp) if (!xdr_am_fhandle3(xdrs, &objp->fhandle)) return (FALSE); if (!xdr_array(xdrs, - (char **)&objp->auth_flavors.auth_flavors_val, + (char **) ((voidp) &objp->auth_flavors.auth_flavors_val), (u_int *) &objp->auth_flavors.auth_flavors_len, ~0, sizeof(int), - (xdrproc_t) xdr_int)) + (XDRPROC_T_TYPE) xdr_int)) return (FALSE); return (TRUE); } -- 2.43.0