From 1b6aacd954e96ec72d0d5a89a5b32c85358da1bea0aa6fee4f2a349dca3a5dd3 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 6 Sep 2007 19:46:10 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/aaa_base?expand=0&rev=42 --- aaa_base.changes | 11 +++++++++++ aaa_base.spec | 7 ++++++- aaa_base.tar.bz2 | 4 ++-- get_kernel_version.c | 42 +++++++++++++++++++++++++++++++++++++----- 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/aaa_base.changes b/aaa_base.changes index 3972a82..3ab6a5c 100644 --- a/aaa_base.changes +++ b/aaa_base.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Wed Sep 5 00:39:43 CEST 2007 - maw@suse.de + +- Add /usr/share/gnome to XDG_DATA_DIRS (#307213). + +------------------------------------------------------------------- +Tue Sep 4 13:35:33 CEST 2007 - bwalle@suse.de + +- get_kernel_version: make check more strict to usage on kernel + dumps (#307326) + ------------------------------------------------------------------- Fri Aug 31 14:29:22 CEST 2007 - rguenther@suse.de diff --git a/aaa_base.spec b/aaa_base.spec index de41e49..16043f3 100644 --- a/aaa_base.spec +++ b/aaa_base.spec @@ -19,7 +19,7 @@ Requires: aaa_skel filesystem distribution-release logrotate /bin/mktemp / PreReq: /usr/bin/sed /usr/bin/grep /bin/mv /bin/cat /bin/ls /bin/date /usr/bin/cmp /bin/fillup /sbin/insserv net-tools Autoreqprov: on Version: 10.3 -Release: 77 +Release: 79 Summary: SUSE Linux Base Package BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: aaa_base.tar.bz2 @@ -134,6 +134,11 @@ done > aaa_base.files %defattr(-,root,root) %changelog +* Wed Sep 05 2007 - maw@suse.de +- Add /usr/share/gnome to XDG_DATA_DIRS (#307213). +* Tue Sep 04 2007 - bwalle@suse.de +- get_kernel_version: make check more strict to usage on kernel + dumps (#307326) * Fri Aug 31 2007 - rguenther@suse.de - Drop procps BuildRequires again. * Wed Aug 29 2007 - werner@suse.de diff --git a/aaa_base.tar.bz2 b/aaa_base.tar.bz2 index f61c0fd..0c867e3 100644 --- a/aaa_base.tar.bz2 +++ b/aaa_base.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d6991c64d7749fc8c116240e7d2ab977295685d37b3edac9b410364752d84251 -size 78487 +oid sha256:c1be0773d9e851dae32597963ef179bb5734e985b0df59f1616c241b88512fce +size 78525 diff --git a/get_kernel_version.c b/get_kernel_version.c index 5cb4942..921c435 100644 --- a/get_kernel_version.c +++ b/get_kernel_version.c @@ -16,11 +16,18 @@ #include #include +#include #include #include #include #include +static inline int my_is_alnum_punct(char c) +{ + return isdigit(c) || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') + || c == '.' || c == ',' || c == '-' || c == '_'; +} + int main (int argc, char *argv[]) { @@ -92,10 +99,33 @@ main (int argc, char *argv[]) buffer[i+8] == 'r' && buffer[i+9] == 's' && buffer[i+10] == 'i' && buffer[i+11] == 'o' && buffer[i+12] == 'n' && buffer[i+13] == ' ') - { - found = 1; - break; - } + { + int j = i+14; + int invalid_char = 0; + int in_number_range = 1; + + /* check if we really found a version */ + for (j = j+1; buffer[j] != ' '; j++) + { + char c = buffer[j]; + + if (c == '-') + in_number_range = 0; + + if ((in_number_range && !isdigit(c) && c != '.') || + (!in_number_range && !my_is_alnum_punct(c))) + { + invalid_char = 1; + break; + } + } + + if (!invalid_char) + { + found = 1; + break; + } + } if (found) { @@ -106,7 +136,7 @@ main (int argc, char *argv[]) } else { - if (in < (sizeof (buffer) - MAX_VERSION_LENGTH)) + if (in < (ssize_t)(sizeof (buffer) - MAX_VERSION_LENGTH)) break; memcpy (&buffer[0], &buffer[sizeof (buffer) - MAX_VERSION_LENGTH], MAX_VERSION_LENGTH); @@ -154,3 +184,5 @@ main (int argc, char *argv[]) return 0; } + +/* vim: set sw=4 ts=8 sts=4 noet: */