changeset 10648:fd73c9d70fde

6884443 idmap in-kernel API does not save sid_prefix strings
author Gordon Ross <Gordon.Ross@Sun.COM>
date Fri, 25 Sep 2009 12:11:50 -0400
parents d0c1a4172256
children ab3ce9d83b84
files usr/src/uts/common/idmap/idmap_kapi.c
diffstat 1 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/idmap/idmap_kapi.c	Fri Sep 25 13:18:26 2009 +0800
+++ b/usr/src/uts/common/idmap/idmap_kapi.c	Fri Sep 25 12:11:50 2009 -0400
@@ -890,7 +890,9 @@
  * stat - status of the get request
  * uid  - POSIX UID if stat == IDMAP_SUCCESS
  *
- * Note: The output parameters will be set by idmap_get_mappings()
+ * Notes:
+ * The output parameters will be set by idmap_get_mappings()
+ * The sid_prefix is copied.
  */
 idmap_stat
 kidmap_batch_getuidbysid(idmap_get_handle_t *get_handle, const char *sid_prefix,
@@ -909,6 +911,9 @@
 		return (IDMAP_SUCCESS);
 	}
 
+	/* Get a copy of sid_prefix */
+	sid_prefix = kidmap_find_sid_prefix(sid_prefix);
+
 	if (get_handle->mapping_num >= get_handle->mapping_size)
 		kidmap_get_extend(get_handle);
 
@@ -946,7 +951,9 @@
  * stat - status of the get request
  * gid  - POSIX GID if stat == IDMAP_SUCCESS
  *
- * Note: The output parameters will be set by idmap_get_mappings()
+ * Notes:
+ * The output parameters will be set by idmap_get_mappings()
+ * The sid_prefix is copied.
  */
 idmap_stat
 kidmap_batch_getgidbysid(idmap_get_handle_t *get_handle, const char *sid_prefix,
@@ -965,6 +972,9 @@
 		return (IDMAP_SUCCESS);
 	}
 
+	/* Get a copy of sid_prefix */
+	sid_prefix = kidmap_find_sid_prefix(sid_prefix);
+
 	if (get_handle->mapping_num >= get_handle->mapping_size)
 		kidmap_get_extend(get_handle);
 
@@ -1004,7 +1014,9 @@
  * pid     - POSIX UID if stat == IDMAP_SUCCESS and is_user == 1
  *           POSIX GID if stat == IDMAP_SUCCESS and is_user == 0
  *
- * Note: The output parameters will be set by idmap_get_mappings()
+ * Notes:
+ * The output parameters will be set by idmap_get_mappings()
+ * The sid_prefix is copied.
  */
 idmap_stat
 kidmap_batch_getpidbysid(idmap_get_handle_t *get_handle, const char *sid_prefix,
@@ -1023,6 +1035,8 @@
 		return (IDMAP_SUCCESS);
 	}
 
+	/* Get a copy of sid_prefix */
+	sid_prefix = kidmap_find_sid_prefix(sid_prefix);
 
 	if (get_handle->mapping_num >= get_handle->mapping_size)
 		kidmap_get_extend(get_handle);