From e88096d63177ba00e2dc75ef3cbc88ecb5ba8f0a Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 15 Oct 2010 16:35:32 -0500 Subject: [PATCH] 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. 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 (cherry picked from commit 5e9676144bc3d9b186495a06d14581a4fc97beff) Change-Id: I37434f1ad44ed1fad41cf454291c91e0b046ec80 Reviewed-on: http://gerrit.openafs.org/3109 Tested-by: Derrick Brashear --- src/ptserver/pts.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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; -- 2.39.5