2 * Copyright (c) 2001-2002 International Business Machines Corp.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
9 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
11 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
12 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
13 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
14 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
15 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
16 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
17 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
18 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 #include "org_openafs_jafs_Group.h"
26 #include <afs_ptsAdmin.h>
27 #include <afs_AdminPtsErrors.h>
28 #include <afs_AdminClientErrors.h>
29 #include <afs_AdminCommonErrors.h>
32 ///// definitions in Internal.c ///////////////
34 extern jclass userCls;
35 //extern jfieldID user_cellHandleField;
36 extern jfieldID user_nameField;
37 extern jfieldID user_cachedInfoField;
39 extern jclass groupCls;
40 extern jfieldID group_nameField;
41 extern jfieldID group_nameUidField;
42 extern jfieldID group_ownerUidField;
43 extern jfieldID group_creatorUidField;
44 extern jfieldID group_listStatusField;
45 extern jfieldID group_listGroupsOwnedField;
46 extern jfieldID group_listMembershipField;
47 extern jfieldID group_listAddField;
48 extern jfieldID group_listDeleteField;
49 extern jfieldID group_membershipCountField;
50 extern jfieldID group_ownerField;
51 extern jfieldID group_creatorField;
53 //////////////////////////////////////////////////////
57 * Creates the PTS entry for a new group. Pass in 0 for the uid if PTS is to
58 * automatically assign the group id.
60 * env the Java environment
61 * cls the current Java class
62 * cellHandle the handle of the cell to which the group belongs
63 * jgroupName the name of the group to create
64 * jownerName the owner of this group
65 * gid the group id to assign to the group (0 to have one
66 * automatically assigned)
68 JNIEXPORT void JNICALL
69 Java_org_openafs_jafs_Group_create
70 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jgroupName,
71 jstring jownerName, jint gid )
74 // convert java strings
75 const char *groupName;
76 const char *ownerName;
78 if( jgroupName != NULL ) {
79 groupName = (*env)->GetStringUTFChars(env, jgroupName, 0);
81 throwAFSException( env, JAFSADMNOMEM );
88 if( jownerName != NULL ) {
89 ownerName = (*env)->GetStringUTFChars(env, jownerName, 0);
91 throwAFSException( env, JAFSADMNOMEM );
98 // make sure the name is within the allowed bounds
99 if( groupName != NULL && strlen( groupName ) > PTS_MAX_NAME_LEN ) {
100 // release converted java strings
101 if( groupName != NULL ) {
102 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
104 if( ownerName != NULL ) {
105 (*env)->ReleaseStringUTFChars(env, jownerName, ownerName);
107 throwAFSException( env, ADMPTSGROUPNAMETOOLONG );
111 if( !pts_GroupCreate( (void *) cellHandle, groupName, ownerName,
112 (int *) &gid, &ast ) ) {
113 // release converted java strings
114 if( groupName != NULL ) {
115 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
117 if( ownerName != NULL ) {
118 (*env)->ReleaseStringUTFChars(env, jownerName, ownerName);
120 throwAFSException( env, ast );
124 // release converted java strings
125 if( groupName != NULL ) {
126 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
128 if( ownerName != NULL ) {
129 (*env)->ReleaseStringUTFChars(env, jownerName, ownerName);
135 * Deletes the PTS entry for a group. Deletes this group from the
136 * membership list of the users that belonged to it, but does not delete
137 * the groups owned by this group.
139 * env the Java environment
140 * cls the current Java class
141 * cellHandle the handle of the cell to which the group belongs
142 * jgroupName the name of the group to delete
144 JNIEXPORT void JNICALL
145 Java_org_openafs_jafs_Group_delete
146 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jgroupName )
149 // convert java strings
150 const char *groupName;
152 if( jgroupName != NULL ) {
153 groupName = (*env)->GetStringUTFChars(env, jgroupName, 0);
155 throwAFSException( env, JAFSADMNOMEM );
162 if( !pts_GroupDelete( (void *) cellHandle, groupName, &ast ) ) {
163 if( groupName != NULL ) {
164 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
166 throwAFSException( env, ast );
170 // release converted java strings
171 if( groupName != NULL ) {
172 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
178 * Retrieve the information for the specified group and populate the
181 * env the Java environment
182 * cellHandle the handle of the cell to which the user belongs
183 * name the name of the group for which to get the info
184 * group the Group object to populate with the info
186 void getGroupInfoChar
187 ( JNIEnv *env, void *cellHandle, const char *name, jobject group )
192 pts_GroupEntry_t entry;
195 // get the field ids if you haven't already
196 if( groupCls == 0 ) {
197 internal_getGroupClass( env, group );
199 if ( !pts_GroupGet( cellHandle, name, &entry, &ast ) ) {
200 throwAFSException( env, ast );
205 (*env)->SetIntField(env, group, group_nameUidField, entry.nameUid);
206 (*env)->SetIntField(env, group, group_ownerUidField, entry.ownerUid);
207 (*env)->SetIntField(env, group, group_creatorUidField, entry.creatorUid);
208 (*env)->SetIntField(env, group, group_membershipCountField,
209 entry.membershipCount);
211 if( entry.listStatus == PTS_GROUP_OWNER_ACCESS ) {
212 (*env)->SetIntField(env, group, group_listStatusField,
213 org_openafs_jafs_Group_GROUP_OWNER_ACCESS);
214 } else if( entry.listStatus == PTS_GROUP_ACCESS ) {
215 (*env)->SetIntField(env, group, group_listStatusField,
216 org_openafs_jafs_Group_GROUP_GROUP_ACCESS);
218 (*env)->SetIntField(env, group, group_listStatusField,
219 org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS);
222 if( entry.listGroupsOwned == PTS_GROUP_OWNER_ACCESS ) {
223 (*env)->SetIntField(env, group, group_listGroupsOwnedField,
224 org_openafs_jafs_Group_GROUP_OWNER_ACCESS);
225 } else if( entry.listGroupsOwned == PTS_GROUP_ACCESS ) {
226 (*env)->SetIntField(env, group, group_listGroupsOwnedField,
227 org_openafs_jafs_Group_GROUP_GROUP_ACCESS);
229 (*env)->SetIntField(env, group, group_listGroupsOwnedField,
230 org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS);
233 if( entry.listMembership == PTS_GROUP_OWNER_ACCESS ) {
234 (*env)->SetIntField(env, group, group_listMembershipField,
235 org_openafs_jafs_Group_GROUP_OWNER_ACCESS);
236 } else if( entry.listMembership == PTS_GROUP_ACCESS ) {
237 (*env)->SetIntField(env, group, group_listMembershipField,
238 org_openafs_jafs_Group_GROUP_GROUP_ACCESS);
240 (*env)->SetIntField(env, group, group_listMembershipField,
241 org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS);
244 if( entry.listAdd == PTS_GROUP_OWNER_ACCESS ) {
245 (*env)->SetIntField(env, group, group_listAddField,
246 org_openafs_jafs_Group_GROUP_OWNER_ACCESS);
247 } else if( entry.listAdd == PTS_GROUP_ACCESS ) {
248 (*env)->SetIntField(env, group, group_listAddField,
249 org_openafs_jafs_Group_GROUP_GROUP_ACCESS);
251 (*env)->SetIntField(env, group, group_listAddField,
252 org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS);
255 if( entry.listDelete == PTS_GROUP_OWNER_ACCESS ) {
256 (*env)->SetIntField(env, group, group_listDeleteField,
257 org_openafs_jafs_Group_GROUP_OWNER_ACCESS);
258 } else if( entry.listDelete == PTS_GROUP_ACCESS ) {
259 (*env)->SetIntField(env, group, group_listDeleteField,
260 org_openafs_jafs_Group_GROUP_GROUP_ACCESS);
262 (*env)->SetIntField(env, group, group_listDeleteField,
263 org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS);
266 jowner = (*env)->NewStringUTF(env, entry.owner);
267 jcreator = (*env)->NewStringUTF(env, entry.creator);
269 (*env)->SetObjectField(env, group, group_ownerField, jowner);
270 (*env)->SetObjectField(env, group, group_creatorField, jcreator);
275 * Fills in the information fields of the provided Group.
276 * Fills in values based on the current PTS information of the group.
278 * env the Java environment
279 * cls the current Java class
280 * cellHandle the handle of the cell to which the group belongs
281 * name the name of the group for which to get the information
282 * group the Group object in which to fill in the
285 JNIEXPORT void JNICALL
286 Java_org_openafs_jafs_Group_getGroupInfo
287 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jname, jobject group)
292 if( jname != NULL ) {
293 name = (*env)->GetStringUTFChars(env, jname, 0);
295 throwAFSException( env, JAFSADMNOMEM );
301 getGroupInfoChar( env, (void *)cellHandle, name, group );
303 // get class fields if need be
304 if( groupCls == 0 ) {
305 internal_getGroupClass( env, group );
308 // set name in case blank object
309 (*env)->SetObjectField(env, group, group_nameField, jname);
312 (*env)->ReleaseStringUTFChars(env, jname, name);
318 * Sets the information values of this AFS group to be the parameter values.
320 * env the Java environment
321 * cls the current Java class
322 * cellHandle the handle of the cell to which the user belongs
323 * name the name of the user for which to set the information
324 * theGroup the group object containing the desired information
326 JNIEXPORT void JNICALL
327 Java_org_openafs_jafs_Group_setGroupInfo
328 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jname, jobject group)
331 pts_GroupUpdateEntry_t ptsEntry;
335 jint jlistGroupsOwned;
336 jint jlistMembership;
340 // get the field ids if you haven't already
341 if( groupCls == 0 ) {
342 internal_getGroupClass( env, group );
345 jlistStatus = (*env)->GetIntField(env, group, group_listStatusField);
346 jlistGroupsOwned = (*env)->GetIntField(env, group,
347 group_listGroupsOwnedField);
348 jlistMembership = (*env)->GetIntField(env, group, group_listMembershipField);
349 jlistAdd = (*env)->GetIntField(env, group, group_listAddField);
350 jlistDelete = (*env)->GetIntField(env, group, group_listDeleteField);
352 if( jname != NULL ) {
353 name = (*env)->GetStringUTFChars(env, jname, 0);
355 throwAFSException( env, JAFSADMNOMEM );
362 if( jlistStatus == org_openafs_jafs_Group_GROUP_OWNER_ACCESS ) {
363 ptsEntry.listStatus = PTS_GROUP_OWNER_ACCESS;
364 } else if( jlistStatus == org_openafs_jafs_Group_GROUP_GROUP_ACCESS ) {
365 ptsEntry.listStatus = PTS_GROUP_ACCESS;
367 ptsEntry.listStatus = PTS_GROUP_ANYUSER_ACCESS;
369 if( jlistGroupsOwned == org_openafs_jafs_Group_GROUP_OWNER_ACCESS ) {
370 ptsEntry.listGroupsOwned = PTS_GROUP_OWNER_ACCESS;
371 } else if( jlistGroupsOwned ==
372 org_openafs_jafs_Group_GROUP_GROUP_ACCESS ) {
373 ptsEntry.listGroupsOwned = PTS_GROUP_ACCESS;
375 ptsEntry.listGroupsOwned = PTS_GROUP_ANYUSER_ACCESS;
377 if( jlistMembership == org_openafs_jafs_Group_GROUP_OWNER_ACCESS ) {
378 ptsEntry.listMembership = PTS_GROUP_OWNER_ACCESS;
379 } else if( jlistMembership ==
380 org_openafs_jafs_Group_GROUP_GROUP_ACCESS ) {
381 ptsEntry.listMembership = PTS_GROUP_ACCESS;
383 ptsEntry.listMembership = PTS_GROUP_ANYUSER_ACCESS;
385 if( jlistAdd == org_openafs_jafs_Group_GROUP_OWNER_ACCESS ) {
386 ptsEntry.listAdd = PTS_GROUP_OWNER_ACCESS;
387 } else if( jlistAdd == org_openafs_jafs_Group_GROUP_GROUP_ACCESS ) {
388 ptsEntry.listAdd = PTS_GROUP_ACCESS;
390 ptsEntry.listAdd = PTS_GROUP_ANYUSER_ACCESS;
392 if( jlistDelete == org_openafs_jafs_Group_GROUP_OWNER_ACCESS ) {
393 ptsEntry.listDelete = PTS_GROUP_OWNER_ACCESS;
394 } else if( jlistDelete == org_openafs_jafs_Group_GROUP_GROUP_ACCESS ) {
395 ptsEntry.listDelete = PTS_GROUP_ACCESS;
397 ptsEntry.listDelete = PTS_GROUP_ANYUSER_ACCESS;
399 if( !pts_GroupModify( (void *) cellHandle, name, &ptsEntry, &ast ) ) {
401 (*env)->ReleaseStringUTFChars(env, jname, name);
403 throwAFSException( env, ast );
408 (*env)->ReleaseStringUTFChars(env, jname, name);
414 * Begin the process of getting the users that belong to the group. Returns
415 * an iteration ID to be used by subsequent calls to
416 * getGroupMembersNext and getGroupMembersDone.
418 * env the Java environment
419 * cls the current Java class
420 * cellHandle the handle of the cell to which the group belongs
421 * jname the name of the group for which to get the members
422 * returns an iteration ID
424 JNIEXPORT jlong JNICALL
425 Java_org_openafs_jafs_Group_getGroupMembersBegin
426 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jname)
432 if( jname != NULL ) {
433 name = (*env)->GetStringUTFChars(env, jname, 0);
435 throwAFSException( env, JAFSADMNOMEM );
442 if( !pts_GroupMemberListBegin( (void *) cellHandle, name, &iterationId,
445 (*env)->ReleaseStringUTFChars(env, jname, name);
447 throwAFSException( env, ast );
452 (*env)->ReleaseStringUTFChars(env, jname, name);
455 return (jlong) iterationId;
460 * Returns the next members that belongs to the group. Returns
461 * null if there are no more members.
463 * env the Java environment
464 * cls the current Java class
465 * iterationId the iteration ID of this iteration
466 * returns the name of the next member
468 JNIEXPORT jstring JNICALL
469 Java_org_openafs_jafs_Group_getGroupMembersNextString
470 (JNIEnv *env, jclass cls, jlong iterationId)
473 char *userName = (char *) malloc( sizeof(char)*PTS_MAX_NAME_LEN);
477 throwAFSException( env, JAFSADMNOMEM );
481 if( !pts_GroupMemberListNext( (void *) iterationId, userName, &ast ) ) {
483 if( ast == ADMITERATORDONE ) {
486 throwAFSException( env, ast );
491 juser = (*env)->NewStringUTF(env, userName);
497 * Fills the next user object belonging to that group. Returns 0 if there
498 * are no more users, != 0 otherwise.
500 * env the Java environment
501 * cls the current Java class
502 * cellHandle the handle of the cell to which the users belong
503 * iterationId the iteration ID of this iteration
504 * juserObject a User object to be populated with the values of the
506 * returns 0 if there are no more users, != 0 otherwise
508 JNIEXPORT jint JNICALL
509 Java_org_openafs_jafs_Group_getGroupMembersNext
510 (JNIEnv *env, jclass cls, jlong cellHandle, jlong iterationId,
517 userName = (char *) malloc( sizeof(char)*PTS_MAX_NAME_LEN);
520 throwAFSException( env, JAFSADMNOMEM );
524 if( !pts_GroupMemberListNext( (void *) iterationId, userName, &ast ) ) {
526 if( ast == ADMITERATORDONE ) {
529 throwAFSException( env, ast );
534 juser = (*env)->NewStringUTF(env, userName);
537 internal_getUserClass( env, juserObject );
540 (*env)->SetObjectField(env, juserObject, user_nameField, juser);
542 getUserInfoChar( env, (void *) cellHandle, userName, juserObject );
543 (*env)->SetBooleanField( env, juserObject, user_cachedInfoField, TRUE );
551 * Signals that the iteration is complete and will not be accessed anymore.
553 * env the Java environment
554 * cls the current Java class
555 * iterationId the iteration ID of this iteration
557 JNIEXPORT void JNICALL
558 Java_org_openafs_jafs_Group_getGroupMembersDone
559 (JNIEnv *env, jclass cls, jlong iterationId)
563 if( !pts_GroupMemberListDone( (void *) iterationId, &ast ) ) {
564 throwAFSException( env, ast );
571 * Adds a user to the specified group.
573 * env the Java environment
574 * cls the current Java class
575 * cellHandle the handle of the cell to which the group belongs
576 * jgroupName the name of the group to which to add a member
577 * juserName the name of the user to add
579 JNIEXPORT void JNICALL
580 Java_org_openafs_jafs_Group_addMember
581 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jgroupName,
585 const char *groupName;
586 const char *userName;
588 if( jgroupName != NULL ) {
589 groupName = (*env)->GetStringUTFChars(env, jgroupName, 0);
591 throwAFSException( env, JAFSADMNOMEM );
598 if( juserName != NULL ) {
599 userName = (*env)->GetStringUTFChars(env, juserName, 0);
601 if( groupName != NULL ) {
602 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
604 throwAFSException( env, JAFSADMNOMEM );
611 if( !pts_GroupMemberAdd( (void *) cellHandle, userName, groupName, &ast ) ) {
612 if( groupName != NULL ) {
613 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
615 if( userName != NULL ) {
616 (*env)->ReleaseStringUTFChars(env, juserName, userName);
618 throwAFSException( env, ast );
622 if( groupName != NULL ) {
623 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
625 if( userName != NULL ) {
626 (*env)->ReleaseStringUTFChars(env, juserName, userName);
631 * Removes a user from the specified group.
633 * env the Java environment
634 * cls the current Java class
635 * cellHandle the handle of the cell to which the group belongs
636 * jgroupName the name of the group from which to remove a
638 * juserName the name of the user to remove
640 JNIEXPORT void JNICALL
641 Java_org_openafs_jafs_Group_removeMember
642 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jgroupName,
646 const char *groupName;
647 const char *userName;
649 if( jgroupName != NULL ) {
650 groupName = (*env)->GetStringUTFChars(env, jgroupName, 0);
652 throwAFSException( env, JAFSADMNOMEM );
659 if( juserName != NULL ) {
660 userName = (*env)->GetStringUTFChars(env, juserName, 0);
662 if( groupName != NULL ) {
663 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
665 throwAFSException( env, JAFSADMNOMEM );
672 if( !pts_GroupMemberRemove( (void *)cellHandle, userName,
673 groupName, &ast ) ) {
674 if( groupName != NULL ) {
675 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
677 if( userName != NULL ) {
678 (*env)->ReleaseStringUTFChars(env, juserName, userName);
680 throwAFSException( env, ast );
684 if( groupName != NULL ) {
685 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
687 if( userName != NULL ) {
688 (*env)->ReleaseStringUTFChars(env, juserName, userName);
693 * Change the owner of the specified group.
695 * env the Java environment
696 * cls the current Java class
697 * cellHandle the handle of the cell to which the group belongs
698 * jgroupName the name of the group of which to change the
700 * jownerName the name of the new owner
702 JNIEXPORT void JNICALL
703 Java_org_openafs_jafs_Group_changeOwner
704 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jgroupName,
708 const char *groupName;
709 const char *ownerName;
711 if( jgroupName != NULL ) {
712 groupName = (*env)->GetStringUTFChars(env, jgroupName, 0);
714 throwAFSException( env, JAFSADMNOMEM );
721 if( jownerName != NULL ) {
722 ownerName = (*env)->GetStringUTFChars(env, jownerName, 0);
724 if( groupName != NULL ) {
725 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
727 throwAFSException( env, JAFSADMNOMEM );
734 if( !pts_GroupOwnerChange( (void *)cellHandle, groupName,
735 ownerName, &ast ) ) {
736 if( groupName != NULL ) {
737 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
739 if( ownerName != NULL ) {
740 (*env)->ReleaseStringUTFChars(env, jownerName, ownerName);
742 throwAFSException( env, ast );
746 if( groupName != NULL ) {
747 (*env)->ReleaseStringUTFChars(env, jgroupName, groupName);
749 if( ownerName != NULL ) {
750 (*env)->ReleaseStringUTFChars(env, jownerName, ownerName);
756 * Change the name of the specified group.
758 * env the Java environment
759 * cls the current Java class
760 * cellHandle the handle of the cell to which the group belongs
761 * joldGroupName the old name of the group
762 * jnewGroupName the new name for the group
764 JNIEXPORT void JNICALL
765 Java_org_openafs_jafs_Group_rename
766 (JNIEnv *env, jclass cls, jlong cellHandle, jstring jgroupOldName,
767 jstring jgroupNewName )
770 const char *groupOldName;
771 const char *groupNewName;
773 if( jgroupOldName != NULL ) {
774 groupOldName = (*env)->GetStringUTFChars(env, jgroupOldName, 0);
775 if( !groupOldName ) {
776 throwAFSException( env, JAFSADMNOMEM );
783 if( jgroupNewName != NULL ) {
784 groupNewName = (*env)->GetStringUTFChars(env, jgroupNewName, 0);
785 if( !groupNewName ) {
786 if( groupOldName != NULL ) {
787 (*env)->ReleaseStringUTFChars(env, jgroupOldName, groupOldName);
789 throwAFSException( env, JAFSADMNOMEM );
796 if( !pts_GroupRename( (void *)cellHandle, groupOldName,
797 groupNewName, &ast ) ) {
798 if( groupOldName != NULL ) {
799 (*env)->ReleaseStringUTFChars(env, jgroupOldName, groupOldName);
801 if( groupNewName != NULL ) {
802 (*env)->ReleaseStringUTFChars(env, jgroupNewName, groupNewName);
804 throwAFSException( env, ast );
808 if( groupOldName != NULL ) {
809 (*env)->ReleaseStringUTFChars(env, jgroupOldName, groupOldName);
811 if( groupNewName != NULL ) {
812 (*env)->ReleaseStringUTFChars(env, jgroupNewName, groupNewName);
816 // reclaim global memory used by this portion
817 JNIEXPORT void JNICALL
818 Java_org_openafs_jafs_Group_reclaimGroupMemory (JNIEnv *env, jclass cls)
821 (*env)->DeleteGlobalRef(env, groupCls);