Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6054064rwr; Mon, 1 May 2023 15:46:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ZZJFmjmCG+rBaiadQnYCKZa9AMApfqsH1+UyxRn7ozmKCyHSzRBJhjYOBLGetf9qAE1AY X-Received: by 2002:a05:6a20:4309:b0:f0:515d:1742 with SMTP id h9-20020a056a20430900b000f0515d1742mr19867449pzk.53.1682981185822; Mon, 01 May 2023 15:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682981185; cv=none; d=google.com; s=arc-20160816; b=hM+3xMSIMMVShEcy2keXbhYRGYoTsXJ9TsMa4z/ReNpGNKQQ4Ax/2exCFyUrE01YHK 0b+c6A4B3flEyNybzFHufLdI//DH1w7A6mbnCpj6BcpHQ8AhJYFiH0Snuy7RiuAu1FHn ZMELBaDM/c5cjDgnC0QyUdKELCf/1EgtPbJ3/FLNdh6W/uewBmHRYZicaHFiayt1O/s7 GoL2RAUGp/Y+Xs2BvaBVqgC3zDgdtKUFmX0ZUzuxlaDv/+Wvr4aYVN/sgde/GQ87nS8f hSAC6v33XWkAaT7qYSdAiXtSlaxFJqBUvges5cvgbBn9WkO+dxQLTiTc1Xc2hSd6wYTC BB3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=7OBlP1yWmSe/KeQ1+ZXJpMbLGfwR1ADwCzc1rSW6r9g=; b=l26tsZmNU8NhMfipFJrU0hVTX/RBS8jLHkK5aWMI0vtnRm+aP181HnD+SICNFlhxWs jhJSl3oWb6icR0b4kS5iRQI/kugMfzlyv7nABz0t6AcdoCkao/ZflQFzXTFzDgQ12xQ3 zNG4t79Bquq9cr+BxNeIgoTkfW1kcMVS8rd8P9HWsMqYxrlyzEisGCn4kyRSlUCu/WXi vQ7YFkHwlspWWlGFkbkg1ut8oYQ8Pzg0mWEHs5NLj+qYm4wLk2efzoeh+95n9DQNRakK kej9JYaS1rzsQPXi+AwKOkfkb++KBXrqsfAoTyXjPFM1pdbeyaz8eMoacNriUMfOiGkK jGyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=m6LP4j7g; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w62-20020a638241000000b0051b1241624esi31565154pgd.65.2023.05.01.15.46.11; Mon, 01 May 2023 15:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=m6LP4j7g; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbjEAWoU (ORCPT + 99 others); Mon, 1 May 2023 18:44:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229871AbjEAWoT (ORCPT ); Mon, 1 May 2023 18:44:19 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0D371FDD for ; Mon, 1 May 2023 15:44:17 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1a66e7a52d3so22700855ad.0 for ; Mon, 01 May 2023 15:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682981056; x=1685573056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7OBlP1yWmSe/KeQ1+ZXJpMbLGfwR1ADwCzc1rSW6r9g=; b=m6LP4j7gqpPpI4ITZMrAd4tOA+Gcigj194u6n0OPftKVXZd+gN3Zl3ztTlrBPO1wft Gp9wAjRuAg0DdNYo82XwvZ7xdGdKRcV0Y2e2c6OJ1ZREwWwSFBd9DE8QtbdyVKZSZp5g Jj9irV2WCslwZNUIrMD1udR09b4sE5CieDaJX54ItbbEy7i426GU/XrJkwax7V6FAL9q q+RvTSIjvLvuIpQhqlNkmpqBBCq+lSRB0LVAYt0sz9zmly3XPSQz9QLBj5yzFRkGetDn IL+eE0e4f5e98xium4nNjFb2JsuDJgzW02y0UlEkdyEP8BmQExcyr4kHBOv5AuQvZT/M FoJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682981056; x=1685573056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7OBlP1yWmSe/KeQ1+ZXJpMbLGfwR1ADwCzc1rSW6r9g=; b=Wh9nhoCjNVVaE7fSdXpuFcooombQ1aYTedUsEaK5DXN9TGCjgeEaKgKXSBytoVx1yw ALhR2GZSLQRuicluY4CPlgBfFGrSJ9zFQlANmTCfX9nVt6WHJkOrnx2Wr+tkjNG4xRTT M/o51OxDQZhBt1odLamuSiCqXg03WOJRgFtUyjkPoGSeSCjuhn8oFYrTWheu5xxkalZM 41SFeXI5kVMBPcmrlHehO2JOXtVCkTze3XUJKMkT4D8b1lQJZOHdzmro5498spDvsY8x XhUdaXWKy/SibtCpYzIeILLvmqhnzTpgdpIK9CPZuENqK8xHIjydIbPACxZ1KSs1Qn48 PK/A== X-Gm-Message-State: AC+VfDyy49DOu/x4GYsrjRU+/i6H5GBXlEMs5NQUK5f5Q1CPjUClhdaw fE/FbvJ3USkX8Fa0VY29lJk3cjD9B58= X-Received: by 2002:a17:903:246:b0:19f:2328:beee with SMTP id j6-20020a170903024600b0019f2328beeemr17613227plh.11.1682981056583; Mon, 01 May 2023 15:44:16 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id w8-20020a170902a70800b001a6756a36f6sm18279806plq.101.2023.05.01.15.44.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 15:44:15 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH v3 3/4] shared/shell: Fix not releasing prompt Date: Mon, 1 May 2023 15:44:09 -0700 Message-Id: <20230501224410.1119023-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230501224410.1119023-1-luiz.dentz@gmail.com> References: <20230501224410.1119023-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This fixes not releasing prompt when queueing a line to be executed since it can be considered as user input if the init script is attempting to enter it as response to prompt input. --- src/shared/shell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/shell.c b/src/shared/shell.c index 8b8b253d0bcf..757e16199ddf 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -1295,6 +1295,9 @@ static int bt_shell_queue_exec(char *line) /* Queue if already executing */ if (data.line) { + /* Check if prompt is being held then release using the line */ + if (!bt_shell_release_prompt(line)) + return 0; queue_push_tail(data.queue, strdup(line)); return 0; } -- 2.40.0