From b0f08fe9d94f5bc6ec0c749f2b78d3f0d95cf5af Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 9 Sep 2010 16:25:31 +0200 Subject: Define objectclass with a constant Use a #define instead of hardcoded string --- src/db/sysdb.h | 3 ++- src/db/sysdb_ops.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/db') 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); -- cgit