summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-09-09 16:25:31 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-09-15 11:46:33 -0400
commitb0f08fe9d94f5bc6ec0c749f2b78d3f0d95cf5af (patch)
tree36d8c939f6034ac67b101654ea3e23a984153c79 /src/db
parent6480abbd1bba71efa8a834fada6505d1767fabfc (diff)
downloadsssd-b0f08fe9d94f5bc6ec0c749f2b78d3f0d95cf5af.tar.gz
sssd-b0f08fe9d94f5bc6ec0c749f2b78d3f0d95cf5af.tar.xz
sssd-b0f08fe9d94f5bc6ec0c749f2b78d3f0d95cf5af.zip
Define objectclass with a constant
Use a #define instead of hardcoded string
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.h3
-rw-r--r--src/db/sysdb_ops.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index e199ed94..d8a78bad 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -43,6 +43,7 @@
#define SYSDB_GROUP_CLASS "group"
#define SYSDB_NAME "name"
+#define SYSDB_OBJECTCLASS "objectClass"
#define SYSDB_NEXTID "nextID"
#define SYSDB_UIDNUM "uidNumber"
@@ -112,7 +113,7 @@
#define SYSDB_DEFAULT_ATTRS SYSDB_LAST_UPDATE, \
SYSDB_CACHE_EXPIRE, \
SYSDB_INITGR_EXPIRE, \
- "objectClass"
+ SYSDB_OBJECTCLASS
#define SYSDB_PW_ATTRS {SYSDB_NAME, SYSDB_UIDNUM, \
SYSDB_GIDNUM, SYSDB_GECOS, \
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 017f8ebc..f0900286 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -655,7 +655,7 @@ int sysdb_add_basic_user(TALLOC_CTX *mem_ctx,
ERROR_OUT(ret, ENOMEM, done);
}
- ret = add_string(msg, LDB_FLAG_MOD_ADD, "objectClass", SYSDB_USER_CLASS);
+ ret = add_string(msg, LDB_FLAG_MOD_ADD, SYSDB_OBJECTCLASS, SYSDB_USER_CLASS);
if (ret) goto done;
ret = add_string(msg, LDB_FLAG_MOD_ADD, SYSDB_NAME, name);
@@ -866,7 +866,7 @@ int sysdb_add_basic_group(TALLOC_CTX *mem_ctx,
ERROR_OUT(ret, ENOMEM, done);
}
- ret = add_string(msg, LDB_FLAG_MOD_ADD, "objectClass", SYSDB_GROUP_CLASS);
+ ret = add_string(msg, LDB_FLAG_MOD_ADD, SYSDB_OBJECTCLASS, SYSDB_GROUP_CLASS);
if (ret) goto done;
ret = add_string(msg, LDB_FLAG_MOD_ADD, SYSDB_NAME, name);