提交 d812ddbb 编写于 作者: S Steve Grubb 提交者:

[AUDIT] Fix signedness of 'serial' in various routines.

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
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 2fd6f58b
...@@ -186,7 +186,7 @@ extern void audit_inode(const char *name, const struct inode *inode); ...@@ -186,7 +186,7 @@ extern void audit_inode(const char *name, const struct inode *inode);
extern int audit_receive_filter(int type, int pid, int uid, int seq, extern int audit_receive_filter(int type, int pid, int uid, int seq,
void *data); void *data);
extern void audit_get_stamp(struct audit_context *ctx, 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 int audit_set_loginuid(struct audit_context *ctx, uid_t loginuid);
extern uid_t audit_get_loginuid(struct audit_context *ctx); extern uid_t audit_get_loginuid(struct audit_context *ctx);
extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
......
...@@ -620,7 +620,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx) ...@@ -620,7 +620,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx)
struct audit_buffer *ab = NULL; struct audit_buffer *ab = NULL;
unsigned long flags; unsigned long flags;
struct timespec t; struct timespec t;
int serial = 0; unsigned int serial;
if (!audit_initialized) if (!audit_initialized)
return NULL; return NULL;
...@@ -669,8 +669,10 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx) ...@@ -669,8 +669,10 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx)
audit_get_stamp(ab->ctx, &t, &serial); audit_get_stamp(ab->ctx, &t, &serial);
else else
#endif #endif
{
t = CURRENT_TIME; t = CURRENT_TIME;
serial = 0;
}
audit_log_format(ab, "audit(%lu.%03lu:%u): ", audit_log_format(ab, "audit(%lu.%03lu:%u): ",
t.tv_sec, t.tv_nsec/1000000, serial); t.tv_sec, t.tv_nsec/1000000, serial);
return ab; return ab;
......
...@@ -992,7 +992,7 @@ void audit_inode(const char *name, const struct inode *inode) ...@@ -992,7 +992,7 @@ void audit_inode(const char *name, const struct inode *inode)
} }
void audit_get_stamp(struct audit_context *ctx, void audit_get_stamp(struct audit_context *ctx,
struct timespec *t, int *serial) struct timespec *t, unsigned int *serial)
{ {
if (ctx) { if (ctx) {
t->tv_sec = ctx->ctime.tv_sec; t->tv_sec = ctx->ctime.tv_sec;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册