Skip to content
Snippets Groups Projects
Commit f51ee9dc authored by Raymond Toy's avatar Raymond Toy
Browse files

Try to be careful about extracting the linux version from the (uname)

release.  Some Debian versions have a release name like "3.7-trunk",
which is missing the patch version.
parent 1e8b06be
No related branches found
No related tags found
No related merge requests found
......@@ -76,12 +76,26 @@ check_personality(struct utsname *name, char *const *argv, char *const *envp)
#if defined(__i386) || defined(__x86_64)
int major_version, minor_version, patch_version;
char *p;
p = name->release;
major_version = atoi(p);
p = strchr(p,'.')+1;
minor_version = atoi(p);
p = strchr(p,'.')+1;
patch_version = atoi(p);
/*
* Try to extract the minor and patch version, but if we can't
* just set it to zero. In particular, some Debian systems have a
* release like "3.7-trunk-686-pae" which is missing the patch
* version.
*/
p = strchr(p,'.');
if (p) {
minor_version = atoi(p + 1);
p = strchr(p + 1,'.');
patch_version = p ? atoi(p + 1) : 0;
} else {
minor_version = 0;
patch_version = 0;
}
if ((major_version == 2
/* Some old kernels will apparently lose unsupported personality flags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment