[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

get_stamp serial is unsigned



Hi,

Attached is a patch that corrects a signed/unsigned warning. I also noticed 
that we needlessly init serial to 0. That only needs to occur if the kernel 
was compiled without the audit system.

-Steve Grubb
diff -ur linux-2.6.11-rc3.orig/include/linux/audit.h linux-2.6.11-rc3/include/linux/audit.h
--- linux-2.6.11-rc3.orig/include/linux/audit.h	2005-03-24 10:53:12.000000000 -0500
+++ linux-2.6.11-rc3/include/linux/audit.h	2005-03-24 10:55:03.000000000 -0500
@@ -147,7 +147,7 @@
 extern int  audit_receive_filter(int type, int pid, int uid, int seq,
 				 void *data);
 extern void audit_get_stamp(struct audit_context *ctx,
-			    struct timespec *t, int *serial);
+			    struct timespec *t, unsigned int *serial);
 extern int  audit_set_loginuid(struct audit_context *ctx, uid_t loginuid);
 extern uid_t audit_get_loginuid(struct audit_context *ctx);
 #else
diff -ur linux-2.6.11-rc3.orig/kernel/audit.c linux-2.6.11-rc3/kernel/audit.c
--- linux-2.6.11-rc3.orig/kernel/audit.c	2005-03-24 10:53:14.000000000 -0500
+++ linux-2.6.11-rc3/kernel/audit.c	2005-03-24 10:58:45.000000000 -0500
@@ -617,7 +617,7 @@
 	struct audit_buffer	*ab	= NULL;
 	unsigned long		flags;
 	struct timespec		t;
-	int			serial	= 0;
+	unsigned int		serial;
 
 	if (!audit_initialized)
 		return NULL;
@@ -666,8 +666,10 @@
 		audit_get_stamp(ab->ctx, &t, &serial);
 	else
 #endif
+	{
 		t = CURRENT_TIME;
-
+		serial = 0;
+	}
 	audit_log_format(ab, "audit(%lu.%03lu:%u): ",
 			 t.tv_sec, t.tv_nsec/1000000, serial);
 	return ab;
diff -ur linux-2.6.11-rc3.orig/kernel/auditsc.c linux-2.6.11-rc3/kernel/auditsc.c
--- linux-2.6.11-rc3.orig/kernel/auditsc.c	2005-03-24 10:53:14.000000000 -0500
+++ linux-2.6.11-rc3/kernel/auditsc.c	2005-03-24 10:53:51.000000000 -0500
@@ -890,7 +890,7 @@
 }
 
 void audit_get_stamp(struct audit_context *ctx,
-		     struct timespec *t, int *serial)
+		     struct timespec *t, unsigned int *serial)
 {
 	if (ctx) {
 		t->tv_sec  = ctx->ctime.tv_sec;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]