public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make new_utsname fields use the proper length constant
@ 2009-04-17 17:18 Dan Smith
  2009-04-17 18:06 ` Serge E. Hallyn
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Smith @ 2009-04-17 17:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: containers, akpm, serue

The members of the new_utsname structure are defined with magic numbers
that *should* correspond to the constant __NEW_UTS_LEN+1.  Everywhere else,
code assumes this and uses the constant, so this patch makes the structure
match.

Originally suggested by Serge here:

https://lists.linux-foundation.org/pipermail/containers/2009-March/016258.html

Signed-off-by: Dan Smith <danms@us.ibm.com>
Cc: containers@lists.linux-foundation.org
Cc: akpm@linux-foundation.org
Cc: serue@us.ibm.com
---
 include/linux/utsname.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index 1123267..3656b30 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -22,12 +22,12 @@ struct old_utsname {
 };
 
 struct new_utsname {
-	char sysname[65];
-	char nodename[65];
-	char release[65];
-	char version[65];
-	char machine[65];
-	char domainname[65];
+	char sysname[__NEW_UTS_LEN + 1];
+	char nodename[__NEW_UTS_LEN + 1];
+	char release[__NEW_UTS_LEN + 1];
+	char version[__NEW_UTS_LEN + 1];
+	char machine[__NEW_UTS_LEN + 1];
+	char domainname[__NEW_UTS_LEN + 1];
 };
 
 #ifdef __KERNEL__
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Make new_utsname fields use the proper length constant
  2009-04-17 17:18 [PATCH] Make new_utsname fields use the proper length constant Dan Smith
@ 2009-04-17 18:06 ` Serge E. Hallyn
  0 siblings, 0 replies; 2+ messages in thread
From: Serge E. Hallyn @ 2009-04-17 18:06 UTC (permalink / raw)
  To: Dan Smith; +Cc: linux-kernel, containers, akpm

Quoting Dan Smith (danms@us.ibm.com):
> The members of the new_utsname structure are defined with magic numbers
> that *should* correspond to the constant __NEW_UTS_LEN+1.  Everywhere else,
> code assumes this and uses the constant, so this patch makes the structure
> match.
> 
> Originally suggested by Serge here:
> 
> https://lists.linux-foundation.org/pipermail/containers/2009-March/016258.html
> 
> Signed-off-by: Dan Smith <danms@us.ibm.com>
> Cc: containers@lists.linux-foundation.org
> Cc: akpm@linux-foundation.org
> Cc: serue@us.ibm.com

I realize it's weird putting __NEW_UTS_LEN+1 in the
length for struct old_utsname :), but you didn't make
up the names, so I would argue just do it for both
old_utsname and oldold_utsname too...

But of course even if you don't want to,

Acked-by: Serge Hallyn <serue@us.ibm.com>

thanks, Dan.

-serge

> ---
>  include/linux/utsname.h |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/utsname.h b/include/linux/utsname.h
> index 1123267..3656b30 100644
> --- a/include/linux/utsname.h
> +++ b/include/linux/utsname.h
> @@ -22,12 +22,12 @@ struct old_utsname {
>  };
> 
>  struct new_utsname {
> -	char sysname[65];
> -	char nodename[65];
> -	char release[65];
> -	char version[65];
> -	char machine[65];
> -	char domainname[65];
> +	char sysname[__NEW_UTS_LEN + 1];
> +	char nodename[__NEW_UTS_LEN + 1];
> +	char release[__NEW_UTS_LEN + 1];
> +	char version[__NEW_UTS_LEN + 1];
> +	char machine[__NEW_UTS_LEN + 1];
> +	char domainname[__NEW_UTS_LEN + 1];
>  };
> 
>  #ifdef __KERNEL__
> -- 
> 1.5.6.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-17 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17 17:18 [PATCH] Make new_utsname fields use the proper length constant Dan Smith
2009-04-17 18:06 ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox