- diff --git a/daemon/idmap.c b/daemon/idmap.c
- index 0dfa8ef..9ae7e8c 100644
- --- a/daemon/idmap.c
- +++ b/daemon/idmap.c
- @@ -668,7 +668,7 @@ static int idmap_lookup_user(
- if (time(NULL) - user->last_updated < context->config.cache_ttl)
- goto out;
- }
- -
- +#if 0
- /* send the query to the ldap server */
- status = idmap_query_attrs(context, lookup,
- attributes, optional, values, NUM_ATTRIBUTES);
- @@ -705,7 +705,61 @@ static int idmap_lookup_user(
- goto out_free_values;
- }
- user->last_updated = time(NULL);
- -
- +#else
- + if (
- + ((lookup->attr == ATTR_USER_NAME) && (!_stricmp(lookup->value, "test001"))) ||
- + ((lookup->attr == ATTR_PRINCIPAL) && (!_stricmp(lookup->value, "test001@GLOBAL.LOC"))) ||
- + ((lookup->attr == ATTR_UID) && (((uid_t)(lookup->value)) == 1000))
- + ) {
- + StringCchCopyA(user->username, VAL_LEN, "test001");
- + StringCchCopyA(user->principal, VAL_LEN, "test001@GLOBAL.LOC");
- + user->uid = 1000;
- + user->gid = 1000;
- + eprintf("# user: test001\n");
- + status = 0;
- + } else if (
- + ((lookup->attr == ATTR_USER_NAME) && (!_stricmp(lookup->value, "root"))) ||
- + ((lookup->attr == ATTR_PRINCIPAL) && (!_stricmp(lookup->value, "root@GLOBAL.LOC"))) ||
- + ((lookup->attr == ATTR_UID) && (((uid_t)(lookup->value)) == 0))
- + ) {
- + StringCchCopyA(user->username, VAL_LEN, "root");
- + StringCchCopyA(user->principal, VAL_LEN, "root@GLOBAL.LOC");
- + user->uid = 0;
- + user->gid = 0;
- + eprintf("# user: root\n");
- + status = 0;
- + } else if (
- + ((lookup->attr == ATTR_USER_NAME) && (!_stricmp(lookup->value, "rmainz"))) ||
- + ((lookup->attr == ATTR_PRINCIPAL) && (!_stricmp(lookup->value, "rmainz@GLOBAL.LOC"))) ||
- + ((lookup->attr == ATTR_UID) && (((uid_t)(lookup->value)) == 1616))
- + ) {
- + StringCchCopyA(user->username, VAL_LEN, "rmainz");
- + StringCchCopyA(user->principal, VAL_LEN, "rmainz@GLOBAL.LOC");
- + user->uid = 1616;
- + user->gid = 1616;
- + eprintf("# user: rmainz\n");
- + status = 0;
- + } else if (
- + ((lookup->attr == ATTR_USER_NAME) && (!_stricmp(lookup->value, "roland_mainz"))) ||
- + ((lookup->attr == ATTR_PRINCIPAL) && (!_stricmp(lookup->value, "roland_mainz@GLOBAL.LOC"))) ||
- + ((lookup->attr == ATTR_UID) && (((uid_t)(lookup->value)) == 197608))
- + ) {
- + StringCchCopyA(user->username, VAL_LEN, "roland_mainz");
- + StringCchCopyA(user->principal, VAL_LEN, "roland_mainz@GLOBAL.LOC");
- + user->uid = 197608;
- + user->gid = 197608;
- + eprintf("# user: roland_mainz\n");
- + status = 0;
- + }
- + else
- + {
- + status = ERROR_NOT_FOUND;
- + }
- +
- + if (status == 0) {
- + user->last_updated = time(NULL);
- + }
- +#endif
- if (context->config.cache_ttl) {
- /* insert the entry into the cache */
- cache_insert(&context->users, lookup, &user->entry);
- @@ -735,7 +789,7 @@ static int idmap_lookup_group(
- if (time(NULL) - group->last_updated < context->config.cache_ttl)
- goto out;
- }
- -
- +#if 0
- /* send the query to the ldap server */
- status = idmap_query_attrs(context, lookup,
- attributes, 0, values, NUM_ATTRIBUTES);
- @@ -758,7 +812,49 @@ static int idmap_lookup_group(
- goto out_free_values;
- }
- group->last_updated = time(NULL);
- +#else
- + if (
- + ((lookup->attr == ATTR_GROUP_NAME) && (!_stricmp(lookup->value, "test001"))) ||
- + ((lookup->attr == ATTR_GID) && (((uid_t)(lookup->value)) == 1000))
- + ) {
- + StringCchCopyA(group->name, VAL_LEN, "test001");
- + group->gid = 1000;
- + eprintf("# group: test001\n");
- + status = 0;
- + } else if (
- + ((lookup->attr == ATTR_GROUP_NAME) && (!_stricmp(lookup->value, "root"))) ||
- + ((lookup->attr == ATTR_GID) && (((uid_t)(lookup->value)) == 0))
- + ) {
- + StringCchCopyA(group->name, VAL_LEN, "root");
- + group->gid = 0;
- + eprintf("# group: root\n");
- + status = 0;
- + } else if (
- + ((lookup->attr == ATTR_GROUP_NAME) && (!_stricmp(lookup->value, "rmainz"))) ||
- + ((lookup->attr == ATTR_GID) && (((uid_t)(lookup->value)) == 1616))
- + ) {
- + StringCchCopyA(group->name, VAL_LEN, "rmainz");
- + group->gid = 1616;
- + eprintf("# group: rmainz\n");
- + status = 0;
- + } else if (
- + ((lookup->attr == ATTR_GROUP_NAME) && (!_stricmp(lookup->value, "Kein"))) ||
- + ((lookup->attr == ATTR_GID) && (((uid_t)(lookup->value)) == 197121))
- + ) {
- + StringCchCopyA(group->name, VAL_LEN, "Kein");
- + group->gid = 197121;
- + eprintf("# group: Kein\n");
- + status = 0;
- + }
- + else
- + {
- + status = ERROR_NOT_FOUND;
- + }
- + if (status == 0) {
- + group->last_updated = time(NULL);
- + }
- +#endif
- if (context->config.cache_ttl) {
- /* insert the entry into the cache */
- cache_insert(&context->groups, lookup, &group->entry);
- @@ -788,6 +884,7 @@ int nfs41_idmap_create(
- cache_init(&context->users, &user_cache_ops);
- cache_init(&context->groups, &group_cache_ops);
- +#if 0
- /* load ldap configuration from file */
- status = config_init(&context->config);
- if (status) {
- @@ -824,6 +921,7 @@ int nfs41_idmap_create(
- goto out_err_free;
- }
- }
- +#endif
- *context_out = context;
- out:
nfsv41: Static userinfo test1
Posted by Anonymous on Thu 14th Sep 2023 09:22
raw | new post
view followups (newest first): msnfs41_client: idmap support with Cygwin getent passwd/group prototype by Anonymous
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.