summaryrefslogtreecommitdiffstats
path: root/src/account
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2013-07-25 10:11:50 +0200
committerRadek Novacek <rnovacek@redhat.com>2013-07-25 10:11:50 +0200
commit3c7dbda737bdbd6bbd46fe8f06afb9954c19a548 (patch)
tree4bb093207aba4a17fd487ccb26260e2de38e82d6 /src/account
parentc5767ebb8f72494bd422636cea462c41679e7f69 (diff)
downloadopenlmi-providers-3c7dbda737bdbd6bbd46fe8f06afb9954c19a548.tar.gz
openlmi-providers-3c7dbda737bdbd6bbd46fe8f06afb9954c19a548.tar.xz
openlmi-providers-3c7dbda737bdbd6bbd46fe8f06afb9954c19a548.zip
Silence many compilation warnings
Mostly deprecation warnings and wrong 'const' handling.
Diffstat (limited to 'src/account')
-rw-r--r--src/account/LMI_AccountManagementServiceProvider.c9
-rw-r--r--src/account/LMI_AccountProvider.c4
-rw-r--r--src/account/LMI_MemberOfGroupProvider.c6
-rw-r--r--src/account/aux_lu.c2
-rw-r--r--src/account/aux_lu.h5
5 files changed, 16 insertions, 10 deletions
diff --git a/src/account/LMI_AccountManagementServiceProvider.c b/src/account/LMI_AccountManagementServiceProvider.c
index b01f5a3..5995c11 100644
--- a/src/account/LMI_AccountManagementServiceProvider.c
+++ b/src/account/LMI_AccountManagementServiceProvider.c
@@ -233,7 +233,8 @@ KUint32 LMI_AccountManagementService_CreateGroup(
struct lu_error *error = NULL;
struct lu_ent *lue = NULL;
GValue value;
- const char *nameSpace = LMI_AccountManagementServiceRef_NameSpace(self);
+ const char *nameSpace = LMI_AccountManagementServiceRef_NameSpace(
+ (LMI_AccountManagementServiceRef *) self);
CMPIEnumeration *instances = NULL;
LMI_GroupRef Groupref;
LMI_IdentityRef Identityref;
@@ -357,9 +358,11 @@ KUint32 LMI_AccountManagementService_CreateAccount(
GValue val;
int create_group = 0;
gid_t gid = LU_VALUE_INVALID_ID, uid = LU_VALUE_INVALID_ID;
- char *group_name = NULL, *home = NULL, *instanceid = NULL;
+ char *group_name = NULL, *instanceid = NULL;
+ const char *home = NULL;
- const char *nameSpace = LMI_AccountManagementServiceRef_NameSpace(self);
+ const char *nameSpace = LMI_AccountManagementServiceRef_NameSpace(
+ (LMI_AccountManagementServiceRef *) self);
const char *hostname = get_system_name();
CMPIStatus st;
CMPIEnumeration *instances = NULL;
diff --git a/src/account/LMI_AccountProvider.c b/src/account/LMI_AccountProvider.c
index d7b0dac..9727923 100644
--- a/src/account/LMI_AccountProvider.c
+++ b/src/account/LMI_AccountProvider.c
@@ -84,7 +84,7 @@ static CMPIStatus LMI_AccountEnumInstances(
long last_change, min_lifetime, max_lifetime, warn, inactive, expire;
time_t last_login;
CMPIStatus *rc = NULL;
- char *password = NULL;
+ const char *password = NULL;
luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error);
if (!luc)
@@ -238,7 +238,7 @@ static CMPIStatus LMI_AccountModifyInstance(
* Set up account expiration
* Set up password expiration
*/
- char* value = NULL, *password = NULL;
+ const char* value = NULL, *password = NULL;
CMPIString* vs = NULL;
CMPIArray* ar = NULL; int arsize;/* used for password */
CMPIData data;
diff --git a/src/account/LMI_MemberOfGroupProvider.c b/src/account/LMI_MemberOfGroupProvider.c
index beb5edd..60259b8 100644
--- a/src/account/LMI_MemberOfGroupProvider.c
+++ b/src/account/LMI_MemberOfGroupProvider.c
@@ -159,8 +159,8 @@ static CMPIStatus LMI_MemberOfGroupCreateInstance(
LMI_MemberOfGroup lmog;
LMI_Account la;
- char *group_name = NULL;
- char *user_name = NULL;
+ const char *group_name = NULL;
+ const char *user_name = NULL;
GValue val;
struct lu_context *luc = NULL;
@@ -246,7 +246,7 @@ static CMPIStatus LMI_MemberOfGroupDeleteInstance(
struct lu_ent *lue_u = lu_ent_new();
struct lu_error *error = NULL;
- char *group_name = NULL;
+ const char *group_name = NULL;
uid_t user_id = -1;
GValueArray *groups = NULL;
unsigned int i = 0; /* iterator */
diff --git a/src/account/aux_lu.c b/src/account/aux_lu.c
index 6059665..3b9f047 100644
--- a/src/account/aux_lu.c
+++ b/src/account/aux_lu.c
@@ -28,7 +28,7 @@
* Get the value of type from the given entity
* returns string
*/
-char* aux_lu_get_str(struct lu_ent* ent, char* type)
+const 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));
}
diff --git a/src/account/aux_lu.h b/src/account/aux_lu.h
index 91383d4..338adef 100644
--- a/src/account/aux_lu.h
+++ b/src/account/aux_lu.h
@@ -21,10 +21,13 @@
#ifndef AUX_LU_H
#define AUX_LU_H
+// for GValueArray
+#define GLIB_DISABLE_DEPRECATION_WARNINGS
+
#include <libuser/entity.h>
#include <libuser/user.h>
-char* aux_lu_get_str(struct lu_ent*, char*);
+const char* aux_lu_get_str(struct lu_ent*, char*);
long aux_lu_get_long(struct lu_ent*, char*);
/* Get the latest login time for given user name */