From owner-freebsd-fs@freebsd.org Mon Nov 20 18:55:02 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 339E9DF2D47 for ; Mon, 20 Nov 2017 18:55:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02B7A6809C for ; Mon, 20 Nov 2017 18:55:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id z74so16777176iof.12 for ; Mon, 20 Nov 2017 10:55:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=JqDneKovIHFbVu8DE4KlGKfZ1OVmSD1hrR3K1aIV8H4=; b=Hz788Qb/r10sbxWofqxdPzzmNdGJo3wtJ0Q7n7qOTH5bD1juF3CUTMVipCpV5wBX19 UohI6ECKC0WpXC+5SCK3ZGdvb3YGPN85MvCzd66JWHQn0ycbC5UN0mntueuIvxLQXXIm 1H8NPcjflVA2hzVlnrW75f/5i0tcYaZZTvCtsmLK6pDchEG7b5czO/oXsj1LP75HNRcw VA9cl+0brrA6fgVg29k0y9jMw8Hi7l13A7SROrPqHBQNCfH/T2t35+tn+fHfpwow5Ttj igQXxkiDV/dBAVjCp9l/Hw8z88AeN1SdXn/2jWoN86OWCcx7NDst32wLn4FLVlGjf6GY 2jYw== X-Gm-Message-State: AJaThX4nNdUpe8sQ/eumP+mkFCjymjSD06pPx5OOXFDBy+3+HaJmq6xn AH10aMIka9uJ+XNnZ8v60GZ61g/a X-Google-Smtp-Source: AGs4zMYHDoPmRNWOnHRbjiKXSRakhjsAdXmjeUVFFpMN/2etvwCSvonJ+r0tEH9k2gzFJXAqlHiC4g== X-Received: by 10.107.38.79 with SMTP id m76mr15341708iom.187.1511202644274; Mon, 20 Nov 2017 10:30:44 -0800 (PST) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id w96sm5151832ioe.76.2017.11.20.10.30.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 10:30:43 -0800 (PST) Received: by mail-io0-f172.google.com with SMTP id u42so16705076ioi.9 for ; Mon, 20 Nov 2017 10:30:43 -0800 (PST) X-Received: by 10.107.7.169 with SMTP id g41mr15504230ioi.38.1511202643349; Mon, 20 Nov 2017 10:30:43 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.165.150 with HTTP; Mon, 20 Nov 2017 10:30:42 -0800 (PST) In-Reply-To: References: From: Conrad Meyer Date: Mon, 20 Nov 2017 10:30:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: MSDOS Filesystem question related to "read-only" files To: Karl Denninger Cc: "freebsd-fs@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 18:55:02 -0000 Hi Karl, In fact, msdosfs in FreeBSD should set the FAT READONLY attribute under two conditions: 1. The owner chmod's the file non-writeable (chmod u-w) (what you've described, I think). Or, 2. The super user or otherwise privileged user sets the "readonly" flag on the file via chflags(1). How have you determined that chmod u-w does nothing? What version of FreeBSD are you using? Best, Conrad On Mon, Nov 20, 2017 at 7:36 AM, Karl Denninger wrote: > I'm running into an interesting issue here and wondering if there's a > way to do this under FreeBSD. > > MSDOS filesystems have a "primitive" permission capability; > specifically, they can have a "Read-only" attribute on a file. It looks > like OpenBSD supports this from reading their man pages. > > FreeBSD doesn't appear to. When you mount a msdos filesystem (e.g. a > USB stick) whoever owns the parent directory where you mount it gives > you the permissions and "ownership" of files on said filesystem. All > good so far. But attempting to chmod a file to remove write permission > "succeeds" (returns success) but does nothing. > > Is this capability simply not present on FreeBSD? I'm interested in > using it as a means of "flagging" files on a USB stick in an application > that I do not want to remove if the stick fills (basically, to "protect" > them from being aged off) and it appears there's no way to do it, other > than to use something unique in the filename that I would then have to > pay attention to. > > -- > Karl Denninger > karl@denninger.net > /The Market Ticker/ > /[S/MIME encrypted email preferred]/