From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 9F45E3858C30 for ; Tue, 5 Sep 2023 12:07:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F45E3858C30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6b9a2416b1cso1990383a34.2 for ; Tue, 05 Sep 2023 05:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693915626; x=1694520426; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=Yvl24Kvm5gkg2KvJcTBcVKDuaAu5j4p6uUU3SZromXo=; b=OMuXyzRD9tLoQfQXoTQVS69n1ILiJj52bBS1qdYoDOMsFeqmFbyF5wWvbqUbXdOQtq oQ85YamQ4cxUP8ftNGi6dCxn1Y5I1H3Sm28prD+vgCj2YFjuYTwDXl3ml63EDZMaalwm 7UujqKW1rUCW+wqlHGSJXD4y8tBXJJfZidh8Q26tYo09id/TBFDryYEvAfXfSoHK6Zfb AaPtEyWugkcEGM9IPNPFJAIfdA73ZmR8SDAmvNSPeSgt+weGsmzL+MGE0zByMHmBURhN ryg4lhpKytES+rz+tqCY+HnE+eCzfnaVkPa4Q6MZzcGp2Q9tpE6Ky+sIi/5aaIbllUdR 091g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693915626; x=1694520426; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Yvl24Kvm5gkg2KvJcTBcVKDuaAu5j4p6uUU3SZromXo=; b=WUxIgrCnXhTjNPueio0/vu9X4i3c+IlmdlHyUdyC+n3dN+788mpUhGxUKyRv9wHN5n Yisk16EwICcj2SjOMGRHya1lXZQp3qIjS5+SkvAPADRCnZ2/UcXJpwv88yj+RDF5J2oi p8vP+xAuxIjY3+O5Y02/3J1dXlBo0G1k5VoOKSV48cvphvUAaobORlqcdtaImFV+B7xb 8rzIWLjTJLzQDJ/rQRlDHJ8Pk1zAyK0NLjbyAHo5yNaGscQB8rC5G4qTl7dDl/CVrOC9 AsbhQNI93Ul2hsmI5MtN10Q5pBadF8l9NmOM5i5+R4cK/CjdYElLilJGAn18pZFgvzUh BzeQ== X-Gm-Message-State: AOJu0Yy4BZobyz3pv8dDxXgHb3T1T3br4MfdkTJhyThcQePJRR3nESO/ zP/R4EkfhqZK7I4U6fHeQgfgxw== X-Google-Smtp-Source: AGHT+IFjXzCccPcjmCXGH2ZYVFE43jJbAHxws+krXhY9QEH6Hrj/muQNx+mamEJIEGU4UPA3qx8t/w== X-Received: by 2002:a9d:6d04:0:b0:6bc:a054:c569 with SMTP id o4-20020a9d6d04000000b006bca054c569mr13795612otp.38.1693915625944; Tue, 05 Sep 2023 05:07:05 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:fee4:a053:a54:7b70:a25? ([2804:1b3:a7c3:fee4:a053:a54:7b70:a25]) by smtp.gmail.com with ESMTPSA id c9-20020a9d6849000000b006b9cb784553sm5417171oto.36.2023.09.05.05.07.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Sep 2023 05:07:05 -0700 (PDT) Message-ID: Date: Tue, 5 Sep 2023 09:07:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v2] linux: Make fdopendir fail with O_PATH (BZ 30373) To: Paul Eggert , libc-alpha@sourceware.org References: <20230901122651.59253-1-adhemerval.zanella@linaro.org> Content-Language: en-US From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 01/09/23 14:57, Paul Eggert wrote: > On 2023-09-01 05:26, Adhemerval Zanella wrote: >> +  /* Fail early for descriptors opened with O_PATH.  */ >> +  if (__glibc_unlikely (flags & O_PATH)) >> +    { >> +      __set_errno (EBADF); >> +      return NULL; >> +    } >> +  /* Make sure the descriptor allows for reading.  */ >>     if (__glibc_unlikely ((flags & O_ACCMODE) == O_WRONLY)) >>       { >>         __set_errno (EINVAL); > > Why use EBADF for one situation but EINVAL in the other? > > POSIX says it should be EBADF for both situations. Arguably this is a separate bug, but we should fix both bugs (and fix the documentation too, to match POSIX). Right, but I think it should a different patch. I can send the fix once this get installed.