From nobody Fri Mar 11 17:21:52 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4B97719FD61E for ; Fri, 11 Mar 2022 17:21:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KFXmK0S7Tz4kf9 for ; Fri, 11 Mar 2022 17:21:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA39C1D6D5 for ; Fri, 11 Mar 2022 17:21:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 22BHLqLY078887 for ; Fri, 11 Mar 2022 17:21:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22BHLqHA078886 for bugs@FreeBSD.org; Fri, 11 Mar 2022 17:21:52 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 262038] fts(3): Check for readdir(3) errors Date: Fri, 11 Mar 2022 17:21:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch, patch-ready X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: ma.mandourr@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647019313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ns2CCKqKdrXIHOmdDvWF2XvMltTLRfSAVR+MqXyeUOs=; b=wU9U9lGy2p1M6rK4du4aoSs9XFrpXzfBH9OhYNh/QVCezrXkLSkJJoDxP8g9+SzHKA+1FE hZ8vfvYiBLMrTj+W8IIDIFj7IJuDQI+Otw8O+zOFxkVTmkhaTxoHJPYrWejF+mhRoeRPdw 9M/XBEqFUSdz4RQ5zT/7NE5KBf3L5fMi959dtIFomjC1uUEbRjhmVVwvw1SLxsX2VUQbO6 bMltzrO1EDtvrXbErj6dZ6dilTt2V0m68EQnI/d9qPBdqqTmrp3er4Kw70slo9VxkBWWBG 0YvMB+58q6EDto5/ZkAnsQel/F5b3IwoHpRY8aa/eU/p6l8UHjndF5lvFpN26g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647019313; a=rsa-sha256; cv=none; b=nnnbtuqGZUItllrYDHcjOqvEjHdzc6IV+l6ldCO9RMc41DMblWljzRvXa76DSyjrWEnXcp dK2PQetBeuOfclJv9aYugarIXf5Fd4cm19sPodennOl5BDMLm5Tq29pAgqEwVv/p0nErju L+H2QFPxMlYRZfi64+YwOfdf1TGHYzVlQv4GAIflva5Kp08lfVlV3SnhPQpdakCczpexBK AebgkVJEaTc8hhBlulUQDZNdlFAsn8Dt7wR8uS24+zDyfDjpCDIcnf76+hZC0I2PbVv05L O/QxqeHKGf0dmIcMz9BlMkP1gXctrGiYRR6wCUIFhLdtrEziDlmw+/38uV5TWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262038 --- Comment #12 from Mahmoud Abumandour --- (In reply to Mark Johnston from comment #11) Thanks for the feedback. I will address it and resend the patch. Regarding setting readdir_errno only if readdir errs, how is this achievable without setting errno to 0? From the man page: The function returns NULL upon reaching the end of the directory or on error. In the event of an error, errno may be set to any of the values documented for the getdirentries(2) system call. Which I think means that we must set errno to 0 to distinguish whether a NU= LL means error or "end of stream" indicator. Could you please elaborate more? Maybe I can save errno and check that (ret =3D=3D NULL && saved_errno !=3D = errno), and if that's true then set readdir_errno? --=20 You are receiving this mail because: You are the assignee for the bug.=