- Upgrade to 3.6.0rc
Bugfix release - add 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=90
This commit is contained in:
parent
fac2b5148b
commit
0b2dd06478
@ -1,8 +1,8 @@
|
||||
From 882bf55c88e3fb6c38e2952fad272607a0900198 Mon Sep 17 00:00:00 2001
|
||||
From 2790065efcf484d5b51e2f5ab410983d9f37c74c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
|
||||
Date: Wed, 9 Apr 2014 17:00:23 +0200
|
||||
Subject: [PATCH 7/7] Simplify and fix parsing of /etc/SuSE-release (fixes
|
||||
issue #5423)
|
||||
Date: Fri, 11 Apr 2014 09:25:05 +0200
|
||||
Subject: [PATCH] Simplify and fix parsing of /etc/SuSE-release (fixes issue
|
||||
#5423)
|
||||
|
||||
This patch is a simplification of sysinfo.c:Linux_Suse_Version()
|
||||
to achieve the following
|
||||
@ -13,63 +13,37 @@ to achieve the following
|
||||
first line of /etc/SuSE-release
|
||||
- verified for sles version 9,10,11,12; sled versions 10,11,12, openSUSE 13.1
|
||||
---
|
||||
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libenv/sysinfo.c ./libenv/sysinfo.c
|
||||
--- ../orig-core-3.6.0b2/libenv/sysinfo.c 2014-03-17 17:37:49.000000000 +0100
|
||||
+++ ./libenv/sysinfo.c 2014-04-10 16:26:49.389330253 +0200
|
||||
@@ -1639,221 +1639,143 @@
|
||||
#define SUSE_SLED_ID "suse linux enterprise desktop"
|
||||
libenv/sysinfo.c | 187 ++++++++++++++++++-------------------------------------
|
||||
1 file changed, 60 insertions(+), 127 deletions(-)
|
||||
|
||||
diff --git a/libenv/sysinfo.c b/libenv/sysinfo.c
|
||||
index 72eb71f75d8d..6f2a05fc4cdd 100644
|
||||
--- a/libenv/sysinfo.c
|
||||
+++ b/libenv/sysinfo.c
|
||||
@@ -1629,6 +1629,7 @@ static int Linux_Suse_Version(EvalContext *ctx)
|
||||
#define SUSE_RELEASE_FLAG "linux "
|
||||
|
||||
-/* The full string read in from SuSE-release */
|
||||
- char relstring[CF_MAXVARSIZE];
|
||||
char classbuf[CF_MAXVARSIZE];
|
||||
- char vbuf[CF_BUFSIZE], strversion[CF_MAXVARSIZE], strpatch[CF_MAXVARSIZE];
|
||||
-
|
||||
-/* Where the numerical release will be found */
|
||||
- char *release = NULL;
|
||||
- int i, version;
|
||||
- int major = -1;
|
||||
- char strmajor[CF_MAXVARSIZE];
|
||||
- int minor = -1;
|
||||
- char strminor[CF_MAXVARSIZE];
|
||||
- FILE *fp;
|
||||
+ char *vendor = "suse";
|
||||
|
||||
Log(LOG_LEVEL_VERBOSE, "This appears to be a SUSE system.");
|
||||
EvalContextClassPutHard(ctx, "SUSE", "inventory,attribute_name=none,source=agent");
|
||||
+ EvalContextClassPutHard(ctx, "suse", "inventory,attribute_name=none,source=agent");
|
||||
|
||||
/* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE".
|
||||
* Keep this for backwards compatibility until CFEngine 3.7
|
||||
*/
|
||||
EvalContextClassPutHard(ctx, "SuSE", "inventory,attribute_name=none,source=agent");
|
||||
|
||||
-/* Grab the first line from the file and then close it. */
|
||||
+ /* Grab the first line from the SuSE-release file and then close it. */
|
||||
+ char relstring[CF_MAXVARSIZE];
|
||||
|
||||
- fp = ReadFirstLine(SUSE_REL_FILENAME, relstring, sizeof(relstring));
|
||||
+ FILE *fp = ReadFirstLine(SUSE_REL_FILENAME, relstring, sizeof(relstring));
|
||||
if (fp == NULL)
|
||||
{
|
||||
@@ -1648,23 +1649,26 @@ static int Linux_Suse_Version(EvalContext *ctx)
|
||||
return 1;
|
||||
}
|
||||
|
||||
- char vbuf[CF_BUFSIZE], strversion[CF_MAXVARSIZE], strpatch[CF_MAXVARSIZE];
|
||||
- strversion[0] = '\0';
|
||||
- strpatch[0] = '\0';
|
||||
+ char vbuf[CF_BUFSIZE];
|
||||
|
||||
- for(;;)
|
||||
+ int major = -1, minor = -1;
|
||||
+ while (fgets(vbuf, sizeof(vbuf), fp) != NULL)
|
||||
int major = -1, minor = -1;
|
||||
while (fgets(vbuf, sizeof(vbuf), fp) != NULL)
|
||||
{
|
||||
- if (fgets(vbuf, sizeof(vbuf), fp) == NULL)
|
||||
- {
|
||||
- if (ferror(fp))
|
||||
+ if (strncmp(vbuf, "VERSION", strlen("version")) == 0)
|
||||
if (strncmp(vbuf, "VERSION", strlen("version")) == 0)
|
||||
{
|
||||
- UnexpectedError("Failed to read line from stream");
|
||||
- break;
|
||||
- strlcpy(strversion, vbuf, sizeof(strversion));
|
||||
- sscanf(vbuf, "VERSION = %d", &major);
|
||||
+ int res;
|
||||
+ res = sscanf(vbuf, "VERSION = %d.%d", &major, &minor);
|
||||
+ Log(LOG_LEVEL_VERBOSE, "VERSION sscanf returned %d.", res);
|
||||
@ -78,195 +52,180 @@ diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache
|
||||
+ else if (res < 2)
|
||||
+ minor = -1;
|
||||
}
|
||||
- else /* feof */
|
||||
+
|
||||
+ if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0)
|
||||
|
||||
if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0)
|
||||
{
|
||||
- break;
|
||||
- strlcpy(strpatch, vbuf, sizeof(strpatch));
|
||||
- sscanf(vbuf, "PATCHLEVEL = %d", &minor);
|
||||
+ if (sscanf(vbuf, "PATCHLEVEL = %d", &minor) != 1)
|
||||
+ minor = -1;
|
||||
}
|
||||
}
|
||||
-
|
||||
- if (strncmp(vbuf, "VERSION", strlen("version")) == 0)
|
||||
+ if (ferror(fp))
|
||||
{
|
||||
- strncpy(strversion, vbuf, sizeof(strversion));
|
||||
- sscanf(strversion, "VERSION = %d", &major);
|
||||
+ UnexpectedError("Failed to read line from stream");
|
||||
}
|
||||
-
|
||||
- if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0)
|
||||
+ else
|
||||
{
|
||||
- strncpy(strpatch, vbuf, sizeof(strpatch));
|
||||
- sscanf(strpatch, "PATCHLEVEL = %d", &minor);
|
||||
- }
|
||||
+ assert(feof(fp));
|
||||
}
|
||||
if (ferror(fp))
|
||||
@@ -1678,28 +1682,38 @@ static int Linux_Suse_Version(EvalContext *ctx)
|
||||
|
||||
fclose(fp);
|
||||
|
||||
- /* Check if it's a SUSE Enterprise version */
|
||||
-
|
||||
+ /* Check which SUSE/openSUSE product it is */
|
||||
|
||||
- Log(LOG_LEVEL_VERBOSE, "Looking for SUSE enterprise info in '%s'", relstring);
|
||||
-
|
||||
+ Log(LOG_LEVEL_VERBOSE, "Looking for SUSE product info in '%s'", relstring);
|
||||
|
||||
- /* Convert relstring to lowercase to handle rename of SuSE to
|
||||
- * SUSE with SUSE 10.0.
|
||||
- */
|
||||
-
|
||||
- for (i = 0; i < strlen(relstring); i++)
|
||||
- {
|
||||
- relstring[i] = tolower(relstring[i]);
|
||||
- }
|
||||
+ /* Check which SUSE/openSUSE product it is */
|
||||
|
||||
- /* Check if it's a SUSE Enterprise version (all in lowercase) */
|
||||
+ Log(LOG_LEVEL_VERBOSE, "Looking for SUSE product info in '%s'", relstring);
|
||||
|
||||
- if (!strncmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID)))
|
||||
- for (int i = 0; i < strlen(relstring); i++)
|
||||
+ if (!strncasecmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID)))
|
||||
{
|
||||
classbuf[0] = '\0';
|
||||
strcat(classbuf, "SLES8");
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- relstring[i] = tolower(relstring[i]);
|
||||
+ EvalContextClassPutHard(ctx, "SLES8", "inventory,attribute_name=none,source=agent");
|
||||
}
|
||||
- else if (strncmp(relstring, "sles", 4) == 0)
|
||||
- {
|
||||
- Item *list, *ip;
|
||||
-
|
||||
- sscanf(relstring, "%[-_a-zA-Z0-9]", vbuf);
|
||||
- EvalContextClassPutHard(ctx, vbuf, "inventory,attribute_name=none,source=agent");
|
||||
- /* Check if it's a SUSE Enterprise version (all in lowercase) */
|
||||
-
|
||||
- list = SplitString(vbuf, '-');
|
||||
-
|
||||
- for (ip = list; ip != NULL; ip = ip->next)
|
||||
- {
|
||||
- EvalContextClassPutHard(ctx, ip->name, "inventory,attribute_name=none,source=agent");
|
||||
- }
|
||||
-
|
||||
- DeleteItemList(list);
|
||||
- }
|
||||
- else
|
||||
- if (!strncmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID)))
|
||||
+ else if (!strncasecmp(relstring, SUSE_SLES_ID, strlen(SUSE_SLES_ID)))
|
||||
{
|
||||
- for (version = 9; version < 13; version++)
|
||||
- classbuf[0] = '\0';
|
||||
- strcat(classbuf, "SLES8");
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
+ EvalContextClassPutHard(ctx, "sles", "inventory,attribute_name=none,source=agent");
|
||||
+ if (major != -1)
|
||||
+ {
|
||||
+ snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", major);
|
||||
+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
+ }
|
||||
+ }
|
||||
+ else if (!strncasecmp(relstring, SUSE_SLED_ID, strlen(SUSE_SLED_ID)))
|
||||
+ {
|
||||
+ EvalContextClassPutHard(ctx, "sled", "inventory,attribute_name=none,source=agent");
|
||||
+ if (major != -1)
|
||||
+ {
|
||||
+ snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", major);
|
||||
+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
+ }
|
||||
+ }
|
||||
+ else if (!strncasecmp(relstring, "opensuse", strlen("opensuse")))
|
||||
+ {
|
||||
+ vendor = "opensuse";
|
||||
+ EvalContextClassPutHard(ctx, vendor, "inventory,attribute_name=none,source=agent");
|
||||
}
|
||||
- else if (strncmp(relstring, "sles", 4) == 0)
|
||||
+ else if (strncasecmp(relstring, "sles", 4) == 0)
|
||||
{
|
||||
Item *list, *ip;
|
||||
|
||||
@@ -1717,120 +1731,39 @@ static int Linux_Suse_Version(EvalContext *ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
- for (int version = 9; version < 13; version++)
|
||||
- {
|
||||
- snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLES_ID, version);
|
||||
- Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf);
|
||||
-
|
||||
- if (!strncmp(relstring, vbuf, strlen(vbuf)))
|
||||
- {
|
||||
- snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", version);
|
||||
+ snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", major);
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
}
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- }
|
||||
- else
|
||||
+ }
|
||||
+ else if (!strncasecmp(relstring, SUSE_SLED_ID, strlen(SUSE_SLED_ID)))
|
||||
{
|
||||
- {
|
||||
- snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLED_ID, version);
|
||||
- Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf);
|
||||
-
|
||||
- if (!strncmp(relstring, vbuf, strlen(vbuf)))
|
||||
+ EvalContextClassPutHard(ctx, "sled", "inventory,attribute_name=none,source=agent");
|
||||
+ if (major != -1)
|
||||
{
|
||||
- {
|
||||
- snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", version);
|
||||
+ snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", major);
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
}
|
||||
}
|
||||
+ else if (!strncasecmp(relstring, "opensuse", strlen("opensuse")))
|
||||
+ {
|
||||
+ vendor = "opensuse";
|
||||
+ EvalContextClassPutHard(ctx, vendor, "inventory,attribute_name=none,source=agent");
|
||||
}
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- }
|
||||
-
|
||||
- }
|
||||
- }
|
||||
+ Log(LOG_LEVEL_WARNING, "Unknown product '%s' in /etc/SuSE-release", relstring);
|
||||
}
|
||||
|
||||
- /* Determine release version. We assume that the version follows
|
||||
- * the string "SuSE Linux" or "SUSE LINUX".
|
||||
- */
|
||||
+ else if (strncasecmp(relstring, "sles", 4) == 0)
|
||||
+ {
|
||||
+ Item *list, *ip;
|
||||
|
||||
- release = strstr(relstring, SUSE_RELEASE_FLAG);
|
||||
+ sscanf(relstring, "%[-_a-zA-Z0-9]", vbuf);
|
||||
+ EvalContextClassPutHard(ctx, vbuf, "inventory,attribute_name=none,source=agent");
|
||||
|
||||
-
|
||||
- char *release = strstr(relstring, SUSE_RELEASE_FLAG);
|
||||
- if (release == NULL)
|
||||
- {
|
||||
+ if (major != -1)
|
||||
{
|
||||
- release = strstr(relstring, "opensuse");
|
||||
- }
|
||||
+ list = SplitString(vbuf, '-');
|
||||
|
||||
- if (release == NULL)
|
||||
+ for (ip = list; ip != NULL; ip = ip->next)
|
||||
+ strncpy(classbuf, vendor, CF_MAXVARSIZE);
|
||||
+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
+ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", major);
|
||||
+ SetFlavour(ctx, classbuf);
|
||||
+ if (minor != -1)
|
||||
{
|
||||
- release = strversion;
|
||||
+ EvalContextClassPutHard(ctx, ip->name, "inventory,attribute_name=none,source=agent");
|
||||
+ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", minor);
|
||||
+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
}
|
||||
|
||||
- }
|
||||
-
|
||||
- if (release == NULL)
|
||||
- {
|
||||
- Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME);
|
||||
- Log(LOG_LEVEL_VERBOSE,
|
||||
- "Could not find a numeric OS release in %s",
|
||||
- SUSE_REL_FILENAME);
|
||||
- return 2;
|
||||
+ DeleteItemList(list);
|
||||
+ /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE".
|
||||
+ * Keep this for backwards compatibility until CFEngine 3.7
|
||||
+ */
|
||||
+ strncpy(classbuf, "SuSE", CF_MAXVARSIZE);
|
||||
+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
+ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", major);
|
||||
+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
+ if (minor != -1)
|
||||
+ {
|
||||
+ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", minor);
|
||||
+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
+ }
|
||||
+ Log(LOG_LEVEL_VERBOSE, "Discovered %s version %d.%d", vendor, major, minor);
|
||||
}
|
||||
else
|
||||
{
|
||||
- char strmajor[PRINTSIZE(major)], strminor[PRINTSIZE(minor)];
|
||||
- if (strchr(release, '.'))
|
||||
- {
|
||||
- sscanf(release, "%*s %d.%d", &major, &minor);
|
||||
- sprintf(strmajor, "%d", major);
|
||||
- sprintf(strminor, "%d", minor);
|
||||
+ Log(LOG_LEVEL_WARNING, "Unknown product '%s' in /etc/SuSE-release", relstring);
|
||||
+ }
|
||||
|
||||
- if (major != -1 && minor != -1)
|
||||
+ if (major != -1)
|
||||
{
|
||||
- strcpy(classbuf, "SUSE");
|
||||
+ strcpy(classbuf, vendor);
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- strcat(classbuf, "_");
|
||||
- strcat(classbuf, strmajor);
|
||||
+ sprintf(classbuf + strlen(classbuf), "_%d", major);
|
||||
SetFlavour(ctx, classbuf);
|
||||
- strcat(classbuf, "_");
|
||||
- strcat(classbuf, strminor);
|
||||
+ if (minor != -1)
|
||||
+ {
|
||||
+ sprintf(classbuf + strlen(classbuf), "_%d", minor);
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
-
|
||||
+ }
|
||||
/* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE".
|
||||
* Keep this for backwards compatibility until CFEngine 3.7
|
||||
*/
|
||||
strcpy(classbuf, "SuSE");
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- if (major != -1 && minor != -1)
|
||||
- {
|
||||
- strcpy(classbuf, "SUSE");
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- strcat(classbuf, "_");
|
||||
- strcat(classbuf, strmajor);
|
||||
+ sprintf(classbuf + strlen(classbuf), "_%d", major);
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- SetFlavour(ctx, classbuf);
|
||||
- strcat(classbuf, "_");
|
||||
- strcat(classbuf, strminor);
|
||||
+ if (minor != -1)
|
||||
+ {
|
||||
+ sprintf(classbuf + strlen(classbuf), "_%d", minor);
|
||||
EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
-
|
||||
- /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE".
|
||||
- * Keep this for backwards compatibility until CFEngine 3.7
|
||||
- */
|
||||
- strcpy(classbuf, "SuSE");
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- strcat(classbuf, "_");
|
||||
- strcat(classbuf, strmajor);
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
- strcat(classbuf, "_");
|
||||
- strcat(classbuf, strminor);
|
||||
- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent");
|
||||
-
|
||||
- Log(LOG_LEVEL_VERBOSE, "Discovered SUSE version %s", classbuf);
|
||||
- return 0;
|
||||
}
|
||||
+ Log(LOG_LEVEL_VERBOSE, "Discovered %s version %d.%d", vendor, major, minor);
|
||||
}
|
||||
else
|
||||
{
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- sscanf(strversion, "VERSION = %s", strmajor);
|
||||
- sscanf(strpatch, "PATCHLEVEL = %s", strminor);
|
||||
-
|
||||
@ -294,11 +253,14 @@ diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache
|
||||
- return 0;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME);
|
||||
}
|
||||
|
||||
- Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME);
|
||||
-
|
||||
Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME);
|
||||
-
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.4.5
|
||||
|
@ -1,84 +0,0 @@
|
||||
From cc963ee8af0408d902c7956414c4d1c54a902805 Mon Sep 17 00:00:00 2001
|
||||
From: Sigurd Teigen <sigurd.teigen@cfengine.com>
|
||||
Date: Tue, 8 Apr 2014 12:53:04 -0400
|
||||
Subject: [PATCH 2/7] Do not segfault on type checking NULL Rvals.
|
||||
|
||||
Add unit test. Close #5416
|
||||
---
|
||||
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libpromises/syntax.c ./libpromises/syntax.c
|
||||
--- ../orig-core-3.6.0b2/libpromises/syntax.c 2014-03-17 17:37:49.000000000 +0100
|
||||
+++ ./libpromises/syntax.c 2014-04-10 16:12:06.104406735 +0200
|
||||
@@ -253,10 +253,11 @@
|
||||
[SYNTAX_TYPE_MATCH_OK] = "OK",
|
||||
|
||||
[SYNTAX_TYPE_MATCH_ERROR_UNEXPANDED] = "Cannot check unexpanded value",
|
||||
- [SYNTAX_TYPE_MATCH_ERROR_RANGE_BRACKETED] = "Real range specification should not be enclosed in brackets - just \"a,b\"",
|
||||
- [SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS] = "Range format specifier should be of form \"a,b\" but got multiple items",
|
||||
+ [SYNTAX_TYPE_MATCH_ERROR_RANGE_BRACKETED] = "Real range specification should not be enclosed in brackets - just 'a,b'",
|
||||
+ [SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS] = "Range format specifier should be of form 'a,b'' but got multiple items",
|
||||
[SYNTAX_TYPE_MATCH_ERROR_GOT_SCALAR] = "Attempted to give a scalar to a non-scalar type",
|
||||
[SYNTAX_TYPE_MATCH_ERROR_GOT_LIST] = "Attempted to give a list to a non-list type",
|
||||
+ [SYNTAX_TYPE_MATCH_ERROR_GOT_NULL] = "Attempted to give a value of type null",
|
||||
|
||||
[SYNTAX_TYPE_MATCH_ERROR_STRING_UNIX_PERMISSION] = "Error parsing Unix permission string",
|
||||
|
||||
@@ -266,7 +267,7 @@
|
||||
[SYNTAX_TYPE_MATCH_ERROR_INT_PARSE] = "Cannot parse value as integer",
|
||||
[SYNTAX_TYPE_MATCH_ERROR_INT_OUT_OF_RANGE] = "Integer is out of range",
|
||||
|
||||
- [SYNTAX_TYPE_MATCH_ERROR_REAL_INF] = "Keyword \"inf\" has an integer value, cannot be used as real",
|
||||
+ [SYNTAX_TYPE_MATCH_ERROR_REAL_INF] = "Keyword 'inf' has an integer value, cannot be used as real",
|
||||
[SYNTAX_TYPE_MATCH_ERROR_REAL_OUT_OF_RANGE] = "Real value is out of range",
|
||||
|
||||
[SYNTAX_TYPE_MATCH_ERROR_OPTS_OUT_OF_RANGE] = "Selection is out of bounds",
|
||||
@@ -355,8 +356,10 @@
|
||||
return SYNTAX_TYPE_MATCH_OK;
|
||||
|
||||
case RVAL_TYPE_CONTAINER:
|
||||
- case RVAL_TYPE_NOPROMISEE:
|
||||
break;
|
||||
+
|
||||
+ case RVAL_TYPE_NOPROMISEE:
|
||||
+ return SYNTAX_TYPE_MATCH_ERROR_GOT_NULL;
|
||||
}
|
||||
|
||||
/* If we get here, we have a literal scalar type */
|
||||
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libpromises/syntax.h ./libpromises/syntax.h
|
||||
--- ../orig-core-3.6.0b2/libpromises/syntax.h 2014-03-17 17:37:49.000000000 +0100
|
||||
+++ ./libpromises/syntax.h 2014-04-10 16:12:06.104406735 +0200
|
||||
@@ -46,6 +46,7 @@
|
||||
SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS,
|
||||
SYNTAX_TYPE_MATCH_ERROR_GOT_SCALAR,
|
||||
SYNTAX_TYPE_MATCH_ERROR_GOT_LIST,
|
||||
+ SYNTAX_TYPE_MATCH_ERROR_GOT_NULL,
|
||||
|
||||
SYNTAX_TYPE_MATCH_ERROR_SCALAR_OUT_OF_RANGE,
|
||||
SYNTAX_TYPE_MATCH_ERROR_EMPTY_SCALAR_OUT_OF_RANGE,
|
||||
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/tests/unit/syntax_test.c ./tests/unit/syntax_test.c
|
||||
--- ../orig-core-3.6.0b2/tests/unit/syntax_test.c 2014-03-17 17:37:49.000000000 +0100
|
||||
+++ ./tests/unit/syntax_test.c 2014-04-10 16:13:24.055666621 +0200
|
||||
@@ -88,6 +88,13 @@
|
||||
assert_string_equal("delete_if_startwith_from_list", y->lval);
|
||||
}
|
||||
|
||||
+static void test_typecheck_null_rval(void)
|
||||
+{
|
||||
+ SyntaxTypeMatch err = CheckConstraintTypeMatch("whatever", (Rval) { NULL, RVAL_TYPE_NOPROMISEE },
|
||||
+ CF_DATA_TYPE_STRING, "abc", 0);
|
||||
+ assert_int_equal(SYNTAX_TYPE_MATCH_ERROR_GOT_NULL, err);
|
||||
+}
|
||||
+
|
||||
int main()
|
||||
{
|
||||
PRINT_TEST_BANNER();
|
||||
@@ -105,7 +112,9 @@
|
||||
unit_test(test_lookup_body_process_count),
|
||||
unit_test(test_lookup_body_delete_select),
|
||||
|
||||
- unit_test(test_lookup_constraint_edit_xml_set_attribute_attribute_value)
|
||||
+ unit_test(test_lookup_constraint_edit_xml_set_attribute_attribute_value),
|
||||
+
|
||||
+ unit_test(test_typecheck_null_rval)
|
||||
};
|
||||
|
||||
return run_tests(tests);
|
@ -1,10 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 11 07:32:08 UTC 2014 - kkaempf@suse.com
|
||||
|
||||
- Upgrade to 3.6.0rc
|
||||
Bugfix release
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 10 14:02:11 UTC 2014 - kkaempf@suse.com
|
||||
|
||||
- add 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch
|
||||
to prevent crash on syntax error
|
||||
|
||||
- add 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch
|
||||
- add 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch
|
||||
* add 'suse' class for consistency with other vendor classes
|
||||
(fixes #5417)
|
||||
* distinction between "SUSE Linux Enterprise Server" (sles) and
|
||||
|
@ -20,7 +20,6 @@ Name: cfengine
|
||||
%define srcname core
|
||||
%define libname libpromises
|
||||
%define libsoname %{libname}3
|
||||
%define masterdirname masterfiles-%{version}
|
||||
|
||||
# Yes, its not FHS conformant but in sync with cfengine documentation
|
||||
# reported upstream as https://cfengine.com/dev/issues/1896
|
||||
@ -33,14 +32,12 @@ Name: cfengine
|
||||
Summary: CFEngine automates large-scale IT computing infrastructure
|
||||
License: GPL-3.0
|
||||
Group: Productivity/Networking/System
|
||||
Version: 3.6.0b2
|
||||
Version: 3.6rc
|
||||
Release: 0
|
||||
Url: http://www.cfengine.org/
|
||||
Source: %{srcname}-%{version}.tar.gz
|
||||
Source1: %{name}.SuSEfirewall2
|
||||
|
||||
BuildRequires: %{name}-masterfiles = %{version}
|
||||
|
||||
# wtf? SLE_11 does not honor rpmlintrc
|
||||
%if 0%{?suse_version} <= 1130
|
||||
BuildRequires: -post-build-checks
|
||||
@ -66,8 +63,6 @@ Source105: http://www.cfengine.org/manuals/cf3-solutions.pdf
|
||||
Source106: http://www.cfengine.org/manuals/cf3-tutorial.pdf
|
||||
Source107: http://www.verticalsysadmin.com/cfengine/primer.pdf
|
||||
|
||||
# there's no /usr/include/acl.h in SUSE or Fedora, kkaempf@suse.de
|
||||
Patch1: libacl-headers.patch
|
||||
# SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de
|
||||
Patch2: remove-am_subst_notmake.patch
|
||||
|
||||
@ -75,11 +70,9 @@ Patch2: remove-am_subst_notmake.patch
|
||||
# kkaempf@suse.de
|
||||
Patch3: drop-revision.patch
|
||||
|
||||
# PATCH-FIX-UPSTREAM fix crash on syntax error
|
||||
Patch4: 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch
|
||||
# PATCH-FIX-UPSTREAM add 'suse' class for consistency with other vendor classes
|
||||
# PATCH-FEATURE-UPSTREAM better /etc/SuSE-release parsing, upstream #5423
|
||||
Patch5: 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch
|
||||
Patch5: 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: bison
|
||||
@ -185,9 +178,6 @@ Lots of examples promises for CFEngine.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{srcname}-%{version}
|
||||
%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version}
|
||||
%patch1
|
||||
%endif
|
||||
%if 0%{?suse_version} <= 1110
|
||||
%patch2 -p1
|
||||
%endif
|
||||
@ -195,7 +185,6 @@ Lots of examples promises for CFEngine.
|
||||
%patch2 -p1
|
||||
%endif
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
|
||||
##### rpmlint
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:79915acb1e43a24fe8bb5bbe98b875f3dc71dc0fbae88c47818ddec1c3bc99ec
|
||||
size 1376269
|
3
core-3.6rc.tar.gz
Normal file
3
core-3.6rc.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2128b34f6cf4a3d8a3a7b8f2f31c8f7d818a15dc4445e44623e4ef0c961cbbdc
|
||||
size 1412258
|
@ -1,12 +1,12 @@
|
||||
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/configure.ac ./configure.ac
|
||||
--- ../orig-core-3.6.0b2/configure.ac 2014-03-17 17:37:49.000000000 +0100
|
||||
+++ ./configure.ac 2014-03-26 17:06:24.343406133 +0100
|
||||
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6rc/configure.ac ./configure.ac
|
||||
--- ../orig-core-3.6rc/configure.ac 2014-04-10 14:27:57.000000000 +0200
|
||||
+++ ./configure.ac 2014-04-11 09:30:17.105777237 +0200
|
||||
@@ -25,7 +25,7 @@
|
||||
dnl
|
||||
|
||||
_AM_SET_OPTION([tar-ustar])
|
||||
-AM_INIT_AUTOMAKE(cfengine, 3.6.0b2.revision)
|
||||
+AM_INIT_AUTOMAKE(cfengine, 3.6.0b2)
|
||||
-AM_INIT_AUTOMAKE(cfengine, 3.6.0rc.revision)
|
||||
+AM_INIT_AUTOMAKE(cfengine, 3.6.0rc)
|
||||
AM_MAINTAINER_MODE([enable])
|
||||
|
||||
AC_DEFINE(BUILD_YEAR, esyscmd([date +%Y | tr -d '\n']), "Software build year")
|
||||
|
@ -1,13 +0,0 @@
|
||||
Index: configure.ac
|
||||
===================================================================
|
||||
--- configure.ac.orig
|
||||
+++ configure.ac
|
||||
@@ -396,7 +396,7 @@ AC_ARG_WITH([libacl],
|
||||
if test "x$with_libacl" != xno; then
|
||||
CF3_WITH_LIBRARY(libacl, [
|
||||
AC_CHECK_LIB(acl, acl_init, [], [if test "x$with_libacl" != xcheck; then AC_MSG_ERROR(Cannot find libacl library); fi])
|
||||
- AC_CHECK_HEADERS([acl.h sys/acl.h acl/libacl.h], [], [if test "x$with_libacl" != xcheck; then AC_MSG_ERROR(Cannot find libacl library headers); fi])
|
||||
+ AC_CHECK_HEADERS([sys/acl.h acl/libacl.h], [], [if test "x$with_libacl" != xcheck; then AC_MSG_ERROR(Cannot find libacl library headers); fi])
|
||||
])
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user