Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nHL69-0007u8-Pj for mharc-grub-devel@gnu.org; Tue, 08 Feb 2022 02:39:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHL5t-0007oc-An for grub-devel@gnu.org; Tue, 08 Feb 2022 02:39:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHL5p-00047h-5O for grub-devel@gnu.org; Tue, 08 Feb 2022 02:39:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644305955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ukxvDhQHQU5ZMlPHfwxc9mo55NDeLPrYW0hNKjPOnN0=; b=GmBftMI22wNKg9yE/T8UutUnih/oG3qc98NTLjsFdAMzjxJjaR4etz5q1KOjGFe379ox6r CtXrPlkhJduXWqnuM8ZGq8clq247G8ZdG/Wm6U76mizs0muGuulklCp43+BofkXiMU4fRb fx4vrf/6numOhcOuUt7lktD8SML//SA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-447-cK63QUVxMN60542jybrbiw-1; Tue, 08 Feb 2022 02:39:14 -0500 X-MC-Unique: cK63QUVxMN60542jybrbiw-1 Received: by mail-wm1-f69.google.com with SMTP id r8-20020a7bc088000000b0037bbf779d26so186777wmh.7 for ; Mon, 07 Feb 2022 23:39:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ukxvDhQHQU5ZMlPHfwxc9mo55NDeLPrYW0hNKjPOnN0=; b=oU/94kN20nFA/UTrzFzwYsZTBzXljkJJUA6Nw6pmd4nYOpIozg72j0OVtdSvKhZUep D2FKh+pa2djhf2PdZfQ0oiYTFNUx0kPD9yKXDJEjMD0fanI91mnalsPxnU8zoEzPQgXo x2ibeYjb4yQMuMOa6WoygNhoqePcLj57sbsge7G3b0rrz7PvY5iDpV6oph1Kotph3yC3 tAJhVwIDQ+sgqZOcql57pw4vskfaRXtivkM9drxmaixe6WcBUqo4M9a11MJxQPziXmQh +6PdKpHckYgof4yxj51kL6jaug3ndZC+TlX+3RDb3w/U5vPCBCWXzfFrjHJUlKpSFfd0 2/yw== X-Gm-Message-State: AOAM531Vm60Qs8U70M1FpsctlNTu0pCJnAF/lfWnnE+aLgmQ+ukdybd4 h9iLBo3ZPy9V8tQrovU5DCyqwaTaUt5bcic9NfEubpGF+k76aBcZMT23jnrhV+rw8PDS+PiG7ka w4b/Y/0kYSU/g3nhnLR5dC457hus7REsDvMNJHrXbzFE3fo4j++W9N4KzhWPrntM= X-Received: by 2002:a5d:64c8:: with SMTP id f8mr2481869wri.337.1644305953312; Mon, 07 Feb 2022 23:39:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnWrqkaCyNqeJGzRQioFIxJatJTEElrScbFnCYIxvD2HCI/yIU9INiHbZE+IpIfzsK/T5bPA== X-Received: by 2002:a5d:64c8:: with SMTP id f8mr2481852wri.337.1644305953084; Mon, 07 Feb 2022 23:39:13 -0800 (PST) Received: from t590.redhat.com (82-64-217-13.subs.proxad.net. [82.64.217.13]) by smtp.gmail.com with ESMTPSA id e3sm6184136wrr.94.2022.02.07.23.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 23:39:12 -0800 (PST) From: =?UTF-8?q?Renaud=20M=C3=A9trich?= To: grub-devel@gnu.org Cc: =?UTF-8?q?Renaud=20M=C3=A9trich?= Subject: [PATCH v3 1/2] search: fixed bug stopping iteration when --no-floppy is used Date: Tue, 8 Feb 2022 08:39:10 +0100 Message-Id: <20220208073911.82147-1-rmetrich@redhat.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=rmetrich@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=rmetrich@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2022 07:39:24 -0000 When using --no-floppy and a floppy was encountered, iterate_device() was returning 1, causing the iteration to stop instead of continuing. Signed-off-by: Renaud Métrich --- grub-core/commands/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/commands/search.c b/grub-core/commands/search.c index ed090b3af..51656e361 100644 --- a/grub-core/commands/search.c +++ b/grub-core/commands/search.c @@ -64,7 +64,7 @@ iterate_device (const char *name, void *data) /* Skip floppy drives when requested. */ if (ctx->no_floppy && name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') - return 1; + return 0; #ifdef DO_SEARCH_FS_UUID #define compare_fn grub_strcasecmp -- 2.34.1