pts: Specifically check for group id 0
authorAndrew Deason <adeason@sinenomine.net>
Fri, 15 Oct 2010 21:35:32 +0000 (16:35 -0500)
committerJeffrey Altman <jaltman@openafs.org>
Fri, 15 Oct 2010 23:26:42 +0000 (16:26 -0700)
For consistency with the code checking user ids in createuser, check
for a specified group id of 0 specifically and give a slightly
different error message for it.

Change-Id: I362302a1a59fbe324f7f3e926f02177c24a5577d
Reviewed-on: http://gerrit.openafs.org/2994
Reviewed-by: Phillip Moore <w.phillip.moore@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/ptserver/pts.c

index 17a9944..a0ce821 100644 (file)
@@ -282,18 +282,17 @@ CreateGroup(struct cmd_syndesc *as, void *arock)
                        idi->data);
                return code;
            }
-           if (id >= 0) {
+           if (id == 0) {
+               printf("0 isn't a valid group id; aborting\n");
+               return EINVAL;
+           }
+           if (id > 0) {
                code = PRBADARG;
                afs_com_err(whoami, code, "because group id %d was not negative",
                        id);
                return code;
            }
 
-            if (id == 0) {
-               printf("0 isn't a valid user id; aborting\n");
-               return EINVAL;
-           }
-
            idi = idi->next;
        } else
            id = 0;