From: Andrew Deason Date: Fri, 15 Oct 2010 21:35:32 +0000 (-0500) Subject: pts: Specifically check for group id 0 X-Git-Tag: upstream/1.8.0_pre1^2~4657 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5e9676144bc3d9b186495a06d14581a4fc97beff;p=packages%2Fo%2Fopenafs.git pts: Specifically check for group id 0 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 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index 17a99442c..a0ce821e5 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -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;