From unknown Fri Aug 15 15:28:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#48725 <48725@debbugs.gnu.org> To: bug#48725 <48725@debbugs.gnu.org> Subject: Status: surprising error char/pos with --sandbox + s///e command Reply-To: bug#48725 <48725@debbugs.gnu.org> Date: Fri, 15 Aug 2025 22:28:38 +0000 retitle 48725 surprising error char/pos with --sandbox + s///e command reassign 48725 sed submitter 48725 Travis Everett severity 48725 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat May 29 00:36:20 2021 Received: (at submit) by debbugs.gnu.org; 29 May 2021 04:36:20 +0000 Received: from localhost ([127.0.0.1]:55690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmqhv-0004dT-I3 for submit@debbugs.gnu.org; Sat, 29 May 2021 00:36:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:32830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmo8D-00023x-UO for submit@debbugs.gnu.org; Fri, 28 May 2021 21:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmo8C-00089J-1T for bug-sed@gnu.org; Fri, 28 May 2021 21:51:17 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:37562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmo89-0000RS-3B for bug-sed@gnu.org; Fri, 28 May 2021 21:51:15 -0400 Received: by mail-lf1-x130.google.com with SMTP id b26so7937087lfq.4 for ; Fri, 28 May 2021 18:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7D8MV261IMAx42boSafXaXz/4NacCzdH9jKeGfzDWaI=; b=fMG+c3Nxya2IANuLY3M2DYfmY+U3iHiQkwWZ6sd032QBEy1kwwIaWOj7tLUrZ4vW/Q 6Kz3p/hh7XIpJr34bQEjHCrJ4TUInq4qOJ7pqqE0mdhF5uDxFXbIFXqyJ3Vd7eqWrvz2 9nscqhsOcBSy9PFHefjs5a3TBUGJxTrWFEZhDpiTP2KlWkxfFMEGbBdZnsr510lh3DLZ HKv7wt7vIJO7vcf35frA2O/gMLGJl5vlW+zWsdD3WFpAIMeZ6VNyZN1jIz31tduE2dAx eifR+kdJIjbpfoMzeUdtq8Is7CpcWgixoUhaUtBixu/PvNVB+FLq4Il/4iXgYb38VtUs r04g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7D8MV261IMAx42boSafXaXz/4NacCzdH9jKeGfzDWaI=; b=CUKXU8iBLQRZi3mz6VXk6HnxbIk032UeHxio6RVkrCr1PpVsqMNkPOk+R+hDzPni1q mSilnDG9/nmPYPA5tMEzfNCHOssUbiHqESRalGcTnUJwvf8V6XxHjK3auL6W2bfTXFnj 42QM9D3lDM7d0oPFaKEEPum/qN9tR57N2w5GVUf1BvKkCbxVXEbDCD0y2xChnZIf+7O1 5Y5kSZEyqCowT3OysL6VXfV757n5Me3kq1e1bAukLg+agtXUgO1BDGlsjZMcTFKcfi7F n6uHYDU8aeQasacxMplYycD8Qe7/m1doXTk81sx7+GqRZpAOUrJm0tlQKR6JX29/T3Go tOIw== X-Gm-Message-State: AOAM531d5QmiyUST9Pqdsm0f/+/YXahDxgurperT+UGKjr59UR0BlZKc PjkEBLQYnIK0yVNqPA/f3VrIXFseDG58TXSVFZvo5UP7+KY= X-Google-Smtp-Source: ABdhPJxGA9OOk3VWUgMr5bbXOWPkKUC8up7nbu6NVORJrRv1tO8tEQr2jxVXJddpP8TQkvOKL3iNoT0V98ieD2mTACs= X-Received: by 2002:a05:6512:2035:: with SMTP id s21mr7712795lfs.195.1622253068911; Fri, 28 May 2021 18:51:08 -0700 (PDT) MIME-Version: 1.0 From: Travis Everett Date: Fri, 28 May 2021 20:50:57 -0500 Message-ID: Subject: surprising error char/pos with --sandbox + s///e command To: bug-sed@gnu.org Content-Type: multipart/alternative; boundary="000000000000e8862805c36e393a" Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=travis.a.everett@gmail.com; helo=mail-lf1-x130.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 29 May 2021 00:36:18 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000e8862805c36e393a Content-Type: text/plain; charset="UTF-8" Not sure this is a bug, but I was a little surprised by the char position reported by --sandbox errors when there's an s///e command present. (gnu sed 4.8 via nixpkgs on macOS) By 1-indexed position, 9 is correct for all 3 commands below, but the last two indicate 10 and 11 respectively: $ sed --sandbox -e '{ s/b/c/z }' sed: -e expression #1, char 9: unknown option to `s' $ sed --sandbox -e '{ s/b/c/e }' sed: -e expression #1, char 10: e/r/w commands disabled in sandbox mode $ sed --sandbox -e '{ s/b/c/e ; s/b/c/e }' sed: -e expression #1, char 11: e/r/w commands disabled in sandbox mode It looks like the s command has to be fully consumed before the sandbox check fails, leaving the error at whatever position technically terminated the s command? T --000000000000e8862805c36e393a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Not sur= e this is a bug, but I was a little surprised by the char position reported= by --sandbox errors when there's an=C2=A0s///e command present. (gnu s= ed 4.8 via nixpkgs on macOS)

By 1-inde= xed position, 9 is correct for all 3 commands below, but the last two indic= ate 10 and 11 respectively:

$ sed --sandbox -e '{ s/b/c/z }'
sed: -e expression #1, char 9: unknown option to `s'

$ sed --sandbox -e '{ s/b/c/e }= '
sed: -e expression #1, char 10: e/r/w commands = disabled in sandbox mode

$= sed --sandbox -e '{ s/b/c/e ; s/b/c/e }'
sed= : -e expression #1, char 11: e/r/w commands disabled in sandbox mode
<= /div>

It looks like the s command has to be = fully consumed before the sandbox check fails, leaving the error at whateve= r position technically terminated the s command?

T=
--000000000000e8862805c36e393a--