summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Rakus <rrakus@redhat.com>2012-08-14 15:10:03 +0200
committerRoman Rakus <rrakus@redhat.com>2012-08-14 15:11:43 +0200
commite84ef5b99ff28063dcda246aa2746177bcc22e9b (patch)
treef9b8308d041857e3ab09ba49c23dc39909c5fdd7
parent8e14ce31d9c6ad81a337e51647ab9fa16e62cbe7 (diff)
downloadopenlmi-providers-e84ef5b99ff28063dcda246aa2746177bcc22e9b.zip
openlmi-providers-e84ef5b99ff28063dcda246aa2746177bcc22e9b.tar.gz
openlmi-providers-e84ef5b99ff28063dcda246aa2746177bcc22e9b.tar.xz
Account provider0.0.2
Listing of the users and groups Signed-off-by: Roman Rakus <rrakus@redhat.com>
-rw-r--r--CMakeLists.txt1
-rwxr-xr-xexamples/test_account.py75
-rw-r--r--mof/Cura_Account.mof233
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/account/CMakeLists.txt38
-rw-r--r--src/account/Cura_AccountCapabilitiesProvider.c265
-rw-r--r--src/account/Cura_AccountManagementCapabilitiesProvider.c154
-rw-r--r--src/account/Cura_AccountManagementServiceCapabilitiesProvider.c234
-rw-r--r--src/account/Cura_AccountManagementServiceProvider.c207
-rw-r--r--src/account/Cura_AccountManagementServiceSettingDataProvider.c202
-rw-r--r--src/account/Cura_AccountOnSystemProvider.c272
-rw-r--r--src/account/Cura_AccountProvider.c243
-rw-r--r--src/account/Cura_AccountSettingDataProvider.c153
-rw-r--r--src/account/Cura_AssignedAccountIdentityProvider.c264
-rw-r--r--src/account/Cura_AssignedGroupIdentityProvider.c253
-rw-r--r--src/account/Cura_ElementSettingDateProvider.c202
-rw-r--r--src/account/Cura_EnabledAccountCapabilitiesProvider.c145
-rw-r--r--src/account/Cura_GroupProvider.c176
-rw-r--r--src/account/Cura_HostedServiceProvider.c239
-rw-r--r--src/account/Cura_IdentityProvider.c190
-rw-r--r--src/account/Cura_MemberOfGroupProvider.c280
-rw-r--r--src/account/Cura_OwningGroupProvider.c266
-rw-r--r--src/account/Cura_ServiceAffectsIdentityProvider.c300
-rw-r--r--src/account/Cura_SettingsDefineAccountCapabilitiesProvider.c202
-rw-r--r--src/account/Cura_SettingsDefineManagementCapabilitiesProvider.c202
-rw-r--r--src/account/aux_lu.c22
-rw-r--r--src/account/aux_lu.h9
-rw-r--r--src/account/macros.h15
28 files changed, 4846 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca84467..9141936 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,7 @@ endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
option(WITH-FAN "Build fan provider" ON)
option(WITH-POWER "Build power provider" ON)
option(WITH-SERVICE "Build service provider" ON)
+option(WITH-ACCOUNT "Build account provider" ON)
# Set path to custom cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
diff --git a/examples/test_account.py b/examples/test_account.py
new file mode 100755
index 0000000..5b88ca3
--- /dev/null
+++ b/examples/test_account.py
@@ -0,0 +1,75 @@
+#!/usr/bin/python
+
+import sys
+import pywbem
+
+def usage():
+ print """Usage: %s <address> <command> <command parameter> [username] [password]
+ Connect to CIM server at address and issue a command on the machine.
+
+Available commands and their parameters:
+ list_user - list users, parameter is user name or * for all
+ list_group - list groups, parameter is group name or * for all
+ group_members - list members of group, parameter is group name
+
+Example: %s https://127.0.0.1:5989 list_user * root redhat""" % (sys.argv[0], sys.argv[0])
+
+
+if len(sys.argv) < 6:
+ usage()
+ sys.exit(1)
+
+url = sys.argv[1]
+command = sys.argv[2]
+parameter = sys.argv[3]
+
+username = None
+password = None
+if len(sys.argv) > 4:
+ username = sys.argv[4]
+if len(sys.argv) > 5:
+ password = sys.argv[5]
+
+cliconn = pywbem.WBEMConnection(url, (username, password))
+
+if command == "list_user":
+# Listintg users is simple, just query all instances from Cura_Account
+# or select only by given Name
+ if parameter == "*":
+ instances = cliconn.ExecQuery('WQL', 'select * from Cura_Account')
+ else:
+ instances = cliconn.ExecQuery('WQL', 'select * from Cura_Account where Name = "%s"' % parameter)
+ for instance in instances:
+ print instance.tomof()
+
+elif command == "list_group":
+# Listintg gruops is simple, just query all instances from Cura_Group
+# or select only by given Name
+ if parameter == "*":
+ instances = cliconn.ExecQuery('WQL', 'select * from Cura_Group')
+ else:
+ instances = cliconn.ExecQuery('WQL', 'select * from Cura_Group where Name = "%s"' % parameter)
+ for instance in instances:
+ print instance.tomof()
+
+elif command == "group_members":
+# Group members is a bit tricky. You need to select group (Cura_Group)
+# by given Name, then you need to select identities (Cura_Identity), which
+# are connected through Cura_MemberOfGroup to Cura_Group.
+# And finally select all accounts (Cura_Account) which are connected through
+# Cura_AssignedAccountIdentity with selected identities (this should be
+# 1 to 1)
+ groups = cliconn.ExecQuery('WQL', 'select * from Cura_Group where Name = "%s"' % parameter)
+ for group in groups:
+ identities = cliconn.Associators(group.path, AssocClass='Cura_MemberOfGroup')
+ for identity in identities:
+ accounts = cliconn.Associators(identity.path, AssocClass='Cura_AssignedAccountIdentity')
+ for account in accounts:
+ print account.tomof()
+
+
+else:
+# unknown command
+ print "Unknown command", command
+ usage()
+ sys.exit(1)
diff --git a/mof/Cura_Account.mof b/mof/Cura_Account.mof
new file mode 100644
index 0000000..eb5256d
--- /dev/null
+++ b/mof/Cura_Account.mof
@@ -0,0 +1,233 @@
+//
+// Cura_Account.mof
+//
+// Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+// Red Hat Author(s): Roman Rakus <rrakus@redhat.com>
+//
+
+[ Description("Class representing Linux Account"),
+ Provider("cmpi:Account")
+]
+class Cura_Account : CIM_Account
+{
+ [Description("User's home directory")]
+ string HomeDirectory;
+
+ [Description("User's login shell")]
+ string LoginShell;
+
+ [Description("The date when was password last changed")]
+ datetime PasswordLastChange;
+
+ [Description("The minimal date when can be password changed")]
+ datetime PasswordMinLifetime;
+
+ [Description("The maximal date when can be password changed")]
+ datetime PasswordMaxLifetime;
+};
+
+[ Description("Cura_AccountManagementService creates, manages, and if necessary destroys Linux Accounts on behalf of other SecuritySerices."),
+ Provider("cmpi:Account")
+]
+class Cura_AccountManagementService : CIM_AccountManagementService
+{
+};
+
+[ Provider("cmpi:Account") ]
+class Cura_AccountManagementCapabilities : CIM_AccountManagementCapabilities
+{
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_AccountOnSystem : CIM_AccountOnSystem
+{
+ [ Override ("GroupComponent"),
+ Min ( 1 ),
+ Max ( 1 ),
+ Description ( "The hosting System." )]
+ CIM_ComputerSystem REF GroupComponent;
+
+ [ Override ("PartComponent"),
+ Description ( "The managed Account on the System" )]
+ Cura_Account REF PartComponent;
+};
+
+[ Provider("cmpi:Account") ]
+class Cura_AccountSettingData : CIM_AccountSettingData
+{
+};
+
+[ Provider("cmpi:Account") ]
+class Cura_Identity : CIM_Identity
+{
+};
+
+[ Provider("cmpi:Account") ]
+class Cura_Group : CIM_Group
+{
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_AssignedAccountIdentity : CIM_AssignedIdentity
+{
+ [ Override ("IdentityInfo"),
+ Description ( "The managed Identity" ) ]
+ Cura_Identity REF IdentityInfo;
+
+ [ Override ("ManagedElement"),
+ Description ( "The managed Account on the System" ) ]
+ Cura_Account REF ManagedElement;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_AssignedGroupIdentity : CIM_AssignedIdentity
+{
+ [ Override ("IdentityInfo"),
+ Description ( "The managed Identity" ) ]
+ Cura_Identity REF IdentityInfo;
+
+ [ Override ("ManagedElement"),
+ Description ( "The managed Group on the System" ) ]
+ Cura_Group REF ManagedElement;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_AccountManagementServiceCapabilities : CIM_ElementCapabilities
+{
+ [ Override ("ManagedElement"),
+ Description ( "The Central Instance of Account Management" ) ]
+ Cura_AccountManagementService REF ManagedElement;
+
+ [ Override ("Capabilities"),
+ Description ( "The supported Capabilities for managing Linux Accounts" ) ]
+ Cura_AccountManagementCapabilities REF Capabilities;
+};
+
+[ Provider("cmpi:Account") ]
+class Cura_EnabledAccountCapabilities : CIM_EnabledLogicalElementCapabilities
+{
+};
+
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_AccountCapabilities : CIM_ElementCapabilities
+{
+ [ Override ("ManagedElement"),
+ Description ( "The managed Account" ) ]
+ Cura_Account REF ManagedElement;
+
+ [ Override ("Capabilities"),
+ Description ( "The supported Capabilities for changing the state of the Linux Account" ) ]
+ Cura_EnabledAccountCapabilities REF Capabilities;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_AccountManagementServiceSettingData : CIM_ElementSettingData
+{
+ [ Override ("ManagedElement"),
+ Description ( "The Central Instance of Account management" ) ]
+ Cura_AccountManagementService REF ManagedElement;
+
+ [ Override ("SettingData"),
+ Description ( "The default enforced setting for new Accounts" ) ]
+ Cura_AccountSettingData REF SettingData;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_HostedService : CIM_HostedService
+{
+ [ Override ("Antecedent"),
+ Description ( "The hosting System" ) ]
+ CIM_ComputerSystem REF Antecedent;
+
+ [ Override ("Dependent"),
+ Description ( "The Central Instance of Account management" ) ]
+ Cura_AccountManagementService REF Dependent;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_MemberOfGroup : CIM_MemberOfCollection
+{
+ [ Override ("Collection"),
+ Description ( "The managed Group on the System" ) ]
+ Cura_Group REF Collection;
+
+ [ Override ("Member"),
+ Description ( "The managed Identity" ) ]
+ Cura_Identity REF Member;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_OwningGroup : CIM_OwningCollectionElement
+{
+ [ Override ("OwningElement"),
+ Description ( "The hosting System" ) ]
+ CIM_ComputerSystem REF OwningElement;
+
+ [ Override ("OwnedElement"),
+ Description ( "The managed Group on the System" ) ]
+ Cura_Group REF OwnedElement;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_ServiceAffectsIdentity : CIM_ServiceAffectsElement
+{
+ [ Override ("AffectingElement"),
+ Description ( "The Central Instance of Account management" ) ]
+ Cura_AccountManagementService REF AffectingElement;
+
+ [ Override ("AffectedElement"),
+ Description ( "The managed Identity" ) ]
+ Cura_Identity REF AffectedElement;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_SettingsDefineManagementCapabilities : CIM_SettingsDefineCapabilities
+{
+ [ Override ("GroupComponent"),
+ Description ( "The Account Management Capabilities" ) ]
+ Cura_AccountManagementCapabilities REF GroupComponent;
+
+ [ Override ("PartComponent"),
+ Description ( "The default enforced setting for new Accounts" ) ]
+ Cura_AccountSettingData REF PartComponent;
+};
+
+[ Association,
+ Provider("cmpi:Account") ]
+class Cura_SettingsDefineAccountCapabilities : CIM_SettingsDefineCapabilities
+{
+ [ Override ("GroupComponent"),
+ Description ( "The Account Capabilities" ) ]
+ Cura_EnabledAccountCapabilities REF GroupComponent;
+
+ [ Override ("PartComponent"),
+ Description ( "The default enforced setting for new Accounts" ) ]
+ Cura_AccountSettingData REF PartComponent;
+};
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f1b9ad6..80e687d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,3 +19,7 @@ endif (WITH-POWER)
if (WITH-SERVICE)
add_subdirectory(service)
endif (WITH-SERVICE)
+
+if (WITH-ACCOUNT)
+ add_subdirectory(account)
+endif (WITH-ACCOUNT)
diff --git a/src/account/CMakeLists.txt b/src/account/CMakeLists.txt
new file mode 100644
index 0000000..35fd843
--- /dev/null
+++ b/src/account/CMakeLists.txt
@@ -0,0 +1,38 @@
+
+set(PROVIDER_NAME Account)
+set(LIBRARY_NAME cmpiCura_${PROVIDER_NAME})
+set(MOF Cura_Account.mof)
+
+set(provider_SRCS
+ aux_lu.c
+)
+
+konkretcmpi_generate(${MOF}
+ CIM_PROVIDERS
+ CIM_HEADERS
+)
+
+add_library(${LIBRARY_NAME} SHARED
+ ${provider_SRCS}
+ ${CIM_PROVIDERS}
+ ${CIM_HEADERS}
+)
+
+# Require GLib-2.0 and libuser
+pkg_check_modules(GLIB REQUIRED glib-2.0)
+pkg_check_modules(LIBUSER REQUIRED libuser)
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMPI_INCLUDE_DIR} ${GLIB_INCLUDE_DIRS})
+
+target_link_libraries(${LIBRARY_NAME} curacommon ${KONKRETCMPI_LIBRARIES} ${GLIB_LIBRARIES})
+
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMPI_INCLUDE_DIR} ${LIBUSER_INCLUDE_DIRS})
+
+target_link_libraries(${LIBRARY_NAME} curacommon ${KONKRETCMPI_LIBRARIES} ${LIBUSER_LIBRARIES})
+
+# Create registration file
+cim_registration(${PROVIDER_NAME} ${LIBRARY_NAME} ${MOF})
+
+install(TARGETS ${LIBRARY_NAME} DESTINATION lib${LIB_SUFFIX}/cmpi/)
+
diff --git a/src/account/Cura_AccountCapabilitiesProvider.c b/src/account/Cura_AccountCapabilitiesProvider.c
new file mode 100644
index 0000000..b325f4a
--- /dev/null
+++ b/src/account/Cura_AccountCapabilitiesProvider.c
@@ -0,0 +1,265 @@
+#include <konkret/konkret.h>
+#include "Cura_AccountCapabilities.h"
+#include "Cura_Account.h"
+#include "Cura_EnabledAccountCapabilities.h"
+
+#include "macros.h"
+#include "globals.h"
+#include "aux_lu.h"
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+#include <glib.h>
+
+static const CMPIBroker* _cb;
+
+static void Cura_AccountCapabilitiesInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountCapabilitiesCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_AccountRef laref;
+ Cura_EnabledAccountCapabilitiesRef leacref;
+ Cura_AccountCapabilities lac;
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *accounts = NULL;
+ struct lu_ent *lue = NULL;
+
+ size_t i;
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+
+ Cura_EnabledAccountCapabilitiesRef_Init(&leacref, _cb, nameSpace);
+ Cura_EnabledAccountCapabilitiesRef_Set_InstanceID(&leacref,
+ ORGID":"LEACNAME);
+
+ luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+ accounts = lu_users_enumerate_full(luc, "*", &error);
+
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+
+ Cura_AccountRef_Init(&laref, _cb, nameSpace);
+ Cura_AccountRef_Set_Name(&laref, aux_lu_get_str(lue, LU_USERNAME));
+ Cura_AccountRef_Set_SystemCreationClassName(&laref,
+ get_system_creation_class_name());
+ Cura_AccountRef_Set_SystemName(&laref, hostname);
+ Cura_AccountRef_Set_CreationClassName(&laref,
+ Cura_Account_ClassName);
+
+ Cura_AccountCapabilities_Init(&lac, _cb, nameSpace);
+ Cura_AccountCapabilities_Set_ManagedElement(&lac, &laref);
+ Cura_AccountCapabilities_Set_Capabilities(&lac, &leacref);
+
+ KReturnInstance(cr, lac);
+ lu_ent_free(lue);
+ } /* for */
+
+ if (accounts)
+ {
+ g_ptr_array_free(accounts, TRUE);
+ }
+
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountCapabilities_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_AccountCapabilitiesReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountCapabilities_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_AccountCapabilities,
+ Cura_AccountCapabilities,
+ _cb,
+ Cura_AccountCapabilitiesInitialize())
+
+CMAssociationMIStub(
+ Cura_AccountCapabilities,
+ Cura_AccountCapabilities,
+ _cb,
+ Cura_AccountCapabilitiesInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AccountCapabilities",
+ "Cura_AccountCapabilities",
+ "instance association")
diff --git a/src/account/Cura_AccountManagementCapabilitiesProvider.c b/src/account/Cura_AccountManagementCapabilitiesProvider.c
new file mode 100644
index 0000000..29921ab
--- /dev/null
+++ b/src/account/Cura_AccountManagementCapabilitiesProvider.c
@@ -0,0 +1,154 @@
+#include <konkret/konkret.h>
+#include "Cura_AccountManagementCapabilities.h"
+
+#include <stdbool.h>
+
+#include "macros.h"
+#include "globals.h"
+
+#define NAME LAMCNAME
+
+static const CMPIBroker* _cb = NULL;
+
+static void Cura_AccountManagementCapabilitiesInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_AccountManagementCapabilities lamc;
+
+ Cura_AccountManagementCapabilities_Init(&lamc, _cb, KNameSpace(cop));
+ Cura_AccountManagementCapabilities_Set_ElementNameEditSupported(
+ &lamc, false);
+ Cura_AccountManagementCapabilities_Set_InstanceID(&lamc, ORGID":"LAMCNAME);
+ Cura_AccountManagementCapabilities_Set_ElementName(&lamc, NAME);
+
+ Cura_AccountManagementCapabilities_Init_OperationsSupported(&lamc, 3);
+ Cura_AccountManagementCapabilities_Set_OperationsSupported(&lamc, 0,
+ Cura_AccountManagementCapabilities_OperationsSupported_Create);
+ Cura_AccountManagementCapabilities_Set_OperationsSupported(&lamc, 1,
+ Cura_AccountManagementCapabilities_OperationsSupported_Modify);
+ Cura_AccountManagementCapabilities_Set_OperationsSupported(&lamc, 2,
+ Cura_AccountManagementCapabilities_OperationsSupported_Delete);
+
+ Cura_AccountManagementCapabilities_Init_SupportedUserPasswordEncryptionAlgorithms(&lamc, 1);
+ Cura_AccountManagementCapabilities_Set_SupportedUserPasswordEncryptionAlgorithms(&lamc, 0, Cura_AccountManagementCapabilities_SupportedUserPasswordEncryptionAlgorithms_Other);
+
+ KReturnInstance(cr, lamc);
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Cura_AccountManagementCapabilities,
+ Cura_AccountManagementCapabilities,
+ _cb,
+ Cura_AccountManagementCapabilitiesInitialize())
+
+static CMPIStatus Cura_AccountManagementCapabilitiesMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementCapabilitiesInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Cura_AccountManagementCapabilities_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Cura_AccountManagementCapabilities,
+ Cura_AccountManagementCapabilities,
+ _cb,
+ Cura_AccountManagementCapabilitiesInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AccountManagementCapabilities",
+ "Cura_AccountManagementCapabilities",
+ "instance method")
diff --git a/src/account/Cura_AccountManagementServiceCapabilitiesProvider.c b/src/account/Cura_AccountManagementServiceCapabilitiesProvider.c
new file mode 100644
index 0000000..459770f
--- /dev/null
+++ b/src/account/Cura_AccountManagementServiceCapabilitiesProvider.c
@@ -0,0 +1,234 @@
+#include <konkret/konkret.h>
+#include "Cura_AccountManagementServiceCapabilities.h"
+#include "Cura_AccountManagementService.h"
+#include "Cura_AccountManagementCapabilities.h"
+
+#include "macros.h"
+#include "globals.h"
+
+static const CMPIBroker* _cb;
+
+static void Cura_AccountManagementServiceCapabilitiesInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_AccountManagementServiceRef lamsref;
+ Cura_AccountManagementCapabilitiesRef lamcref;
+ Cura_AccountManagementServiceCapabilities lamsc;
+
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+
+ Cura_AccountManagementServiceRef_Init(&lamsref, _cb, nameSpace);
+ Cura_AccountManagementServiceRef_Set_Name(&lamsref, LAMSNAME);
+ Cura_AccountManagementServiceRef_Set_SystemCreationClassName(&lamsref,
+ get_system_creation_class_name());
+ Cura_AccountManagementServiceRef_Set_SystemName(&lamsref, hostname);
+ Cura_AccountManagementServiceRef_Set_CreationClassName(&lamsref,
+ Cura_AccountManagementService_ClassName);
+
+ Cura_AccountManagementCapabilitiesRef_Init(&lamcref, _cb, nameSpace);
+ Cura_AccountManagementCapabilitiesRef_Set_InstanceID(&lamcref,
+ ORGID":"LAMCNAME);
+
+ Cura_AccountManagementServiceCapabilities_Init(&lamsc, _cb, nameSpace);
+ Cura_AccountManagementServiceCapabilities_Set_ManagedElement(&lamsc,
+ &lamsref);
+ Cura_AccountManagementServiceCapabilities_Set_Capabilities(&lamsc,
+ &lamcref);
+
+ KReturnInstance(cr, lamsc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceCapabilities_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCapabilitiesReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceCapabilities_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_AccountManagementServiceCapabilities,
+ Cura_AccountManagementServiceCapabilities,
+ _cb,
+ Cura_AccountManagementServiceCapabilitiesInitialize())
+
+CMAssociationMIStub(
+ Cura_AccountManagementServiceCapabilities,
+ Cura_AccountManagementServiceCapabilities,
+ _cb,
+ Cura_AccountManagementServiceCapabilitiesInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AccountManagementServiceCapabilities",
+ "Cura_AccountManagementServiceCapabilities",
+ "instance association")
diff --git a/src/account/Cura_AccountManagementServiceProvider.c b/src/account/Cura_AccountManagementServiceProvider.c
new file mode 100644
index 0000000..f50d8f3
--- /dev/null
+++ b/src/account/Cura_AccountManagementServiceProvider.c
@@ -0,0 +1,207 @@
+#include <konkret/konkret.h>
+#include "Cura_AccountManagementService.h"
+
+#include "macros.h"
+#include "globals.h"
+
+static const CMPIBroker* _cb = NULL;
+
+static void Cura_AccountManagementServiceInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountManagementServiceCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountManagementServiceEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_AccountManagementService lams;
+
+ const char *hostname = get_system_name();
+
+ Cura_AccountManagementService_Init(&lams, _cb, KNameSpace(cop));
+ Cura_AccountManagementService_Set_CreationClassName(&lams,
+ Cura_AccountManagementService_ClassName);
+ Cura_AccountManagementService_Set_SystemName(&lams, hostname);
+ Cura_AccountManagementService_Set_Name(&lams, LAMSNAME);
+ Cura_AccountManagementService_Set_ElementName(&lams, LAMSNAME);
+ Cura_AccountManagementService_Set_SystemCreationClassName(&lams,
+ get_system_creation_class_name());
+ Cura_AccountManagementService_Set_RequestedState(&lams,
+ Cura_AccountManagementService_RequestedState_Not_Applicable);
+ Cura_AccountManagementService_Set_EnabledState(&lams,
+ Cura_AccountManagementService_EnabledState_Enabled);
+
+ KReturnInstance(cr, lams);
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountManagementServiceCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Cura_AccountManagementService,
+ Cura_AccountManagementService,
+ _cb,
+ Cura_AccountManagementServiceInitialize())
+
+static CMPIStatus Cura_AccountManagementServiceMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Cura_AccountManagementService_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Cura_AccountManagementService,
+ Cura_AccountManagementService,
+ _cb,
+ Cura_AccountManagementServiceInitialize())
+
+KUint32 Cura_AccountManagementService_RequestStateChange(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* context,
+ const Cura_AccountManagementServiceRef* self,
+ const KUint16* RequestedState,
+ KRef* Job,
+ const KDateTime* TimeoutPeriod,
+ CMPIStatus* status)
+{
+ KUint32 result = KUINT32_INIT;
+
+ KSetStatus(status, ERR_NOT_SUPPORTED);
+ return result;
+}
+
+KUint32 Cura_AccountManagementService_StartService(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* context,
+ const Cura_AccountManagementServiceRef* self,
+ CMPIStatus* status)
+{
+ KUint32 result = KUINT32_INIT;
+
+ KSetStatus(status, ERR_NOT_SUPPORTED);
+ return result;
+}
+
+KUint32 Cura_AccountManagementService_StopService(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* context,
+ const Cura_AccountManagementServiceRef* self,
+ CMPIStatus* status)
+{
+ KUint32 result = KUINT32_INIT;
+
+ KSetStatus(status, ERR_NOT_SUPPORTED);
+ return result;
+}
+
+KUint32 Cura_AccountManagementService_CreateAccount(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* context,
+ const Cura_AccountManagementServiceRef* self,
+ const KRef* System,
+ const KString* AccountTemplate,
+ KRef* Account,
+ KRefA* Identities,
+ CMPIStatus* status)
+{
+ KUint32 result = KUINT32_INIT;
+
+ KSetStatus(status, ERR_NOT_SUPPORTED);
+ return result;
+}
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AccountManagementService",
+ "Cura_AccountManagementService",
+ "instance method")
diff --git a/src/account/Cura_AccountManagementServiceSettingDataProvider.c b/src/account/Cura_AccountManagementServiceSettingDataProvider.c
new file mode 100644
index 0000000..5378a8f
--- /dev/null
+++ b/src/account/Cura_AccountManagementServiceSettingDataProvider.c
@@ -0,0 +1,202 @@
+#include <konkret/konkret.h>
+#include "Cura_AccountManagementServiceSettingData.h"
+
+static const CMPIBroker* _cb;
+
+static void Cura_AccountManagementServiceSettingDataInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceSettingData_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceSettingData_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceSettingData_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_AccountManagementServiceSettingDataReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountManagementServiceSettingData_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_AccountManagementServiceSettingData,
+ Cura_AccountManagementServiceSettingData,
+ _cb,
+ Cura_AccountManagementServiceSettingDataInitialize())
+
+CMAssociationMIStub(
+ Cura_AccountManagementServiceSettingData,
+ Cura_AccountManagementServiceSettingData,
+ _cb,
+ Cura_AccountManagementServiceSettingDataInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AccountManagementServiceSettingData",
+ "Cura_AccountManagementServiceSettingData",
+ "instance association")
diff --git a/src/account/Cura_AccountOnSystemProvider.c b/src/account/Cura_AccountOnSystemProvider.c
new file mode 100644
index 0000000..0b1a051
--- /dev/null
+++ b/src/account/Cura_AccountOnSystemProvider.c
@@ -0,0 +1,272 @@
+#include <konkret/konkret.h>
+#include "Cura_AccountOnSystem.h"
+#include "Cura_Account.h"
+#include "CIM_ComputerSystem.h"
+
+#include <glib.h>
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+#include "aux_lu.h"
+#include "macros.h"
+#include "globals.h"
+
+static const CMPIBroker* _cb;
+
+static void Cura_AccountOnSystemInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountOnSystemCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountOnSystemEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountOnSystemEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_AccountRef laref;
+ CIM_ComputerSystemRef lcsref;
+ Cura_AccountOnSystem laos;
+
+ CMPIObjectPath *computerSystemOP = NULL;
+ CMPIStatus rc;
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *accounts = NULL;
+ struct lu_ent *lue = NULL;
+
+ size_t i;
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+
+ CIM_ComputerSystemRef_Init(&lcsref, _cb, nameSpace);
+ CIM_ComputerSystemRef_Set_Name(&lcsref, hostname);
+ CIM_ComputerSystemRef_Set_CreationClassName(&lcsref,
+ get_system_creation_class_name());
+
+ computerSystemOP = CIM_ComputerSystemRef_ToObjectPath(&lcsref, &rc);
+ computerSystemOP->ft->setClassName(computerSystemOP,
+ get_system_creation_class_name());
+
+ luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+
+ accounts = lu_users_enumerate_full(luc, "*", &error);
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+
+ Cura_AccountRef_Init(&laref, _cb, nameSpace);
+ Cura_AccountRef_Set_SystemCreationClassName(&laref, get_system_creation_class_name());
+ Cura_AccountRef_Set_SystemName(&laref, hostname);
+ Cura_AccountRef_Set_CreationClassName(&laref,
+ Cura_Account_ClassName);
+ Cura_AccountRef_Set_Name(&laref, aux_lu_get_str(lue, LU_USERNAME));
+
+ Cura_AccountOnSystem_Init(&laos, _cb, nameSpace);
+ Cura_AccountOnSystem_SetObjectPath_GroupComponent(&laos,
+ computerSystemOP);
+ Cura_AccountOnSystem_Set_PartComponent(&laos, &laref);
+
+ KReturnInstance(cr, laos);
+ lu_ent_free(lue);
+ } /* for */
+
+ if (accounts)
+ {
+ g_ptr_array_free(accounts, TRUE);
+ }
+
+ lu_end(luc);
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountOnSystemGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountOnSystemCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountOnSystemModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountOnSystemDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountOnSystemExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountOnSystemAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountOnSystemAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountOnSystem_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_AccountOnSystemAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountOnSystem_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_AccountOnSystemReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountOnSystem_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_AccountOnSystemReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AccountOnSystem_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_AccountOnSystem,
+ Cura_AccountOnSystem,
+ _cb,
+ Cura_AccountOnSystemInitialize())
+
+CMAssociationMIStub(
+ Cura_AccountOnSystem,
+ Cura_AccountOnSystem,
+ _cb,
+ Cura_AccountOnSystemInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AccountOnSystem",
+ "Cura_AccountOnSystem",
+ "instance association")
diff --git a/src/account/Cura_AccountProvider.c b/src/account/Cura_AccountProvider.c
new file mode 100644
index 0000000..080dea5
--- /dev/null
+++ b/src/account/Cura_AccountProvider.c
@@ -0,0 +1,243 @@
+#include <konkret/konkret.h>
+#include "Cura_Account.h"
+
+#include <time.h>
+#include <stdbool.h>
+
+#include <glib.h>
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+#include <cmpi/cmpidt.h>
+#include <cmpi/cmpift.h>
+#include <cmpi/cmpimacs.h>
+
+
+#include "aux_lu.h"
+#include "macros.h"
+#include "globals.h"
+
+static const CMPIBroker* _cb = NULL;
+
+static void Cura_AccountInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_Account la;
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *accounts = NULL;
+ struct lu_ent *lue = NULL;
+
+ size_t i;
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+ char *uid = NULL;
+ long expire;
+ CMPIUint64 binTime = 0;
+ CMPIStatus *rc = NULL;
+ char *password = NULL;
+
+ luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+
+ uid = malloc(256 * sizeof(char));
+ accounts = lu_users_enumerate_full(luc, "*", &error);
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+
+ Cura_Account_Init(&la, _cb, nameSpace);
+ Cura_Account_Set_CreationClassName(&la, Cura_Account_ClassName);
+ Cura_Account_Set_SystemName(&la, hostname);
+ Cura_Account_Set_SystemCreationClassName(&la, get_system_creation_class_name());
+ Cura_Account_Set_Name(&la, aux_lu_get_str(lue, LU_USERNAME));
+
+ Cura_Account_Init_OrganizationName(&la, 1); /* XXX */
+ Cura_Account_Set_OrganizationName(&la, 0, ""); /* XXX */
+
+ /* Need to convert long int UID to the string */
+ snprintf(uid, 255, "%ld", aux_lu_get_long(lue, LU_UIDNUMBER));
+ Cura_Account_Set_UserID(&la, uid);
+
+ Cura_Account_Init_Host(&la, 1);
+ Cura_Account_Set_Host(&la, 0, hostname);
+ Cura_Account_Set_ElementName(&la, aux_lu_get_str(lue, LU_GECOS));
+ Cura_Account_Set_HomeDirectory(&la, aux_lu_get_str(lue,
+ LU_HOMEDIRECTORY));
+ Cura_Account_Set_LoginShell(&la, aux_lu_get_str(lue, LU_LOGINSHELL));
+
+ Cura_Account_Set_PasswordLastChange(&la,
+ CMNewDateTimeFromBinary(_cb,
+ DAYSTOMS(aux_lu_get_long(lue, LU_SHADOWLASTCHANGE)),false, rc));
+
+ password = aux_lu_get_str(lue, LU_SHADOWPASSWORD);
+ Cura_Account_Init_UserPassword(&la, 1);
+ Cura_Account_Set_UserPassword(&la, 0, password);
+ /* Assume all passwords (encrypted or not) are in ascii encoding */
+ Cura_Account_Set_UserPasswordEncoding(&la, 2);
+ if(strstr(password, ""))
+
+ expire = aux_lu_get_long(lue, LU_SHADOWEXPIRE);
+ if (expire != -1)
+ {
+ binTime = DAYSTOMS(expire);
+ Cura_Account_Set_PasswordExpiration(&la,
+ CMNewDateTimeFromBinary(_cb, binTime, false, rc));
+ }
+ else
+ {
+ Cura_Account_Null_PasswordExpiration(&la);
+ }
+
+ KReturnInstance(cr, la);
+ lu_ent_free(lue);
+ } /* for */
+ free(uid);
+
+ if (accounts)
+ {
+ g_ptr_array_free(accounts, TRUE);
+ }
+
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Cura_Account,
+ Cura_Account,
+ _cb,
+ Cura_AccountInitialize())
+
+static CMPIStatus Cura_AccountMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Cura_Account_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Cura_Account,
+ Cura_Account,
+ _cb,
+ Cura_AccountInitialize())
+
+KUint32 Cura_Account_RequestStateChange(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* context,
+ const Cura_AccountRef* self,
+ const KUint16* RequestedState,
+ KRef* Job,
+ const KDateTime* TimeoutPeriod,
+ CMPIStatus* status)
+{
+ KUint32 result = KUINT32_INIT;
+
+ KSetStatus(status, ERR_NOT_SUPPORTED);
+ return result;
+}
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_Account",
+ "Cura_Account",
+ "instance method")
diff --git a/src/account/Cura_AccountSettingDataProvider.c b/src/account/Cura_AccountSettingDataProvider.c
new file mode 100644
index 0000000..974a5ee
--- /dev/null
+++ b/src/account/Cura_AccountSettingDataProvider.c
@@ -0,0 +1,153 @@
+#include <konkret/konkret.h>
+#include "Cura_AccountSettingData.h"
+
+#include "macros.h"
+#include "globals.h"
+
+#include <libuser/config.h>
+#include <libuser/user.h>
+
+static const CMPIBroker* _cb = NULL;
+
+static void Cura_AccountSettingDataInitialize()
+{
+}
+
+static CMPIStatus Cura_AccountSettingDataCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountSettingDataEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AccountSettingDataEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+#if 0
+ Cura_AccountSettingData lasd;
+
+ const char *nameSpace = KNameSpace(cop);
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+
+ luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+
+ const char * mpe = lu_cfg_read_single(luc, "userdefaults/"LU_SHADOWMAX,
+ NULL);
+ fprintf(stderr, "Read single: %s\n", mpe);
+ Cura_AccountSettingData_Init(&lasd, _cb, nameSpace);
+#endif
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountSettingDataGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AccountSettingDataCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountSettingDataModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountSettingDataDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AccountSettingDataExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Cura_AccountSettingData,
+ Cura_AccountSettingData,
+ _cb,
+ Cura_AccountSettingDataInitialize())
+
+static CMPIStatus Cura_AccountSettingDataMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AccountSettingDataInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Cura_AccountSettingData_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Cura_AccountSettingData,
+ Cura_AccountSettingData,
+ _cb,
+ Cura_AccountSettingDataInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AccountSettingData",
+ "Cura_AccountSettingData",
+ "instance method")
diff --git a/src/account/Cura_AssignedAccountIdentityProvider.c b/src/account/Cura_AssignedAccountIdentityProvider.c
new file mode 100644
index 0000000..99d1407
--- /dev/null
+++ b/src/account/Cura_AssignedAccountIdentityProvider.c
@@ -0,0 +1,264 @@
+#include <konkret/konkret.h>
+#include "Cura_AssignedAccountIdentity.h"
+#include "Cura_Identity.h"
+#include "Cura_Account.h"
+
+#include "aux_lu.h"
+#include "macros.h"
+#include "globals.h"
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+static const CMPIBroker* _cb;
+
+static void Cura_AssignedAccountIdentityInitialize()
+{
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_IdentityRef liref;
+ Cura_AccountRef laref;
+ Cura_AssignedAccountIdentity laai;
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *accounts = NULL;
+ struct lu_ent *lue = NULL;
+
+ size_t i;
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+ char *uid = NULL;
+
+ luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+ uid = malloc(256 * sizeof(char));
+ accounts = lu_users_enumerate_full(luc, "*", &error);
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+
+ Cura_IdentityRef_Init(&liref, _cb, nameSpace);
+ snprintf(uid, 255, ORGID":UID:%ld",
+ aux_lu_get_long(lue, LU_UIDNUMBER));
+ Cura_IdentityRef_Set_InstanceID(&liref, uid);
+
+ Cura_AccountRef_Init(&laref, _cb, nameSpace);
+ Cura_AccountRef_Set_Name(&laref, aux_lu_get_str(lue, LU_USERNAME));
+ Cura_AccountRef_Set_SystemName(&laref, hostname);
+ Cura_AccountRef_Set_SystemCreationClassName(&laref, get_system_creation_class_name());
+ Cura_AccountRef_Set_CreationClassName(&laref, Cura_Account_ClassName);
+
+ Cura_AssignedAccountIdentity_Init(&laai, _cb, nameSpace);
+ Cura_AssignedAccountIdentity_Set_IdentityInfo(&laai, &liref);
+ Cura_AssignedAccountIdentity_Set_ManagedElement(&laai, &laref);
+
+ KReturnInstance(cr, laai);
+ lu_ent_free(lue);
+ } /* for */
+ free(uid);
+
+ if (accounts)
+ {
+ g_ptr_array_free(accounts, TRUE);
+ }
+
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedAccountIdentity_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedAccountIdentity_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedAccountIdentity_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_AssignedAccountIdentityReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedAccountIdentity_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_AssignedAccountIdentity,
+ Cura_AssignedAccountIdentity,
+ _cb,
+ Cura_AssignedAccountIdentityInitialize())
+
+CMAssociationMIStub(
+ Cura_AssignedAccountIdentity,
+ Cura_AssignedAccountIdentity,
+ _cb,
+ Cura_AssignedAccountIdentityInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AssignedAccountIdentity",
+ "Cura_AssignedAccountIdentity",
+ "instance association")
diff --git a/src/account/Cura_AssignedGroupIdentityProvider.c b/src/account/Cura_AssignedGroupIdentityProvider.c
new file mode 100644
index 0000000..090abbc
--- /dev/null
+++ b/src/account/Cura_AssignedGroupIdentityProvider.c
@@ -0,0 +1,253 @@
+#include <konkret/konkret.h>
+#include "Cura_AssignedGroupIdentity.h"
+#include "Cura_Identity.h"
+#include "Cura_Group.h"
+
+#include "aux_lu.h"
+#include "macros.h"
+#include "globals.h"
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+static const CMPIBroker* _cb;
+
+static void Cura_AssignedGroupIdentityInitialize()
+{
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_IdentityRef liref;
+ Cura_GroupRef lgref;
+ Cura_AssignedGroupIdentity lagi;
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *groups = NULL;
+ struct lu_ent *lue = NULL;
+
+ size_t i;
+ const char *nameSpace = KNameSpace(cop);
+ char *gid = NULL;
+
+ luc = lu_start(NULL, lu_group, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+ gid = malloc(256 * sizeof(char));
+ groups = lu_groups_enumerate_full(luc, "*", &error);
+ for (i = 0; (groups != NULL) && (i < groups->len); i++)
+ {
+ lue = g_ptr_array_index(groups, i);
+
+ Cura_GroupRef_Init(&lgref, _cb, nameSpace);
+ Cura_GroupRef_Set_CreationClassName(&lgref, Cura_Group_ClassName);
+ Cura_GroupRef_Set_Name(&lgref, aux_lu_get_str(lue, LU_GROUPNAME));
+
+ Cura_IdentityRef_Init(&liref, _cb, nameSpace);
+ snprintf(gid, 255, ORGID":GID:%ld",
+ aux_lu_get_long(lue, LU_GIDNUMBER));
+ Cura_IdentityRef_Set_InstanceID(&liref, gid);
+
+ Cura_AssignedGroupIdentity_Init(&lagi, _cb, nameSpace);
+ Cura_AssignedGroupIdentity_Set_IdentityInfo(&lagi, &liref);
+ Cura_AssignedGroupIdentity_Set_ManagedElement(&lagi, &lgref);
+
+ KReturnInstance(cr, lagi);
+ lu_ent_free(lue);
+ } /* for */
+ free(gid);
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedGroupIdentity_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedGroupIdentity_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedGroupIdentity_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_AssignedGroupIdentityReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_AssignedGroupIdentity_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_AssignedGroupIdentity,
+ Cura_AssignedGroupIdentity,
+ _cb,
+ Cura_AssignedGroupIdentityInitialize())
+
+CMAssociationMIStub(
+ Cura_AssignedGroupIdentity,
+ Cura_AssignedGroupIdentity,
+ _cb,
+ Cura_AssignedGroupIdentityInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_AssignedGroupIdentity",
+ "Cura_AssignedGroupIdentity",
+ "instance association")
diff --git a/src/account/Cura_ElementSettingDateProvider.c b/src/account/Cura_ElementSettingDateProvider.c
new file mode 100644
index 0000000..acbc0b5
--- /dev/null
+++ b/src/account/Cura_ElementSettingDateProvider.c
@@ -0,0 +1,202 @@
+#include <konkret/konkret.h>
+#include "Cura_ElementSettingDate.h"
+
+static const CMPIBroker* _cb;
+
+static void Cura_ElementSettingDateInitialize()
+{
+}
+
+static CMPIStatus Cura_ElementSettingDateCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_ElementSettingDateEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_ElementSettingDateEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_ElementSettingDateGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_ElementSettingDateCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ElementSettingDateModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ElementSettingDateDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ElementSettingDateExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ElementSettingDateAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_ElementSettingDateAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ElementSettingDate_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_ElementSettingDateAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ElementSettingDate_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_ElementSettingDateReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ElementSettingDate_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_ElementSettingDateReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ElementSettingDate_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_ElementSettingDate,
+ Cura_ElementSettingDate,
+ _cb,
+ Cura_ElementSettingDateInitialize())
+
+CMAssociationMIStub(
+ Cura_ElementSettingDate,
+ Cura_ElementSettingDate,
+ _cb,
+ Cura_ElementSettingDateInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_ElementSettingDate",
+ "Cura_ElementSettingDate",
+ "instance association")
diff --git a/src/account/Cura_EnabledAccountCapabilitiesProvider.c b/src/account/Cura_EnabledAccountCapabilitiesProvider.c
new file mode 100644
index 0000000..b8ba152
--- /dev/null
+++ b/src/account/Cura_EnabledAccountCapabilitiesProvider.c
@@ -0,0 +1,145 @@
+#include <konkret/konkret.h>
+#include "Cura_EnabledAccountCapabilities.h"
+
+#include "macros.h"
+#include "globals.h"
+
+#include <stdbool.h>
+
+static const CMPIBroker* _cb = NULL;
+
+static void Cura_EnabledAccountCapabilitiesInitialize()
+{
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_EnabledAccountCapabilities leac;
+
+ const char *nameSpace = KNameSpace(cop);
+
+ Cura_EnabledAccountCapabilities_Init(&leac, _cb, nameSpace);
+ Cura_EnabledAccountCapabilities_Set_InstanceID(&leac, ORGID":"LEACNAME);
+ Cura_EnabledAccountCapabilities_Set_ElementName(&leac, LEACNAME);
+ Cura_EnabledAccountCapabilities_Init_RequestedStatesSupported(&leac, 0);
+ Cura_EnabledAccountCapabilities_Set_ElementNameEditSupported(&leac,
+ false);
+
+ KReturnInstance(cr, leac);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Cura_EnabledAccountCapabilities,
+ Cura_EnabledAccountCapabilities,
+ _cb,
+ Cura_EnabledAccountCapabilitiesInitialize())
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_EnabledAccountCapabilitiesInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Cura_EnabledAccountCapabilities_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Cura_EnabledAccountCapabilities,
+ Cura_EnabledAccountCapabilities,
+ _cb,
+ Cura_EnabledAccountCapabilitiesInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_EnabledAccountCapabilities",
+ "Cura_EnabledAccountCapabilities",
+ "instance method")
diff --git a/src/account/Cura_GroupProvider.c b/src/account/Cura_GroupProvider.c
new file mode 100644
index 0000000..1e585e4
--- /dev/null
+++ b/src/account/Cura_GroupProvider.c
@@ -0,0 +1,176 @@
+#include <konkret/konkret.h>
+#include "Cura_Group.h"
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+#include "aux_lu.h"
+#include "macros.h"
+#include "globals.h"
+
+static const CMPIBroker* _cb = NULL;
+
+static void Cura_GroupInitialize()
+{
+}
+
+static CMPIStatus Cura_GroupCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_GroupEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_GroupEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_Group lg;
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *groups = NULL;
+ struct lu_ent *lue = NULL;
+ size_t i;
+ const char *nameSpace = KNameSpace(cop);
+ char *instanceid = NULL;
+
+ luc = lu_start(NULL, lu_group, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+
+ instanceid = malloc(256 * sizeof(char));
+ groups = lu_groups_enumerate_full(luc, "*", &error);
+ for (i = 0; (groups != NULL) && (i < groups->len); i++)
+ {
+ lue = g_ptr_array_index(groups, i);
+
+ Cura_Group_Init(&lg, _cb, nameSpace);
+ Cura_Group_Set_CreationClassName(&lg, Cura_Group_ClassName);
+ Cura_Group_Set_Name(&lg, aux_lu_get_str(lue, LU_GROUPNAME));
+ Cura_Group_Set_ElementName(&lg, aux_lu_get_str(lue, LU_GROUPNAME));
+ Cura_Group_Set_CommonName(&lg, aux_lu_get_str(lue, LU_GROUPNAME));
+ snprintf(instanceid, 255, ORGID":GID:%ld",
+ aux_lu_get_long(lue, LU_GIDNUMBER));
+ Cura_Group_Set_InstanceID(&lg, instanceid);
+ KReturnInstance(cr, lg);
+ lu_ent_free(lue);
+ } /* for */
+ free(instanceid);
+
+ if (groups)
+ {
+ g_ptr_array_free(groups, TRUE);
+ }
+
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_GroupGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_GroupCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_GroupModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_GroupDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_GroupExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Cura_Group,
+ Cura_Group,
+ _cb,
+ Cura_GroupInitialize())
+
+static CMPIStatus Cura_GroupMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_GroupInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Cura_Group_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Cura_Group,
+ Cura_Group,
+ _cb,
+ Cura_GroupInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_Group",
+ "Cura_Group",
+ "instance method")
diff --git a/src/account/Cura_HostedServiceProvider.c b/src/account/Cura_HostedServiceProvider.c
new file mode 100644
index 0000000..2e252e7
--- /dev/null
+++ b/src/account/Cura_HostedServiceProvider.c
@@ -0,0 +1,239 @@
+#include <konkret/konkret.h>
+#include "Cura_HostedService.h"
+#include "CIM_ComputerSystem.h"
+#include "Cura_AccountManagementService.h"
+
+#include "macros.h"
+#include "globals.h"
+
+static const CMPIBroker* _cb;
+
+static void Cura_HostedServiceInitialize()
+{
+}
+
+static CMPIStatus Cura_HostedServiceCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_HostedServiceEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_HostedServiceEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ CIM_ComputerSystemRef lcsref;
+ Cura_AccountManagementServiceRef lamsref;
+ Cura_HostedService lhs;
+
+ CMPIObjectPath *computerSystemOP = NULL;
+ CMPIStatus rc;
+
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+
+ CIM_ComputerSystemRef_Init(&lcsref, _cb, nameSpace);
+ CIM_ComputerSystemRef_Set_Name(&lcsref, hostname);
+ CIM_ComputerSystemRef_Set_CreationClassName(&lcsref,
+ get_system_creation_class_name());
+
+ computerSystemOP = CIM_ComputerSystemRef_ToObjectPath(&lcsref, &rc);
+ computerSystemOP->ft->setClassName(computerSystemOP,
+ get_system_creation_class_name());
+
+ Cura_AccountManagementServiceRef_Init(&lamsref, _cb, nameSpace);
+ Cura_AccountManagementServiceRef_Set_Name(&lamsref, LAMSNAME);
+ Cura_AccountManagementServiceRef_Set_SystemCreationClassName(&lamsref,
+ get_system_creation_class_name());
+ Cura_AccountManagementServiceRef_Set_SystemName(&lamsref, hostname);
+ Cura_AccountManagementServiceRef_Set_CreationClassName(&lamsref,
+ Cura_AccountManagementService_ClassName);
+
+ Cura_HostedService_Init(&lhs, _cb, nameSpace);
+ Cura_HostedService_SetObjectPath_Antecedent(&lhs, computerSystemOP);
+ Cura_HostedService_Set_Dependent(&lhs, &lamsref);
+
+ KReturnInstance(cr, lhs);
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_HostedServiceGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_HostedServiceCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_HostedServiceModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_HostedServiceDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_HostedServiceExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_HostedServiceAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_HostedServiceAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_HostedService_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_HostedServiceAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_HostedService_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_HostedServiceReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_HostedService_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_HostedServiceReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_HostedService_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_HostedService,
+ Cura_HostedService,
+ _cb,
+ Cura_HostedServiceInitialize())
+
+CMAssociationMIStub(
+ Cura_HostedService,
+ Cura_HostedService,
+ _cb,
+ Cura_HostedServiceInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_HostedService",
+ "Cura_HostedService",
+ "instance association")
diff --git a/src/account/Cura_IdentityProvider.c b/src/account/Cura_IdentityProvider.c
new file mode 100644
index 0000000..9277239
--- /dev/null
+++ b/src/account/Cura_IdentityProvider.c
@@ -0,0 +1,190 @@
+#include <konkret/konkret.h>
+#include "Cura_Identity.h"
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+#include "macros.h"
+#include "globals.h"
+#include "aux_lu.h"
+
+static const CMPIBroker* _cb = NULL;
+
+static void Cura_IdentityInitialize()
+{
+}
+
+static CMPIStatus Cura_IdentityCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_IdentityEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_IdentityEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_Identity li;
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *accounts = NULL;
+ struct lu_ent *lue = NULL;
+ char *instanceid = NULL;
+ unsigned int i = 0;
+ const char *nameSpace = KNameSpace(cop);
+
+ luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+
+ instanceid = malloc(256 * sizeof(char));
+
+ /* USERS */
+ accounts = lu_users_enumerate_full(luc, "*", &error);
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+ Cura_Identity_Init(&li, _cb, nameSpace);
+
+ /* Need to convert long int UID to the string */
+ snprintf(instanceid, 255, ORGID":UID:%ld",
+ aux_lu_get_long(lue, LU_UIDNUMBER));
+ Cura_Identity_Set_InstanceID(&li, instanceid);
+ Cura_Identity_Set_ElementName(&li, aux_lu_get_str(lue, LU_GECOS));
+ KReturnInstance(cr, li);
+ }
+
+ /* GOUPRS */
+ accounts = lu_groups_enumerate_full(luc, "*", &error);
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+ Cura_Identity_Init(&li, _cb, nameSpace);
+
+ /* Need to convert long int UID to the string */
+ snprintf(instanceid, 255, ORGID":GID:%ld",
+ aux_lu_get_long(lue, LU_GIDNUMBER));
+ Cura_Identity_Set_InstanceID(&li, instanceid);
+ Cura_Identity_Set_ElementName(&li, aux_lu_get_str(lue, LU_GROUPNAME));
+ KReturnInstance(cr, li);
+ lu_ent_free(lue);
+ }
+
+ free(instanceid);
+ if (accounts)
+ {
+ g_ptr_array_free(accounts, TRUE);
+ }
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_IdentityGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_IdentityCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_IdentityModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_IdentityDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_IdentityExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Cura_Identity,
+ Cura_Identity,
+ _cb,
+ Cura_IdentityInitialize())
+
+static CMPIStatus Cura_IdentityMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_IdentityInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Cura_Identity_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Cura_Identity,
+ Cura_Identity,
+ _cb,
+ Cura_IdentityInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_Identity",
+ "Cura_Identity",
+ "instance method")
diff --git a/src/account/Cura_MemberOfGroupProvider.c b/src/account/Cura_MemberOfGroupProvider.c
new file mode 100644
index 0000000..1190fb6
--- /dev/null
+++ b/src/account/Cura_MemberOfGroupProvider.c
@@ -0,0 +1,280 @@
+#include <konkret/konkret.h>
+#include "Cura_MemberOfGroup.h"
+#include "Cura_Group.h"
+#include "Cura_Identity.h"
+
+#include "aux_lu.h"
+#include "macros.h"
+#include "globals.h"
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+static const CMPIBroker* _cb;
+
+static void Cura_MemberOfGroupInitialize()
+{
+}
+
+static CMPIStatus Cura_MemberOfGroupCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_MemberOfGroupEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_MemberOfGroupEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_GroupRef lgref;
+ Cura_IdentityRef liref;
+ Cura_MemberOfGroup lmog;
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *groups = NULL;
+ GValueArray *accounts = NULL;
+ struct lu_ent *lueg = NULL;
+ struct lu_ent *luea = NULL;
+
+ size_t i, j;
+ const char *nameSpace = KNameSpace(cop);
+ char *uid = NULL;
+
+ luc = lu_start(NULL, 0, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+ uid = malloc(256 * sizeof(char));
+ /* Go through each group */
+ groups = lu_groups_enumerate_full(luc, "*", &error);
+ for (i = 0; (groups != NULL) && (i < groups->len); i++)
+ {
+ lueg = g_ptr_array_index(groups, i);
+ Cura_GroupRef_Init(&lgref, _cb, nameSpace);
+ Cura_GroupRef_Set_CreationClassName(&lgref, Cura_Group_ClassName);
+ Cura_GroupRef_Set_Name(&lgref, aux_lu_get_str(lueg, LU_GROUPNAME));
+
+ /* For each user in the group */
+ accounts = lu_users_enumerate_by_group(luc,
+ aux_lu_get_str(lueg, LU_GROUPNAME), &error);
+ for (j = 0; (accounts != NULL) && (j < accounts->n_values); j++)
+ {
+ luea = lu_ent_new();
+ lu_user_lookup_name(luc,
+ g_value_get_string(g_value_array_get_nth(accounts, j)),
+ luea, &error);
+ snprintf(uid, 255, ORGID":UID:%ld",
+ aux_lu_get_long(luea, LU_UIDNUMBER));
+ Cura_IdentityRef_Init(&liref, _cb, nameSpace);
+ Cura_IdentityRef_Set_InstanceID(&liref, uid);
+
+ Cura_MemberOfGroup_Init(&lmog, _cb, nameSpace);
+ Cura_MemberOfGroup_Set_Collection(&lmog, &lgref);
+ Cura_MemberOfGroup_Set_Member(&lmog, &liref);
+
+ KReturnInstance(cr, lmog);
+ lu_ent_free(luea);
+ } /* for users */
+ if (accounts)
+ {
+ g_value_array_free(accounts);
+ }
+
+
+ lu_ent_free(lueg);
+ } /* for groups */
+ free(uid);
+
+ if (groups)
+ {
+ g_ptr_array_free(groups, TRUE);
+ }
+
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_MemberOfGroupGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_MemberOfGroupCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_MemberOfGroupModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_MemberOfGroupDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_MemberOfGroupExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_MemberOfGroupAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_MemberOfGroupAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_MemberOfGroup_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_MemberOfGroupAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_MemberOfGroup_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_MemberOfGroupReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_MemberOfGroup_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_MemberOfGroupReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_MemberOfGroup_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_MemberOfGroup,
+ Cura_MemberOfGroup,
+ _cb,
+ Cura_MemberOfGroupInitialize())
+
+CMAssociationMIStub(
+ Cura_MemberOfGroup,
+ Cura_MemberOfGroup,
+ _cb,
+ Cura_MemberOfGroupInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_MemberOfGroup",
+ "Cura_MemberOfGroup",
+ "instance association")
diff --git a/src/account/Cura_OwningGroupProvider.c b/src/account/Cura_OwningGroupProvider.c
new file mode 100644
index 0000000..f4592f2
--- /dev/null
+++ b/src/account/Cura_OwningGroupProvider.c
@@ -0,0 +1,266 @@
+#include <konkret/konkret.h>
+#include "Cura_OwningGroup.h"
+#include "CIM_ComputerSystem.h"
+#include "Cura_Group.h"
+
+#include "macros.h"
+#include "globals.h"
+#include "aux_lu.h"
+
+#include <libuser/user.h>
+#include <libuser/entity.h>
+
+static const CMPIBroker* _cb;
+
+static void Cura_OwningGroupInitialize()
+{
+}
+
+static CMPIStatus Cura_OwningGroupCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_OwningGroupEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_OwningGroupEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ CIM_ComputerSystemRef lcsref;
+ Cura_GroupRef lgref;
+ Cura_OwningGroup log;
+
+ CMPIObjectPath *computerSystemOP = NULL;
+ CMPIStatus rc;
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *groups = NULL;
+ struct lu_ent *lue = NULL;
+
+ size_t i;
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+
+ CIM_ComputerSystemRef_Init(&lcsref, _cb, nameSpace);
+ CIM_ComputerSystemRef_Set_Name(&lcsref, hostname);
+ CIM_ComputerSystemRef_Set_CreationClassName(&lcsref,
+ get_system_creation_class_name());
+
+ computerSystemOP = CIM_ComputerSystemRef_ToObjectPath(&lcsref, &rc);
+ computerSystemOP->ft->setClassName(computerSystemOP,
+ get_system_creation_class_name());
+
+ luc = lu_start(NULL, lu_group, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+ groups = lu_groups_enumerate_full(luc, "*", &error);
+ for (i = 0; (groups != NULL) && (i < groups->len); i++)
+ {
+ lue = g_ptr_array_index(groups, i);
+
+ Cura_GroupRef_Init(&lgref, _cb, nameSpace);
+ Cura_GroupRef_Set_Name(&lgref, aux_lu_get_str(lue, LU_GROUPNAME));
+ Cura_GroupRef_Set_CreationClassName(&lgref, Cura_Group_ClassName);
+
+ Cura_OwningGroup_Init(&log, _cb, nameSpace);
+ Cura_OwningGroup_SetObjectPath_OwningElement(&log, computerSystemOP);
+ Cura_OwningGroup_Set_OwnedElement(&log, &lgref);
+
+ KReturnInstance(cr, log);
+ lu_ent_free(lue);
+ } /* for */
+
+ if (groups)
+ {
+ g_ptr_array_free(groups, TRUE);
+ }
+
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_OwningGroupGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_OwningGroupCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_OwningGroupModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_OwningGroupDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_OwningGroupExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_OwningGroupAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_OwningGroupAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_OwningGroup_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_OwningGroupAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_OwningGroup_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_OwningGroupReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_OwningGroup_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_OwningGroupReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_OwningGroup_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_OwningGroup,
+ Cura_OwningGroup,
+ _cb,
+ Cura_OwningGroupInitialize())
+
+CMAssociationMIStub(
+ Cura_OwningGroup,
+ Cura_OwningGroup,
+ _cb,
+ Cura_OwningGroupInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_OwningGroup",
+ "Cura_OwningGroup",
+ "instance association")
diff --git a/src/account/Cura_ServiceAffectsIdentityProvider.c b/src/account/Cura_ServiceAffectsIdentityProvider.c
new file mode 100644
index 0000000..c62be93
--- /dev/null
+++ b/src/account/Cura_ServiceAffectsIdentityProvider.c
@@ -0,0 +1,300 @@
+#include <konkret/konkret.h>
+#include "Cura_ServiceAffectsIdentity.h"
+#include "Cura_AccountManagementService.h"
+#include "Cura_Identity.h"
+
+#include "macros.h"
+#include "globals.h"
+#include "aux_lu.h"
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+static const CMPIBroker* _cb;
+
+static void Cura_ServiceAffectsIdentityInitialize()
+{
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Cura_IdentityRef liref;
+ Cura_AccountManagementServiceRef lamsref;
+ Cura_ServiceAffectsIdentity lsai;
+
+ struct lu_context *luc = NULL;
+ struct lu_error *error = NULL;
+ GPtrArray *accounts = NULL;
+ struct lu_ent *lue = NULL;
+ size_t i;
+ char *id = NULL;
+
+ const char *nameSpace = KNameSpace(cop);
+ const char *hostname = get_system_name();
+
+ Cura_AccountManagementServiceRef_Init(&lamsref, _cb, nameSpace);
+ Cura_AccountManagementServiceRef_Set_Name(&lamsref, LAMSNAME);
+ Cura_AccountManagementServiceRef_Set_SystemCreationClassName(&lamsref,
+ get_system_creation_class_name());
+ Cura_AccountManagementServiceRef_Set_SystemName(&lamsref, hostname);
+ Cura_AccountManagementServiceRef_Set_CreationClassName(&lamsref,
+ Cura_AccountManagementService_ClassName);
+
+ luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
+ if (!luc)
+ {
+ fprintf(stderr, "Error initializing: %s\n", lu_strerror(error));
+ exit(1);
+ }
+
+ id = malloc(256 * sizeof(char));
+
+ /* Go through every accounts first */
+ accounts = lu_users_enumerate_full(luc, "*", &error);
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+
+ Cura_IdentityRef_Init(&liref, _cb, nameSpace);
+ snprintf(id, 255, ORGID":UID:%ld",
+ aux_lu_get_long(lue, LU_UIDNUMBER));
+ Cura_IdentityRef_Set_InstanceID(&liref, id);
+
+ Cura_ServiceAffectsIdentity_Init(&lsai, _cb, nameSpace);
+ Cura_ServiceAffectsIdentity_Set_AffectedElement(&lsai, &liref);
+ Cura_ServiceAffectsIdentity_Set_AffectingElement(&lsai, &lamsref);
+ Cura_ServiceAffectsIdentity_Init_ElementEffects(&lsai, 1);
+ Cura_ServiceAffectsIdentity_Set_ElementEffects(&lsai, 0,
+ Cura_ServiceAffectsIdentity_ElementEffects_Manages);
+
+ KReturnInstance(cr, lsai);
+ lu_ent_free(lue);
+ } /* for accounts */
+
+ if (accounts)
+ {
+ g_ptr_array_free(accounts, TRUE);
+ }
+
+ /* Go through every groups */
+ accounts = lu_groups_enumerate_full(luc, "*", &error);
+ for (i = 0; (accounts != NULL) && (i < accounts->len); i++)
+ {
+ lue = g_ptr_array_index(accounts, i);
+
+ Cura_IdentityRef_Init(&liref, _cb, nameSpace);
+ snprintf(id, 255, ORGID":GID:%ld",
+ aux_lu_get_long(lue, LU_GIDNUMBER));
+ Cura_IdentityRef_Set_InstanceID(&liref, id);
+
+ Cura_ServiceAffectsIdentity_Init(&lsai, _cb, nameSpace);
+ Cura_ServiceAffectsIdentity_Set_AffectedElement(&lsai, &liref);
+ Cura_ServiceAffectsIdentity_Set_AffectingElement(&lsai, &lamsref);
+ Cura_ServiceAffectsIdentity_Init_ElementEffects(&lsai, 1);
+ Cura_ServiceAffectsIdentity_Set_ElementEffects(&lsai, 0,
+ Cura_ServiceAffectsIdentity_ElementEffects_Manages);
+
+ KReturnInstance(cr, lsai);
+
+ lu_ent_free(lue);
+ } /* for accounts */
+
+ if (accounts)
+ {
+ g_ptr_array_free(accounts, TRUE);
+ }
+
+ free(id);
+ lu_end(luc);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ServiceAffectsIdentity_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ServiceAffectsIdentity_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ServiceAffectsIdentity_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_ServiceAffectsIdentityReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_ServiceAffectsIdentity_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_ServiceAffectsIdentity,
+ Cura_ServiceAffectsIdentity,
+ _cb,
+ Cura_ServiceAffectsIdentityInitialize())
+
+CMAssociationMIStub(
+ Cura_ServiceAffectsIdentity,
+ Cura_ServiceAffectsIdentity,
+ _cb,
+ Cura_ServiceAffectsIdentityInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_ServiceAffectsIdentity",
+ "Cura_ServiceAffectsIdentity",
+ "instance association")
diff --git a/src/account/Cura_SettingsDefineAccountCapabilitiesProvider.c b/src/account/Cura_SettingsDefineAccountCapabilitiesProvider.c
new file mode 100644
index 0000000..a1f1563
--- /dev/null
+++ b/src/account/Cura_SettingsDefineAccountCapabilitiesProvider.c
@@ -0,0 +1,202 @@
+#include <konkret/konkret.h>
+#include "Cura_SettingsDefineAccountCapabilities.h"
+
+static const CMPIBroker* _cb;
+
+static void Cura_SettingsDefineAccountCapabilitiesInitialize()
+{
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineAccountCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineAccountCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineAccountCapabilities_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_SettingsDefineAccountCapabilitiesReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineAccountCapabilities_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_SettingsDefineAccountCapabilities,
+ Cura_SettingsDefineAccountCapabilities,
+ _cb,
+ Cura_SettingsDefineAccountCapabilitiesInitialize())
+
+CMAssociationMIStub(
+ Cura_SettingsDefineAccountCapabilities,
+ Cura_SettingsDefineAccountCapabilities,
+ _cb,
+ Cura_SettingsDefineAccountCapabilitiesInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_SettingsDefineAccountCapabilities",
+ "Cura_SettingsDefineAccountCapabilities",
+ "instance association")
diff --git a/src/account/Cura_SettingsDefineManagementCapabilitiesProvider.c b/src/account/Cura_SettingsDefineManagementCapabilitiesProvider.c
new file mode 100644
index 0000000..bd89874
--- /dev/null
+++ b/src/account/Cura_SettingsDefineManagementCapabilitiesProvider.c
@@ -0,0 +1,202 @@
+#include <konkret/konkret.h>
+#include "Cura_SettingsDefineManagementCapabilities.h"
+
+static const CMPIBroker* _cb;
+
+static void Cura_SettingsDefineManagementCapabilitiesInitialize()
+{
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineManagementCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineManagementCapabilities_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineManagementCapabilities_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus Cura_SettingsDefineManagementCapabilitiesReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Cura_SettingsDefineManagementCapabilities_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Cura_SettingsDefineManagementCapabilities,
+ Cura_SettingsDefineManagementCapabilities,
+ _cb,
+ Cura_SettingsDefineManagementCapabilitiesInitialize())
+
+CMAssociationMIStub(
+ Cura_SettingsDefineManagementCapabilities,
+ Cura_SettingsDefineManagementCapabilities,
+ _cb,
+ Cura_SettingsDefineManagementCapabilitiesInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "Cura_SettingsDefineManagementCapabilities",
+ "Cura_SettingsDefineManagementCapabilities",
+ "instance association")
diff --git a/src/account/aux_lu.c b/src/account/aux_lu.c
new file mode 100644
index 0000000..2907214
--- /dev/null
+++ b/src/account/aux_lu.c
@@ -0,0 +1,22 @@
+#include "aux_lu.h"
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+/*
+ * Get the value of type from the given entity
+ * returns string
+ */
+char* aux_lu_get_str(struct lu_ent* ent, char* type)
+{
+ return g_value_get_string(g_value_array_get_nth(lu_ent_get(ent, type), 0));
+}
+
+/*
+ * Get the value of type from the given entity
+ * returns long int
+ */
+long aux_lu_get_long(struct lu_ent* ent, char* type)
+{
+ return g_value_get_long(g_value_array_get_nth(lu_ent_get(ent, type), 0));
+}
+
diff --git a/src/account/aux_lu.h b/src/account/aux_lu.h
new file mode 100644
index 0000000..c9fd771
--- /dev/null
+++ b/src/account/aux_lu.h
@@ -0,0 +1,9 @@
+#ifndef AUX_LU_H
+#define AUX_LU_H
+
+#include <libuser/entity.h>
+#include <libuser/user.h>
+
+char* aux_lu_get_str(struct lu_ent*, char*);
+long aux_lu_get_long(struct lu_ent*, char*);
+#endif
diff --git a/src/account/macros.h b/src/account/macros.h
new file mode 100644
index 0000000..5cedfdb
--- /dev/null
+++ b/src/account/macros.h
@@ -0,0 +1,15 @@
+#ifndef MACROS_H
+#define MACROS_H
+
+/* Few global names of instances */
+#define LAMSNAME "Cura Linux Users Account Management Service"
+#define LAMCNAME "Cura Linux Users Account Management Capabilities"
+#define LEACNAME "Cura Linux Account Capabilities"
+
+/* Organization ID. Used for InstaceIDs */
+#define ORGID "Red Hat"
+
+/* convert days to microseconds */
+#define DAYSTOMS(days) ((days) * 86400000000)
+
+#endif