0002-Add-cmpiutil.h-for-declarations.patch 0003-Provide-proper-function-declarations.patch - rename sblim-cmpi-authorization-0.1.0.patch to 0001-return-value-from-yyerror.patch OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:wbem/sblim-cmpi-authorization?expand=0&rev=2
221 lines
7.1 KiB
Diff
221 lines
7.1 KiB
Diff
From 2408ada047a4ed062ec713921bb3e78ba24a5aa7 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@gmail.com>
|
|
Date: Fri, 24 Jan 2025 19:35:15 +0100
|
|
Subject: [PATCH 3/3] Provide proper function declarations
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
|
|
---
|
|
CWS_AuthorizationLexer.c | 3 ++-
|
|
CWS_AuthorizationLexer.l | 2 +-
|
|
CWS_AuthorizationParser.c | 49 +++++++++++++++++++++------------------
|
|
CWS_AuthorizationParser.h | 2 +-
|
|
CWS_AuthorizationParser.y | 3 +++
|
|
5 files changed, 33 insertions(+), 26 deletions(-)
|
|
|
|
diff --git a/CWS_AuthorizationLexer.c b/CWS_AuthorizationLexer.c
|
|
index b057d63..4841be0 100644
|
|
--- a/CWS_AuthorizationLexer.c
|
|
+++ b/CWS_AuthorizationLexer.c
|
|
@@ -2101,9 +2101,10 @@ void CWS_Authorizationyyfree (void * ptr )
|
|
/* USER SUBROUTINE SECTION */
|
|
/* Everything below is copied verbatim to the end of the lex generated C code. */
|
|
|
|
-CWS_Authorizationyyerror(char *errmsg)
|
|
+int CWS_Authorizationyyerror(char *errmsg)
|
|
{
|
|
fprintf(stderr, "error line %d: %s in '%s'\n", CWS_Authorizationyylineno, errmsg, CWS_Authorizationyytext);
|
|
+ return 1;
|
|
}
|
|
|
|
|
|
diff --git a/CWS_AuthorizationLexer.l b/CWS_AuthorizationLexer.l
|
|
index a5fe68e..ce62f01 100644
|
|
--- a/CWS_AuthorizationLexer.l
|
|
+++ b/CWS_AuthorizationLexer.l
|
|
@@ -149,7 +149,7 @@ NO {
|
|
/* USER SUBROUTINE SECTION */
|
|
/* Everything below is copied verbatim to the end of the lex generated C code. */
|
|
|
|
-yyerror(char *errmsg)
|
|
+int yyerror(char *errmsg)
|
|
{
|
|
fprintf(stderr, "error line %d: %s in '%s'\n", yylineno, errmsg, yytext);
|
|
return 1;
|
|
diff --git a/CWS_AuthorizationParser.c b/CWS_AuthorizationParser.c
|
|
index c2eb81b..b145691 100644
|
|
--- a/CWS_AuthorizationParser.c
|
|
+++ b/CWS_AuthorizationParser.c
|
|
@@ -79,6 +79,9 @@
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
+extern int CWS_Authorizationyylex (void);
|
|
+extern int CWS_Authorizationyyerror(char *errmsg);
|
|
+
|
|
#include "cmpimacs.h" /* Contains CMSetProperty() */
|
|
|
|
#define RC_OK 0
|
|
@@ -87,7 +90,7 @@
|
|
/* DEFINE ANY GLOBAL VARS HERE */
|
|
static CMPIInstance * _INSTANCE; /* The current instance that is being read into */
|
|
|
|
-#line 91 "CWS_AuthorizationParser.c"
|
|
+#line 94 "CWS_AuthorizationParser.c"
|
|
|
|
# ifndef YY_CAST
|
|
# ifdef __cplusplus
|
|
@@ -523,8 +526,8 @@ static const yytype_int8 yytranslate[] =
|
|
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
|
|
static const yytype_int8 yyrline[] =
|
|
{
|
|
- 0, 40, 40, 42, 41, 54, 58, 59, 60, 61,
|
|
- 62, 65, 69, 73, 77, 81, 85
|
|
+ 0, 43, 43, 45, 44, 57, 61, 62, 63, 64,
|
|
+ 65, 68, 72, 76, 80, 84, 88
|
|
};
|
|
#endif
|
|
|
|
@@ -1100,81 +1103,81 @@ yyreduce:
|
|
switch (yyn)
|
|
{
|
|
case 3: /* $@1: %empty */
|
|
-#line 42 "CWS_AuthorizationParser.y"
|
|
+#line 45 "CWS_AuthorizationParser.y"
|
|
{
|
|
CMSetProperty( _INSTANCE, "Username", (yyvsp[-2].string), CMPI_chars );
|
|
free((yyvsp[-2].string)); /* must free string because it was originally strdup'd */
|
|
CMSetProperty( _INSTANCE, "Classname", (yyvsp[-1].string), CMPI_chars );
|
|
free((yyvsp[-1].string)); /* must free string because it was originally strdup'd */
|
|
}
|
|
-#line 1111 "CWS_AuthorizationParser.c"
|
|
+#line 1114 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 4: /* instance: '[' USERNAME CLASSNAME ']' $@1 permissions */
|
|
-#line 49 "CWS_AuthorizationParser.y"
|
|
+#line 52 "CWS_AuthorizationParser.y"
|
|
{
|
|
/* Return after reading in each instance */
|
|
return RC_OK;
|
|
}
|
|
-#line 1120 "CWS_AuthorizationParser.c"
|
|
+#line 1123 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 5: /* instance: ENDOFFILE */
|
|
-#line 54 "CWS_AuthorizationParser.y"
|
|
+#line 57 "CWS_AuthorizationParser.y"
|
|
{ return RC_EOF; }
|
|
-#line 1126 "CWS_AuthorizationParser.c"
|
|
+#line 1129 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 11: /* permission: ENUMERATE ':' PERMISSION */
|
|
-#line 66 "CWS_AuthorizationParser.y"
|
|
+#line 69 "CWS_AuthorizationParser.y"
|
|
{
|
|
CMSetProperty( _INSTANCE, "Enumerate", &((yyvsp[0].boolean)), CMPI_boolean );
|
|
}
|
|
-#line 1134 "CWS_AuthorizationParser.c"
|
|
+#line 1137 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 12: /* permission: GET ':' PERMISSION */
|
|
-#line 70 "CWS_AuthorizationParser.y"
|
|
+#line 73 "CWS_AuthorizationParser.y"
|
|
{
|
|
CMSetProperty( _INSTANCE, "Get", &((yyvsp[0].boolean)), CMPI_boolean );
|
|
}
|
|
-#line 1142 "CWS_AuthorizationParser.c"
|
|
+#line 1145 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 13: /* permission: SET ':' PERMISSION */
|
|
-#line 74 "CWS_AuthorizationParser.y"
|
|
+#line 77 "CWS_AuthorizationParser.y"
|
|
{
|
|
CMSetProperty( _INSTANCE, "Set", &((yyvsp[0].boolean)), CMPI_boolean );
|
|
}
|
|
-#line 1150 "CWS_AuthorizationParser.c"
|
|
+#line 1153 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 14: /* permission: CREATE ':' PERMISSION */
|
|
-#line 78 "CWS_AuthorizationParser.y"
|
|
+#line 81 "CWS_AuthorizationParser.y"
|
|
{
|
|
CMSetProperty( _INSTANCE, "Create", &((yyvsp[0].boolean)), CMPI_boolean );
|
|
}
|
|
-#line 1158 "CWS_AuthorizationParser.c"
|
|
+#line 1161 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 15: /* permission: DELETE ':' PERMISSION */
|
|
-#line 82 "CWS_AuthorizationParser.y"
|
|
+#line 85 "CWS_AuthorizationParser.y"
|
|
{
|
|
CMSetProperty( _INSTANCE, "Delete", &((yyvsp[0].boolean)), CMPI_boolean );
|
|
}
|
|
-#line 1166 "CWS_AuthorizationParser.c"
|
|
+#line 1169 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
case 16: /* permission: QUERY ':' PERMISSION */
|
|
-#line 86 "CWS_AuthorizationParser.y"
|
|
+#line 89 "CWS_AuthorizationParser.y"
|
|
{
|
|
CMSetProperty( _INSTANCE, "Query", &((yyvsp[0].boolean)), CMPI_boolean );
|
|
}
|
|
-#line 1174 "CWS_AuthorizationParser.c"
|
|
+#line 1177 "CWS_AuthorizationParser.c"
|
|
break;
|
|
|
|
|
|
-#line 1178 "CWS_AuthorizationParser.c"
|
|
+#line 1181 "CWS_AuthorizationParser.c"
|
|
|
|
default: break;
|
|
}
|
|
@@ -1367,7 +1370,7 @@ yyreturnlab:
|
|
return yyresult;
|
|
}
|
|
|
|
-#line 92 "CWS_AuthorizationParser.y"
|
|
+#line 95 "CWS_AuthorizationParser.y"
|
|
|
|
|
|
/* USER SUBROUTINE SECTION */
|
|
diff --git a/CWS_AuthorizationParser.h b/CWS_AuthorizationParser.h
|
|
index 560d8e5..187413c 100644
|
|
--- a/CWS_AuthorizationParser.h
|
|
+++ b/CWS_AuthorizationParser.h
|
|
@@ -87,7 +87,7 @@ extern int CWS_Authorizationyydebug;
|
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
|
union YYSTYPE
|
|
{
|
|
-#line 18 "CWS_AuthorizationParser.y"
|
|
+#line 21 "CWS_AuthorizationParser.y"
|
|
|
|
CMPIBoolean boolean;
|
|
/* Note - we override the CIM definition of string to make this data type
|
|
diff --git a/CWS_AuthorizationParser.y b/CWS_AuthorizationParser.y
|
|
index 22d9692..f11cb95 100644
|
|
--- a/CWS_AuthorizationParser.y
|
|
+++ b/CWS_AuthorizationParser.y
|
|
@@ -5,6 +5,9 @@
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
+extern int CWS_Authorizationyylex (void);
|
|
+extern int CWS_Authorizationyyerror(char *errmsg);
|
|
+
|
|
#include "cmpimacs.h" /* Contains CMSetProperty() */
|
|
|
|
#define RC_OK 0
|
|
--
|
|
2.48.0
|
|
|