2006-11-23 10:10:43

by David Binderman

[permalink] [raw]
Subject: kernel/sys.c(993): remark #593: variable "new_ruid" was set but never used


Hello there,

I just tried to compile Linux kernel 2.6.18.3 with the Intel C
C compiler.

The compiler said

kernel/sys.c(993): remark #593: variable "new_ruid" was set but never used

The source code is

int old_ruid, old_suid, new_ruid, new_suid;

I have checked the source code and I agree with the compiler.
Suggest delete local variable.

Regards

David Binderman

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters!
http://www.msn.co.uk/newsletters


2006-11-23 10:36:22

by David Rientjes

[permalink] [raw]
Subject: [PATCH] sys: remove unused variable

Remove unused 'new_ruid' variable.

Reported by David Binderman <[email protected]>.

Signed-off-by: David Rientjes <[email protected]>
---
kernel/sys.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index 98489d8..80f9f20 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1102,14 +1102,14 @@ asmlinkage long sys_setreuid(uid_t ruid,
asmlinkage long sys_setuid(uid_t uid)
{
int old_euid = current->euid;
- int old_ruid, old_suid, new_ruid, new_suid;
+ int old_ruid, old_suid, new_suid;
int retval;

retval = security_task_setuid(uid, (uid_t)-1, (uid_t)-1, LSM_SETID_ID);
if (retval)
return retval;

- old_ruid = new_ruid = current->uid;
+ old_ruid = current->uid;
old_suid = current->suid;
new_suid = old_suid;