NetBSD Problem Report #55190
From duncan@ecs.vuw.ac.nz Tue Apr 21 03:42:31 2020
Return-Path: <duncan@ecs.vuw.ac.nz>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 4719E1A924D
for <gnats-bugs@gnats.NetBSD.org>; Tue, 21 Apr 2020 03:42:31 +0000 (UTC)
Message-Id: <202004210342.03L3gOQO025436@krb1.ecs.vuw.ac.nz>
Date: Tue, 21 Apr 2020 15:42:24 +1200 (NZST)
From: duncan@ecs.vuw.ac.nz
Reply-To: duncan@ecs.vuw.ac.nz
To: gnats-bugs@NetBSD.org
Subject: A bogus error message can be reported by kadmin
X-Send-Pr-Version: 3.95
>Number: 55190
>Category: bin
>Synopsis: A bogus error message can be reported by kadmin
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Apr 21 03:45:00 +0000 2020
>Originator: Duncan McEwan
>Release: NetBSD 8.1_STABLE
>Organization:
School of Engineering and Computer Science,
Victoria University of Wellington
>Environment:
System: NetBSD krb1.ecs.vuw.ac.nz 8.1_STABLE NetBSD 8.1_STABLE (GENERIC) #4: Sun Jan 12 17:21:45 NZDT 2020 mark@turakirae.ecs.vuw.ac.nz:/local/SAVE/8_64.obj/src/work/8/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
kadmin sometimes reports the error message "sl_loop: out of memory"
when the problem has nothing to do with running out of memory.
This is tangentially related to PR #55145, in that the bug reported
in that PR can trigger the above misleading error message. But
the message can also be produced independently of that bug.
>How-To-Repeat:
For eg: Attempt to set a password ending with a '"' character.
kdc# kadmin -l
kadmin> cpw --password=asdfdf" duncan
sl_loop: out of memory
>Fix:
In the above example the problem isn't that kadmin ran out of
memory. It just didn't like the unescaped single '"' character.
The problem is caused by this code in sl.c in the function
sl_command_loop().
ret = sl_make_argv(buf, &argc, &argv);
if(ret) {
fprintf(stderr, "sl_loop: out of memory\n");
free(buf);
return -1;
}
But sl_make_argv() doesn't only fail with ENOMEM. For other parsing
errors it returns ERANGE ("Result too large or too small").
This would hardly be an ideal error message either. But if the error
return from sl_make_argv() is constrained to be a UNIX errno there
probably isn't an great option. Perhaps EINVAL might be better?
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.