Skip Menu |
 

Subject: redhat opteron patch: 1.2.7 needs casts, headers
Cc: Nalin Dahyabhai <nalin@redhat.com>
I expect we won't be fixing up 1.2.7 for opteron, but to get it on the
record....

From Nalin Dahyabhai:

[...]
I'm not sure if you are planning on updating 1.2 for Opteron boxes, but
the 1.2 base has problems due to the size mismatch when the value
returned by a function which returns a pointer is then passed to a
varargs function. If it's implicitly defined due to a missing header
inclusion, the compiler will compile code to expect an int instead of a
pointer, and we end up passing garbage data to functions like sprintf().
All of the instances I saw that definitely needed patching in 1.2 were
already fixed in 1.3 (where -Wall, which is used during the build,
includes -Wimplicit, which flags most these as warnings). I'm attaching
a patch for 1.2.7 to fix the ones I expect to cause errors. Save for
the tests which I expect to fail due to the removal of des3 from krb4,
the test suite here also looks good.

On both, config.guess and config.sub needed updating so that configure
wouldn't bail out because 'x86_64-*-linux' wasn't recognized, but I
expect that'll take care of itself eventually.
Functions which return time_t or a pointer return a 64-bit value on 64-bit
systems. If we allow them to be implicitly declared, then the values may be
truncated to 32 bits (which for pointers can be disastrous). This fixes only
some of the warnings you get from building with -Wimplicit, but these and
more area already fixed in the 1.3 tree.
--- krb5-1.2.7/src/appl/gssftp/ftp/cmds.c 2003-08-27 11:18:50.000000000 -0400
+++ krb5-1.2.7/src/appl/gssftp/ftp/cmds.c 2003-08-27 11:18:57.000000000 -0400
@@ -47,6 +47,7 @@

#include <signal.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <netdb.h>
--- krb5-1.2.7/src/appl/user_user/server.c 2003-08-27 11:17:38.000000000 -0400
+++ krb5-1.2.7/src/appl/user_user/server.c 2003-08-27 11:17:49.000000000 -0400
@@ -33,7 +33,9 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
+#include <string.h>
#include <fcntl.h>
+#include <unistd.h>

#include "krb5.h"
#include "com_err.h"
--- krb5-1.2.7/src/include/kerberosIV/krb.h 2003-08-27 10:17:29.000000000 -0400
+++ krb5-1.2.7/src/include/kerberosIV/krb.h 2003-08-27 11:22:42.000000000 -0400
@@ -132,6 +132,7 @@
/* Maximum alloable clock skew in seconds */
#define CLOCK_SKEW 5*60
/* Filename for readservkey */
+char* krb__get_srvtabname();
#define KEYFILE ((char*)krb__get_srvtabname("/etc/srvtab"))

/* Structure definition for rd_ap_req */
@@ -399,6 +400,7 @@
#define _fstrncpy strncpy
#define far_fputs fputs
/* and likewise, just drag in the unix time interface */
+unsigned KRB4_32 unix_time_gmt_unixsec();
#define TIME_GMT_UNIXSEC unix_time_gmt_unixsec((unsigned KRB4_32 *)0)
#define TIME_GMT_UNIXSEC_US(us) unix_time_gmt_unixsec((us))
#define CONVERT_TIME_EPOCH ((long)0) /* Unix epoch is Krb epoch */
--- krb5-1.2.7/src/kadmin/server/kadm_rpc_svc.c 2003-08-27 11:12:52.000000000 -0400
+++ krb5-1.2.7/src/kadmin/server/kadm_rpc_svc.c 2003-08-27 11:13:30.000000000 -0400
@@ -9,6 +9,9 @@
static char *rcsid = "$Header: /cvs/krbdev/krb5/src/kadmin/server/kadm_rpc_svc.c,v 1.16 2000/02/19 02:05:52 tlyu Exp $";
#endif

+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include <stdio.h>
#include <gssrpc/rpc.h>
#include <syslog.h>
--- krb5-1.2.7/src/kadmin/server/server_stubs.c 2003-08-27 11:13:40.000000000 -0400
+++ krb5-1.2.7/src/kadmin/server/server_stubs.c 2003-08-27 11:15:11.000000000 -0400
@@ -8,6 +8,9 @@
static char *rcsid = "$Header: /cvs/krbdev/krb5/src/kadmin/server/server_stubs.c,v 1.40.2.1.2.2 2002/10/31 23:34:47 tlyu Exp $";
#endif

+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_krb5.h> /* for gss_nt_krb5_name */
#include <krb5.h>
--- krb5-1.2.7/src/kadmin/v4server/kadm_supp.c 2003-08-27 11:16:22.000000000 -0400
+++ krb5-1.2.7/src/kadmin/v4server/kadm_supp.c 2003-08-27 11:16:36.000000000 -0400
@@ -12,6 +12,8 @@

#include <mit-copyright.h>
#include <stdio.h>
+#include <string.h>
+#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
--- krb5-1.2.7/src/lib/krb4/cr_tkt.c 2003-08-27 10:12:49.000000000 -0400
+++ krb5-1.2.7/src/lib/krb4/cr_tkt.c 2003-08-27 10:13:05.000000000 -0400
@@ -15,6 +15,8 @@
#include <string.h>
#include <krb5.h>

+static int krb_cr_tkt_int();
+
/*
* Create ticket takes as arguments information that should be in a
* ticket, and the KTEXT object in which the ticket should be
--- krb5-1.2.7/src/lib/krb4/getst.c 2003-08-27 10:18:32.000000000 -0400
+++ krb5-1.2.7/src/lib/krb4/getst.c 2003-08-27 10:18:33.000000000 -0400
@@ -9,6 +9,7 @@

#include "mit-copyright.h"
#include "krb.h"
+#include <unistd.h>

/*
* getst() takes a file descriptor, a string and a count. It reads
--- krb5-1.2.7/src/lib/krb4/recvauth.c 2003-08-27 10:19:35.000000000 -0400
+++ krb5-1.2.7/src/lib/krb4/recvauth.c 2003-08-27 10:19:51.000000000 -0400
@@ -13,7 +13,9 @@
#include "krb.h"
#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>


#define KRB_SENDAUTH_VERS "AUTHV0.1" /* MUST be KRB_SENDAUTH_VLEN
--- krb5-1.2.7/src/lib/krb4/send_to_kdc.c 2003-08-27 10:18:52.000000000 -0400
+++ krb5-1.2.7/src/lib/krb4/send_to_kdc.c 2003-08-27 10:18:58.000000000 -0400
@@ -18,6 +18,7 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
+#include <unistd.h>

#define S_AD_SZ sizeof(struct sockaddr_in)

--- krb5-1.2.7/src/lib/krb5/krb/str_conv.c 2003-08-27 10:07:21.000000000 -0400
+++ krb5-1.2.7/src/lib/krb5/krb/str_conv.c 2003-08-27 10:11:24.000000000 -0400
@@ -46,6 +46,9 @@
* krb5_deltat_to_string() - Convert krb5_deltat to string.
*/

+#define _XOPEN_SOURCE
+#include <time.h>
+#include <strings.h>
#include "k5-int.h"

/* Salt type conversions */
--- krb5-1.2.7/src/lib/rpc/unit-test/rpc_test.h 2003-08-27 11:06:10.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/unit-test/rpc_test.h 2003-08-27 11:06:02.000000000 -0400
@@ -1,6 +1,7 @@
#ifndef _RPC_TEST_H_RPCGEN
#define _RPC_TEST_H_RPCGEN

+#include <string.h>
#include <gssrpc/rpc.h>

#define RPC_TEST_PROG ((unsigned long)(1000001))
--- krb5-1.2.7/src/lib/rpc/auth_unix.c 2003-08-27 10:25:31.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/auth_unix.c 2003-08-27 10:26:08.000000000 -0400
@@ -44,6 +44,7 @@
*/

#include <stdio.h>
+#include <string.h>

#include <gssrpc/types.h>
#include <gssrpc/xdr.h>
--- krb5-1.2.7/src/lib/rpc/pmap_rmt.c 2003-08-27 10:28:38.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/pmap_rmt.c 2003-08-27 10:28:44.000000000 -0400
@@ -48,6 +48,7 @@
#include <sys/sockio.h>
#endif
#include <stdio.h>
+#include <string.h>
#include <errno.h>
#ifdef OSF1
#include <net/route.h>
--- krb5-1.2.7/src/lib/rpc/clnt_generic.c 2003-08-27 10:27:17.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/clnt_generic.c 2003-08-27 10:27:21.000000000 -0400
@@ -37,6 +37,7 @@
#include <sys/socket.h>
#include <sys/errno.h>
#include <netdb.h>
+#include <string.h>

/*
* Generic client creation: takes (hostname, program-number, protocol) and
--- krb5-1.2.7/src/lib/rpc/getrpcport.c 2003-08-27 10:27:57.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/getrpcport.c 2003-08-27 10:28:00.000000000 -0400
@@ -36,6 +36,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include <gssrpc/rpc.h>
#include <netdb.h>
#include <sys/socket.h>
--- krb5-1.2.7/src/lib/rpc/svc.c 2003-08-27 10:29:23.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/svc.c 2003-08-27 10:29:31.000000000 -0400
@@ -45,6 +45,7 @@
#include <gssrpc/rpc.h>
#include <gssrpc/pmap_clnt.h>
#include <stdio.h>
+#include <string.h>

extern int errno;

--- krb5-1.2.7/src/lib/rpc/rpc_callmsg.c 2003-08-27 10:29:04.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/rpc_callmsg.c 2003-08-27 10:29:10.000000000 -0400
@@ -39,7 +39,7 @@
*/

#include <sys/param.h>
-
+#include <string.h>
#include <gssrpc/rpc.h>

/*
--- krb5-1.2.7/src/lib/rpc/svc_tcp.c 2003-08-27 10:59:56.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/svc_tcp.c 2003-08-27 11:00:07.000000000 -0400
@@ -42,6 +42,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include <gssrpc/rpc.h>
#include <sys/socket.h>
#include <errno.h>
--- krb5-1.2.7/src/lib/rpc/svc_auth_unix.c 2003-08-27 10:58:33.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/svc_auth_unix.c 2003-08-27 10:58:39.000000000 -0400
@@ -43,6 +43,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include <gssrpc/rpc.h>

/*
--- krb5-1.2.7/src/lib/rpc/svc_simple.c 2003-08-27 10:59:38.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/svc_simple.c 2003-08-27 10:59:44.000000000 -0400
@@ -39,6 +39,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include <gssrpc/rpc.h>
#include <sys/socket.h>
#include <netdb.h>
--- krb5-1.2.7/src/lib/rpc/svc_auth_gssapi.c 2003-08-27 10:59:17.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/svc_auth_gssapi.c 2003-08-27 10:59:21.000000000 -0400
@@ -13,6 +13,7 @@

#include <stdio.h>
#include <string.h>
+#include <time.h>
#include <gssrpc/rpc.h>
#include <sys/stat.h>

--- krb5-1.2.7/src/lib/rpc/svc_udp.c 2003-08-27 11:00:27.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/svc_udp.c 2003-08-27 11:00:36.000000000 -0400
@@ -40,6 +40,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include <gssrpc/rpc.h>
#include <sys/socket.h>
#include <errno.h>
--- krb5-1.2.7/src/lib/rpc/xdr_array.c 2003-08-27 11:00:52.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/xdr_array.c 2003-08-27 11:01:00.000000000 -0400
@@ -41,7 +41,7 @@
*/

#include <stdio.h>
-
+#include <string.h>
#include <gssrpc/types.h>
#include <gssrpc/xdr.h>

--- krb5-1.2.7/src/lib/rpc/xdr_rec.c 2003-08-27 11:01:12.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/xdr_rec.c 2003-08-27 11:02:28.000000000 -0400
@@ -49,6 +49,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include <gssrpc/types.h>
#include <gssrpc/xdr.h>
#include <netinet/in.h>
--- krb5-1.2.7/src/lib/rpc/xdr_reference.c 2003-08-27 11:03:55.000000000 -0400
+++ krb5-1.2.7/src/lib/rpc/xdr_reference.c 2003-08-27 11:04:04.000000000 -0400
@@ -41,6 +41,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include <gssrpc/types.h>
#include <gssrpc/xdr.h>

--- krb5-1.2.7/src/util/db2/btree/bt_seq.c 2003-08-27 10:06:16.000000000 -0400
+++ krb5-1.2.7/src/util/db2/btree/bt_seq.c 2003-08-27 10:06:10.000000000 -0400
@@ -68,6 +68,7 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>

#include "db-int.h"
#include "btree.h"
--- krb5-1.2.7/src/util/dyn/dyn_put.c 1996-07-22 17:10:32.000000000 -0400
+++ krb5-1.2.7/src/util/dyn/dyn_put.c 2003-08-27 12:09:40.000000000 -0400
@@ -11,6 +11,7 @@
*/

#include <stdio.h>
+#include <string.h>

#include "dynP.h"

--- krb5-1.2.7/src/util/dyn/dyn_insert.c 1996-07-22 16:49:33.000000000 -0400
+++ krb5-1.2.7/src/util/dyn/dyn_insert.c 2003-08-27 12:09:54.000000000 -0400
@@ -11,6 +11,7 @@
*/

#include <stdio.h>
+#include <string.h>
#include "dynP.h"

int DynInsert(obj, idx, els_in, num)
--- krb5-1.2.7/src/util/profile/argv_parse.c 2003-08-26 16:41:54.000000000 -0400
+++ krb5-1.2.7/src/util/profile/argv_parse.c 2003-08-26 16:42:06.000000000 -0400
@@ -29,6 +29,7 @@
*/

#include <stdlib.h>
+#include <string.h>
#include <ctype.h>
#include "argv_parse.h"

--- krb5-1.2.7/src/util/profile/test_profile.c 2003-08-26 16:44:14.000000000 -0400
+++ krb5-1.2.7/src/util/profile/test_profile.c 2003-08-26 16:45:18.000000000 -0400
@@ -6,6 +6,7 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <string.h>

#include "prof_int.h"
#include "argv_parse.h"
--- krb5-1.2.7/src/util/pty/getpty.c 2003-08-26 16:46:33.000000000 -0400
+++ krb5-1.2.7/src/util/pty/getpty.c 2003-08-26 16:46:39.000000000 -0400
@@ -40,6 +40,7 @@
#endif /*HAVE__GETPTY*/

#ifdef HAVE_OPENPTY
+#include <pty.h>
int slavefd;

if(openpty(fd, &slavefd, slave, (struct termios *) 0,
Suspending since we're not updating 1.2 branch except for serious
security issues, and Nalin said the important cases were already fixed
in 1.3.