From owner-freebsd-bugs Mon Jan 1 4:10: 5 2001 From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 1 04:10:02 2001 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0C1A237B402 for ; Mon, 1 Jan 2001 04:10:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f01CA2b94403; Mon, 1 Jan 2001 04:10:02 -0800 (PST) (envelope-from gnats) Resent-Date: Mon, 1 Jan 2001 04:10:02 -0800 (PST) Resent-Message-Id: <200101011210.f01CA2b94403@freefall.freebsd.org> Resent-From: gnats-admin@FreeBSD.org (GNATS Management) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: gnats-admin@FreeBSD.org, jau@iki.fi Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2C89037B400 for ; Mon, 1 Jan 2001 04:00:54 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f01C0sX92024; Mon, 1 Jan 2001 04:00:54 -0800 (PST) (envelope-from nobody) Message-Id: <200101011200.f01C0sX92024@freefall.freebsd.org> Date: Mon, 1 Jan 2001 04:00:54 -0800 (PST) From: jau@iki.fi Sender: nobody@FreeBSD.org To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/23990: access(2) system call reports an immutable file as writable Resent-Sender: gnats@FreeBSD.org Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23990 >Category: kern >Synopsis: access(2) system call reports an immutable file as writable >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 01 04:10:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Jukka A. Ukkonen >Release: 3.5.1 >Organization: Finnish UNIX Users' Group >Environment: FreeBSD mjolnir.thunderbolt.fi 3.5.1-RELEASE FreeBSD 3.5.1-RELEASE #2: Mon Oct 16 13:00:59 EET DST 2000 jau@mjolnir.thunderbolt.fi:/usr/src/sys/compile/Mjolnir i386 >Description: The access(2) system call reports an immutable file as writable though the reasonable approach would be to report "not writable". This is a problem for programs that rely on accept(2) providing them correct information about the accessibilty of files. Especially when someone wants to quickly review one's files' accessibility with a program like access(1) the current behaviour produces misleading results and is logically in contradiction with reporting files on read-only mounted file systems as "not writable". Currently the only way to really know whether writing is OK or not is by trying to open the file for writing. >How-To-Repeat: # touch testfile # chflags uchg testfile # access -w testfile >Fix: Should be relatively straight forward by adding a VOP_GETATTR(vp, &va, p->p_ucred, p) call and (va.va_flags & IMMUTABLE) test to access(2). >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message