Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Aug 2020 19:07:07 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364217 - stable/12/sys/compat/linux
Message-ID:  <202008131907.07DJ77RN006785@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Thu Aug 13 19:07:07 2020
New Revision: 364217
URL: https://svnweb.freebsd.org/changeset/base/364217

Log:
  MFC r351703:
  
  Relax compat.linux.osrelease checks.  This way one can do eg
  'compat.linux.osrelease=3.10.0-957.12.1.el7.x86_64', which
  corresponds to CentOS 7.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/sys/compat/linux/linux_mib.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_mib.c
==============================================================================
--- stable/12/sys/compat/linux/linux_mib.c	Thu Aug 13 19:05:51 2020	(r364216)
+++ stable/12/sys/compat/linux/linux_mib.c	Thu Aug 13 19:07:07 2020	(r364217)
@@ -146,7 +146,8 @@ linux_map_osrel(char *osrelease, int *osrel)
 		return (EINVAL);
 	osrelease = sep + 1;
 	v2 = strtol(osrelease, &sep, 10);
-	if (osrelease == sep || sep != eosrelease)
+	if (osrelease == sep ||
+	    (sep != eosrelease && (sep + 1 >= eosrelease || *sep != '-')))
 		return (EINVAL);
 
 	v = LINUX_KERNVER(v0, v1, v2);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008131907.07DJ77RN006785>