Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jan 2001 04:00:54 -0800 (PST)
From:      jau@iki.fi
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/23990: access(2) system call reports an immutable file as writable
Message-ID:  <200101011200.f01C0sX92024@freefall.freebsd.org>
Resent-Message-ID: <200101011210.f01CA2b94403@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101011200.f01C0sX92024>