libadmin: Don't pass garbage to pts_GroupCreate
[openafs.git] / src / libadmin / test / pts.c
index f1e573b..109dda9 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header$");
+#include <roken.h>
 
 #include "pts.h"
 
@@ -29,13 +29,14 @@ RCSID("$Header$");
  */
 
 static int
-GetIntFromString(const char *int_str, const char *error_msg) {
+GetIntFromString(const char *int_str, const char *error_msg)
+{
     int i;
     char *bad_char = NULL;
 
     i = strtoul(int_str, &bad_char, 10);
     if ((bad_char == NULL) || (*bad_char == 0)) {
-        return i;
+       return i;
     }
 
     ERR_EXT(error_msg);
@@ -48,7 +49,8 @@ GetIntFromString(const char *int_str, const char *error_msg) {
  */
 
 static pts_groupAccess_t
-GetGroupAccessFromString(const char *in_str, const char *error_msg) {
+GetGroupAccessFromString(const char *in_str, const char *error_msg)
+{
     pts_groupAccess_t access;
 
     if (!strcasecmp("owner", in_str)) {
@@ -71,7 +73,8 @@ GetGroupAccessFromString(const char *in_str, const char *error_msg) {
  */
 
 static pts_userAccess_t
-GetUserAccessFromString(const char *in_str, const char *error_msg) {
+GetUserAccessFromString(const char *in_str, const char *error_msg)
+{
     pts_userAccess_t access;
 
     if (!strcasecmp("owner", in_str)) {
@@ -86,10 +89,9 @@ GetUserAccessFromString(const char *in_str, const char *error_msg) {
 }
 
 int
-DoPtsGroupMemberAdd(struct cmd_syndesc *as, char *arock)
+DoPtsGroupMemberAdd(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER, GROUP}
-      DoPtsGroupMemberAdd_parm_t;
+    enum { USER, GROUP };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
     const char *group = as->parms[GROUP].items->data;
@@ -102,10 +104,9 @@ DoPtsGroupMemberAdd(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupOwnerChange(struct cmd_syndesc *as, char *arock)
+DoPtsGroupOwnerChange(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {OWNER, GROUP}
-      DoPtsGroupOwnerChange_parm_t;
+    enum { OWNER, GROUP };
     afs_status_t st = 0;
     const char *owner = as->parms[OWNER].items->data;
     const char *group = as->parms[GROUP].items->data;
@@ -118,14 +119,13 @@ DoPtsGroupOwnerChange(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupCreate(struct cmd_syndesc *as, char *arock)
+DoPtsGroupCreate(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {OWNER, GROUP}
-      DoPtsGroupCreate_parm_t;
+    enum { OWNER, GROUP };
     afs_status_t st = 0;
-    const char *owner = as->parms[OWNER].items->data;
-    const char *group = as->parms[GROUP].items->data;
-    int new_group_id;
+    char *owner = as->parms[OWNER].items->data;
+    char *group = as->parms[GROUP].items->data;
+    int new_group_id = 0;
 
     if (!pts_GroupCreate(cellHandle, group, owner, &new_group_id, &st)) {
        ERR_ST_EXT("pts_GroupMemberAdd", st);
@@ -153,7 +153,8 @@ Print_pts_GroupEntry_p(pts_GroupEntry_p entry, const char *prefix)
 {
     printf("%sName %s Uid %d\n", prefix, entry->name, entry->nameUid);
     printf("%sOwner %s Uid %d\n", prefix, entry->owner, entry->ownerUid);
-    printf("%sCreator %s Uid %d\n", prefix, entry->creator, entry->creatorUid);
+    printf("%sCreator %s Uid %d\n", prefix, entry->creator,
+          entry->creatorUid);
     printf("%sMembership count %d\n", prefix, entry->membershipCount);
     printf("%sList status permission:\n", prefix);
     Print_pts_groupAccess_p(&entry->listStatus, "    ");
@@ -168,10 +169,9 @@ Print_pts_GroupEntry_p(pts_GroupEntry_p entry, const char *prefix)
 }
 
 int
-DoPtsGroupGet(struct cmd_syndesc *as, char *arock)
+DoPtsGroupGet(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {GROUP}
-      DoPtsGroupGet_parm_t;
+    enum { GROUP };
     afs_status_t st = 0;
     const char *group = as->parms[GROUP].items->data;
     pts_GroupEntry_t entry;
@@ -186,10 +186,9 @@ DoPtsGroupGet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupDelete(struct cmd_syndesc *as, char *arock)
+DoPtsGroupDelete(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {GROUP}
-      DoPtsGroupDelete_parm_t;
+    enum { GROUP };
     afs_status_t st = 0;
     const char *group = as->parms[GROUP].items->data;
 
@@ -201,7 +200,7 @@ DoPtsGroupDelete(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupMaxGet(struct cmd_syndesc *as, char *arock)
+DoPtsGroupMaxGet(struct cmd_syndesc *as, void *arock)
 {
     afs_status_t st = 0;
     int max_group_id;
@@ -214,10 +213,9 @@ DoPtsGroupMaxGet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupMaxSet(struct cmd_syndesc *as, char *arock)
+DoPtsGroupMaxSet(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {MAX}
-      DoPtsGroupMaxSet_parm_t;
+    enum { MAX };
     afs_status_t st = 0;
     const char *max = as->parms[MAX].items->data;
     int max_group_id;
@@ -232,10 +230,9 @@ DoPtsGroupMaxSet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupMemberList(struct cmd_syndesc *as, char *arock)
+DoPtsGroupMemberList(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {GROUP}
-      DoPtsGroupMemberList_parm_t;
+    enum { GROUP };
     afs_status_t st = 0;
     const char *group = as->parms[GROUP].items->data;
     void *iter;
@@ -246,7 +243,7 @@ DoPtsGroupMemberList(struct cmd_syndesc *as, char *arock)
     }
 
     printf("Listing members of group %s\n", group);
-    while(pts_GroupMemberListNext(iter, member, &st)) {
+    while (pts_GroupMemberListNext(iter, member, &st)) {
        printf("\t%s\n", member);
     }
 
@@ -262,10 +259,9 @@ DoPtsGroupMemberList(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupMemberRemove(struct cmd_syndesc *as, char *arock)
+DoPtsGroupMemberRemove(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER, GROUP}
-      DoPtsGroupMemberRemove_parm_t;
+    enum { USER, GROUP };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
     const char *group = as->parms[GROUP].items->data;
@@ -278,13 +274,12 @@ DoPtsGroupMemberRemove(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupRename(struct cmd_syndesc *as, char *arock)
+DoPtsGroupRename(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {GROUP, NEWNAME}
-      DoPtsGroupRename_parm_t;
+    enum { GROUP, NEWNAME };
     afs_status_t st = 0;
     const char *group = as->parms[GROUP].items->data;
-    const char *new_name = as->parms[NEWNAME].items->data;
+    char *new_name = as->parms[NEWNAME].items->data;
 
     if (!pts_GroupRename(cellHandle, group, new_name, &st)) {
        ERR_ST_EXT("pts_GroupRename", st);
@@ -294,28 +289,28 @@ DoPtsGroupRename(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsGroupModify(struct cmd_syndesc *as, char *arock)
+DoPtsGroupModify(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {GROUP, LISTSTATUS, LISTGROUPSOWNED, LISTMEMBERSHIP,
-      LISTADD, LISTDELTE}
-      DoPtsGroupModify_parm_t;
+    enum { GROUP, LISTSTATUS, LISTGROUPSOWNED, LISTMEMBERSHIP,
+       LISTADD, LISTDELTE
+    };
     afs_status_t st = 0;
     const char *group = as->parms[GROUP].items->data;
     pts_GroupUpdateEntry_t entry;
 
-    entry.listStatus = 
+    entry.listStatus =
        GetGroupAccessFromString(as->parms[LISTSTATUS].items->data,
                                 "invalid permission specifier");
-    entry.listGroupsOwned = 
+    entry.listGroupsOwned =
        GetGroupAccessFromString(as->parms[LISTGROUPSOWNED].items->data,
                                 "invalid permission specifier");
-    entry.listMembership = 
+    entry.listMembership =
        GetGroupAccessFromString(as->parms[LISTMEMBERSHIP].items->data,
                                 "invalid permission specifier");
-    entry.listAdd = 
+    entry.listAdd =
        GetGroupAccessFromString(as->parms[LISTADD].items->data,
                                 "invalid permission specifier");
-    entry.listDelete = 
+    entry.listDelete =
        GetGroupAccessFromString(as->parms[LISTDELTE].items->data,
                                 "invalid permission specifier");
 
@@ -327,12 +322,11 @@ DoPtsGroupModify(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsUserCreate(struct cmd_syndesc *as, char *arock)
+DoPtsUserCreate(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER}
-      DoPtsUserCreate_parm_t;
+    enum { USER };
     afs_status_t st = 0;
-    const char *user = as->parms[USER].items->data;
+    char *user = as->parms[USER].items->data;
     int new_user_id;
 
     if (!pts_UserCreate(cellHandle, user, &new_user_id, &st)) {
@@ -345,10 +339,9 @@ DoPtsUserCreate(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsUserDelete(struct cmd_syndesc *as, char *arock)
+DoPtsUserDelete(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER}
-      DoPtsUserDelete_parm_t;
+    enum { USER };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
 
@@ -374,10 +367,10 @@ Print_pts_UserEntry_p(pts_UserEntry_p entry, const char *prefix)
 {
     printf("%sName %s Uid %d\n", prefix, entry->name, entry->nameUid);
     printf("%sOwner %s Uid %d\n", prefix, entry->owner, entry->ownerUid);
-    printf("%sCreator %s Uid %d\n", prefix, entry->creator, entry->creatorUid);
+    printf("%sCreator %s Uid %d\n", prefix, entry->creator,
+          entry->creatorUid);
     printf("%sGroup creation quota %d\n", prefix, entry->groupCreationQuota);
-    printf("%sGroup membership count %d\n",
-          prefix,
+    printf("%sGroup membership count %d\n", prefix,
           entry->groupMembershipCount);
     printf("%sList status permission\n", prefix);
     Print_pts_userAccess_p(&entry->listStatus, "    ");
@@ -389,10 +382,9 @@ Print_pts_UserEntry_p(pts_UserEntry_p entry, const char *prefix)
 }
 
 int
-DoPtsUserGet(struct cmd_syndesc *as, char *arock)
+DoPtsUserGet(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER}
-      DoPtsUserGet_parm_t;
+    enum { USER };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
     pts_UserEntry_t entry;
@@ -407,13 +399,12 @@ DoPtsUserGet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsUserRename(struct cmd_syndesc *as, char *arock)
+DoPtsUserRename(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER, NEWNAME}
-      DoPtsUserRename_parm_t;
+    enum { USER, NEWNAME };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
-    const char *new_name = as->parms[NEWNAME].items->data;
+    char *new_name = as->parms[NEWNAME].items->data;
 
     if (!pts_UserRename(cellHandle, user, new_name, &st)) {
        ERR_ST_EXT("pts_UserRename", st);
@@ -423,14 +414,14 @@ DoPtsUserRename(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsUserModify(struct cmd_syndesc *as, char *arock)
+DoPtsUserModify(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER, GROUPQUOTA, LISTSTATUS, LISTGROUPSOWNED, LISTMEMBERSHIP}
-      DoPtsUserModify_parm_t;
+    enum { USER, GROUPQUOTA, LISTSTATUS, LISTGROUPSOWNED,
+       LISTMEMBERSHIP
+    };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
     pts_UserUpdateEntry_t entry;
-    int have_quota = 0;
     int have_list_status_perm = 0;
     int have_list_groups_owned_perm = 0;
     int have_list_membership_perm = 0;
@@ -438,14 +429,13 @@ DoPtsUserModify(struct cmd_syndesc *as, char *arock)
     entry.flag = 0;
 
     if (as->parms[GROUPQUOTA].items) {
-       entry.groupCreationQuota = 
+       entry.groupCreationQuota =
            GetIntFromString(as->parms[GROUPQUOTA].items->data, "bad quota");
        entry.flag = PTS_USER_UPDATE_GROUP_CREATE_QUOTA;
-       have_quota = 1;
     }
 
     if (as->parms[LISTSTATUS].items) {
-       entry.listStatus = 
+       entry.listStatus =
            GetUserAccessFromString(as->parms[LISTSTATUS].items->data,
                                    "invalid permission specifier");
        entry.flag |= PTS_USER_UPDATE_PERMISSIONS;
@@ -453,7 +443,7 @@ DoPtsUserModify(struct cmd_syndesc *as, char *arock)
     }
 
     if (as->parms[LISTGROUPSOWNED].items) {
-       entry.listGroupsOwned = 
+       entry.listGroupsOwned =
            GetUserAccessFromString(as->parms[LISTGROUPSOWNED].items->data,
                                    "invalid permission specifier");
        entry.flag |= PTS_USER_UPDATE_PERMISSIONS;
@@ -461,7 +451,7 @@ DoPtsUserModify(struct cmd_syndesc *as, char *arock)
     }
 
     if (as->parms[LISTMEMBERSHIP].items) {
-       entry.listMembership = 
+       entry.listMembership =
            GetUserAccessFromString(as->parms[LISTMEMBERSHIP].items->data,
                                    "invalid permission specifier");
        entry.flag |= PTS_USER_UPDATE_PERMISSIONS;
@@ -488,7 +478,7 @@ DoPtsUserModify(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsUserMaxGet(struct cmd_syndesc *as, char *arock)
+DoPtsUserMaxGet(struct cmd_syndesc *as, void *arock)
 {
     afs_status_t st = 0;
     int max_user_id;
@@ -501,10 +491,9 @@ DoPtsUserMaxGet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsUserMaxSet(struct cmd_syndesc *as, char *arock)
+DoPtsUserMaxSet(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {MAX}
-      DoPtsUserMaxSet_parm_t;
+    enum { MAX };
     afs_status_t st = 0;
     const char *max = as->parms[MAX].items->data;
     int max_user_id;
@@ -519,10 +508,9 @@ DoPtsUserMaxSet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsUserMemberList(struct cmd_syndesc *as, char *arock)
+DoPtsUserMemberList(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER}
-      DoPtsUserMemberList_parm_t;
+    enum { USER };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
     void *iter;
@@ -534,7 +522,7 @@ DoPtsUserMemberList(struct cmd_syndesc *as, char *arock)
 
     printf("Listing group membership for %s\n", user);
 
-    while(pts_UserMemberListNext(iter, group, &st)) {
+    while (pts_UserMemberListNext(iter, group, &st)) {
        printf("\t%s\n", group);
     }
 
@@ -550,10 +538,9 @@ DoPtsUserMemberList(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoPtsOwnedGroupList(struct cmd_syndesc *as, char *arock)
+DoPtsOwnedGroupList(struct cmd_syndesc *as, void *arock)
 {
-    typedef enum {USER}
-      DoPtsOwnedGroupList_parm_t;
+    enum { USER };
     afs_status_t st = 0;
     const char *user = as->parms[USER].items->data;
     void *iter;
@@ -565,7 +552,7 @@ DoPtsOwnedGroupList(struct cmd_syndesc *as, char *arock)
 
     printf("Listing groups owned by %s\n", user);
 
-    while(pts_OwnedGroupListNext(iter, group, &st)) {
+    while (pts_OwnedGroupListNext(iter, group, &st)) {
        printf("\t%s\n", group);
     }
 
@@ -583,270 +570,127 @@ DoPtsOwnedGroupList(struct cmd_syndesc *as, char *arock)
 void
 SetupPtsAdminCmd(void)
 {
-    struct cmd_syndesc *ts;
+    struct cmd_syndesc *ts;
 
-    ts = cmd_CreateSyntax("PtsGroupMemberAdd",
-                         DoPtsGroupMemberAdd, 0,
+    ts = cmd_CreateSyntax("PtsGroupMemberAdd", DoPtsGroupMemberAdd, NULL,
                          "add a user to a group");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to add");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to modify");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to add");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupOwnerChange",
-                         DoPtsGroupOwnerChange, 0,
+    ts = cmd_CreateSyntax("PtsGroupOwnerChange", DoPtsGroupOwnerChange, NULL,
                          "change the owner of a group");
-    cmd_AddParm(ts,
-               "-owner",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "new owner");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to modify");
+    cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_REQUIRED, "new owner");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupCreate",
-                         DoPtsGroupCreate, 0,
+    ts = cmd_CreateSyntax("PtsGroupCreate", DoPtsGroupCreate, NULL,
                          "create a new group");
-    cmd_AddParm(ts,
-               "-owner",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "owner of group");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to create");
+    cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_REQUIRED, "owner of group");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to create");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupGet",
-                         DoPtsGroupGet, 0,
+    ts = cmd_CreateSyntax("PtsGroupGet", DoPtsGroupGet, NULL,
                          "get information about a group");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to query");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to query");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupDelete",
-                         DoPtsGroupDelete, 0,
+    ts = cmd_CreateSyntax("PtsGroupDelete", DoPtsGroupDelete, NULL,
                          "delete a group");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to delete");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to delete");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupMaxGet",
-                         DoPtsGroupMaxGet, 0,
+    ts = cmd_CreateSyntax("PtsGroupMaxGet", DoPtsGroupMaxGet, NULL,
                          "get the maximum group id");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupMaxSet",
-                         DoPtsGroupMaxSet, 0,
+    ts = cmd_CreateSyntax("PtsGroupMaxSet", DoPtsGroupMaxSet, NULL,
                          "set the maximum group id");
-    cmd_AddParm(ts,
-               "-max",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "new max group id");
+    cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_REQUIRED, "new max group id");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupMemberList",
-                         DoPtsGroupMemberList, 0,
+    ts = cmd_CreateSyntax("PtsGroupMemberList", DoPtsGroupMemberList, NULL,
                          "list members of a group");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to query");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to query");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupMemberRemove",
-                         DoPtsGroupMemberRemove, 0,
+    ts = cmd_CreateSyntax("PtsGroupMemberRemove", DoPtsGroupMemberRemove, NULL,
                          "remove a member from a group");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to remove");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to modify");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to remove");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupRename",
-                         DoPtsGroupRename, 0,
+    ts = cmd_CreateSyntax("PtsGroupRename", DoPtsGroupRename, NULL,
                          "rename a group");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to modify");
-    cmd_AddParm(ts,
-               "-newname",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "new group name");
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
+    cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new group name");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsGroupModify",
-                         DoPtsGroupModify, 0,
+    ts = cmd_CreateSyntax("PtsGroupModify", DoPtsGroupModify, NULL,
                          "modify a group");
-    cmd_AddParm(ts,
-               "-group",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "group to modify");
-    cmd_AddParm(ts,
-               "-liststatus",
-               CMD_SINGLE,
-               CMD_REQUIRED,
+    cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
+    cmd_AddParm(ts, "-liststatus", CMD_SINGLE, CMD_REQUIRED,
                "list status permission <owner | group | any>");
-    cmd_AddParm(ts,
-               "-listgroupsowned",
-               CMD_SINGLE,
-               CMD_REQUIRED,
+    cmd_AddParm(ts, "-listgroupsowned", CMD_SINGLE, CMD_REQUIRED,
                "list groups owned permission <owner | any>");
-    cmd_AddParm(ts,
-               "-listmembership",
-               CMD_SINGLE,
-               CMD_REQUIRED,
+    cmd_AddParm(ts, "-listmembership", CMD_SINGLE, CMD_REQUIRED,
                "list membership permission <owner | group | any>");
-    cmd_AddParm(ts,
-               "-listadd",
-               CMD_SINGLE,
-               CMD_REQUIRED,
+    cmd_AddParm(ts, "-listadd", CMD_SINGLE, CMD_REQUIRED,
                "list add permission <owner | group | any>");
-    cmd_AddParm(ts,
-               "-listdelete",
-               CMD_SINGLE,
-               CMD_REQUIRED,
+    cmd_AddParm(ts, "-listdelete", CMD_SINGLE, CMD_REQUIRED,
                "list delete permission <owner | group>");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserCreate",
-                         DoPtsUserCreate, 0,
+    ts = cmd_CreateSyntax("PtsUserCreate", DoPtsUserCreate, NULL,
                          "create a new user");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to create");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to create");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserDelete",
-                         DoPtsUserDelete, 0,
+    ts = cmd_CreateSyntax("PtsUserDelete", DoPtsUserDelete, NULL,
                          "delete a user");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to delete");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to delete");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserGet",
-                         DoPtsUserGet, 0,
+    ts = cmd_CreateSyntax("PtsUserGet", DoPtsUserGet, NULL,
                          "get information about a user");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to query");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserRename",
-                         DoPtsUserRename, 0,
+    ts = cmd_CreateSyntax("PtsUserRename", DoPtsUserRename, NULL,
                          "rename a user");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to modify");
-    cmd_AddParm(ts,
-               "-newname",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "new user name");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to modify");
+    cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new user name");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserModify",
-                         DoPtsUserModify, 0,
+    ts = cmd_CreateSyntax("PtsUserModify", DoPtsUserModify, NULL,
                          "change a user");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to modify");
-    cmd_AddParm(ts,
-               "-groupquota",
-               CMD_SINGLE,
-               CMD_OPTIONAL,
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to modify");
+    cmd_AddParm(ts, "-groupquota", CMD_SINGLE, CMD_OPTIONAL,
                "group creation quota");
-    cmd_AddParm(ts,
-               "-liststatus",
-               CMD_SINGLE,
-               CMD_OPTIONAL,
+    cmd_AddParm(ts, "-liststatus", CMD_SINGLE, CMD_OPTIONAL,
                "list status permission <owner | any>");
-    cmd_AddParm(ts,
-               "-listgroupsowned",
-               CMD_SINGLE,
-               CMD_OPTIONAL,
+    cmd_AddParm(ts, "-listgroupsowned", CMD_SINGLE, CMD_OPTIONAL,
                "list groups owned permission <owner | any>");
-    cmd_AddParm(ts,
-               "-listmembership",
-               CMD_SINGLE,
-               CMD_OPTIONAL,
+    cmd_AddParm(ts, "-listmembership", CMD_SINGLE, CMD_OPTIONAL,
                "list membership permission <owner | any>");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserMaxGet",
-                         DoPtsUserMaxGet, 0,
+    ts = cmd_CreateSyntax("PtsUserMaxGet", DoPtsUserMaxGet, NULL,
                          "get the max user id");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserMaxSet",
-                         DoPtsUserMaxSet, 0,
+    ts = cmd_CreateSyntax("PtsUserMaxSet", DoPtsUserMaxSet, NULL,
                          "set the max user id");
-    cmd_AddParm(ts,
-               "-max",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "max user id");
+    cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_REQUIRED, "max user id");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsUserMemberList",
-                         DoPtsUserMemberList, 0,
+    ts = cmd_CreateSyntax("PtsUserMemberList", DoPtsUserMemberList, NULL,
                          "list group membership for a user");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to query");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("PtsOwnedGroupList",
-                         DoPtsOwnedGroupList, 0,
+    ts = cmd_CreateSyntax("PtsOwnedGroupList", DoPtsOwnedGroupList, NULL,
                          "list groups owned by a user");
-    cmd_AddParm(ts,
-               "-user",
-               CMD_SINGLE,
-               CMD_REQUIRED,
-               "user to query");
+    cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
     SetupCommonCmdArgs(ts);
 }