From owner-freebsd-fs Sun Dec 30 4: 2:33 2001 Delivered-To: freebsd-fs@freebsd.org Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by hub.freebsd.org (Postfix) with SMTP id 1E5EF37B405 for ; Sun, 30 Dec 2001 04:02:32 -0800 (PST) Received: (qmail 12611 invoked by uid 0); 30 Dec 2001 12:02:30 -0000 Received: from dclient217-162-49-20.hispeed.ch (HELO riework01) (217.162.49.20) by mail.gmx.net (mp013-rz3) with SMTP; 30 Dec 2001 12:02:30 -0000 From: "Thierry Rietsch" To: Subject: Date: Sun, 30 Dec 2001 13:02:31 +0100 Message-ID: <000101c19129$dcc21c80$01000001@rietsch.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org subscribe freebsd=E2=88=92fs To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Dec 30 8:15:47 2001 Delivered-To: freebsd-fs@freebsd.org Received: from mail.yadt.co.uk (yadt.demon.co.uk [158.152.4.134]) by hub.freebsd.org (Postfix) with SMTP id 85C1937B425 for ; Sun, 30 Dec 2001 08:14:50 -0800 (PST) Received: (qmail 61833 invoked from network); 30 Dec 2001 16:12:28 -0000 Received: from unknown (HELO mail.gattaca.yadt.co.uk) (qmailr@10.0.0.2) by yadt.demon.co.uk with SMTP; 30 Dec 2001 16:12:28 -0000 Received: (qmail 77134 invoked by uid 1000); 30 Dec 2001 16:11:08 -0000 Date: Sun, 30 Dec 2001 16:11:08 +0000 From: David Taylor To: freebsd-current@freebsd.org Cc: freebsd-fs@freebsd.org Subject: msdosfs_lookup returns EINVAL, not ENOENT Message-ID: <20011230161108.A76653@gattaca.yadt.co.uk> Mail-Followup-To: freebsd-current@freebsd.org, freebsd-fs@freebsd.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Whilst poking around on my msdosfs (trying to find an MP3 I thought I had), I discovered that, if there are no files matching "foo*", ls foo* will return the wrong error. msdosfs: $ ls foo*=20 ls: foo*: Invalid argument ufs: $ ls foo* ls: foo*: No such file or directory Using strace tracked this down to lstat of foo* returning EINVAL, which would appear to be incorrect, as EINVAL is not listed as a possible error for lstat. Now, since I'm not familar with the innards of freebsd's fs code, here is where I get a little bit lost. I _think_ I've tracked down the source of the error to the point where unix2dosfn is called in msdosfs_lookup, which would be expected, since '*' is an invalid character in msdos filenames, but is fine for ufs. The call on line 152 of msdosfs_lookup.c appears to be the one causing the current problem, but I'm not sure if simply replacing EINVAL with ENOENT would affect things other than lstat. However, I'm also not sure if the behaviour of the other two calls is corre= ct. OTOH, I'm not sure what syscalls are supposed to return in the case of an invalid character in a filename. e.g. touch foo\\ fails with EINVAL currently, yet open(2) states EINVAL means you have used an invalid combination of O_RDONLY, O_WRONLY, and O_RDWR. But no error is listed in the manpage for an invalid filename, other than ENAMETOOLONG, which is clearly inappropriate. Perhaps the correct fix would just be to document the use of EINVAL? --=20 David Taylor davidt@yadt.co.uk "The future just ain't what it used to be" --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE8LzycfIqKXSsJ/xERAtD6AKCSBGEDpMmOX6LRCMTLkATgdoDucQCgyMfV iXmGsb84pVV+jkp1lnaXD6Y= =Wihg -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Sun Dec 30 10: 6: 6 2001 Delivered-To: freebsd-fs@freebsd.org Received: from smtp02.mrf.mail.rcn.net (smtp02.mrf.mail.rcn.net [207.172.4.61]) by hub.freebsd.org (Postfix) with ESMTP id 2F06937B405 for ; Sun, 30 Dec 2001 10:06:05 -0800 (PST) Received: from 66-44-21-127.s381.apx3.lnh.md.dialup.rcn.com ([66.44.21.127] helo=localhost.) by smtp02.mrf.mail.rcn.net with smtp (Exim 3.33 #10) id 16KkJu-0003hG-00; Sun, 30 Dec 2001 13:04:28 -0500 References: <20011230161108.A76653@gattaca.yadt.co.uk> In-Reply-To: <20011230161108.A76653@gattaca.yadt.co.uk> Date: Sun, 30 Dec 2001 12:09:16 EDT From: Eric Jacobs To: davidt@yadt.co.uk, freebsd-fs@freebsd.org Subject: Re: msdosfs_lookup returns EINVAL, not ENOENT Organization: X-Mailer: Post Office 0.7.2 build 20010211(by eric@localhost 2001/02/11 21:52:30) Message-ID: X-Mailer: PostOffice 0.7 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org David Taylor tapped some keys and produced: > > Whilst poking around on my msdosfs (trying to find an MP3 I thought I > had), I discovered that, if there are no files matching "foo*", ls foo* > will > return the wrong error. > > msdosfs: > > $ ls foo*=20 > ls: foo*: Invalid argument > > ufs: > > $ ls foo* > ls: foo*: No such file or directory > I noticed that too, and I like this behavior. I like having distinct errors to tell me not only when a required condition is false, but also when it couldn't possibly be true. -- P To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Dec 31 7:50:10 2001 Delivered-To: freebsd-fs@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 650A837B42C; Mon, 31 Dec 2001 07:49:59 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id CAA04467; Tue, 1 Jan 2002 02:49:49 +1100 Date: Tue, 1 Jan 2002 02:49:39 +1100 (EST) From: Bruce Evans X-X-Sender: To: David Taylor Cc: , Subject: Re: msdosfs_lookup returns EINVAL, not ENOENT In-Reply-To: <20011230161108.A76653@gattaca.yadt.co.uk> Message-ID: <20020101021821.J6835-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, 30 Dec 2001, David Taylor wrote: > Whilst poking around on my msdosfs (trying to find an MP3 I thought I had), > I discovered that, if there are no files matching "foo*", ls foo* will > return the wrong error. > > msdosfs: > > $ ls foo* > ls: foo*: Invalid argument > ... > I _think_ I've tracked down the source of the error to the point where > unix2dosfn is called in msdosfs_lookup, which would be expected, since '*' > is an invalid character in msdos filenames, but is fine for ufs. This is the correct diagnosis. > OTOH, I'm not sure what syscalls are supposed to return in the case of an > invalid character in a filename. Me too :-). > e.g. touch foo\\ fails with EINVAL currently, yet open(2) states EINVAL > means you have used an invalid combination of O_RDONLY, O_WRONLY, and > O_RDWR. But no error is listed in the manpage for an invalid filename, > other than ENAMETOOLONG, which is clearly inappropriate. > > Perhaps the correct fix would just be to document the use of EINVAL? I slightly prefer this, but it would have to be limited to non-POSIX filesystems (there are no invalid characters for POSIX filenames except '\0', and '\0' is not really part of a filename; the POSIX error for the completely invalid filename "" is ENOENT). I just remembered some history: most of the manpages for syscalls that deal with pathames used to document setting errno to EINVAL if "The pathname contains a character with the high-order bit set". They did this long after the syscalls stopped actually doing this (e.g., in 4.4BSD-Lite). I find msdosfs's handling of attributes that have no meaning for msdosfs much more inconvenient than this. E.g., "cp -p" usually fails to preserve ownerships (because msdosfs's fake ownerships are usually different), and it fails to preserves file mtimes unless run by root (because utimes()'s permissions checks depend on ownwerships in a slightly different way than creat()'s permissions checks). OTOH, failure to set nonexistent file atimes and ctimes are silently ignored. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Dec 31 10:11: 4 2001 Delivered-To: freebsd-fs@freebsd.org Received: from cyberinfocomm.com (cyberinfocomm.com [210.107.128.94]) by hub.freebsd.org (Postfix) with ESMTP id 8655137B41D for ; Mon, 31 Dec 2001 10:11:01 -0800 (PST) Received: from odif87e5r6_[206.173.179.139] (ts003d31.eug-or.concentric.net [206.173.179.139]) by cyberinfocomm.com (8.9.3/8.9.3) with SMTP id DAA14687; Tue, 1 Jan 2002 03:05:18 +0900 From: dkmnsu76y_uhdf67@yahoo.com Received: from by odif87e5r6 with ESMTP; Mon, 31 Dec 2001 10:14:35 -0800 Message-ID: <0000055d1ddf$00005760$000039f6@> To: Subject: A wonderfully liberating discovery 14838 Date: Mon, 31 Dec 2001 10:14:32 -0800 MIME-Version: 1.0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 3D"Click
We strongly oppose the use of unsolicited email and do not want to send our mailings to anyone who does not wish to receive them. As = a result, we have provided this remove link for your convenience. This email is not unsolicited. If you do not wish to receive further mail= ings, please take a moment to CLICK HERE and simply hit "SEND". You may the= n rest-assured that you will never receive another email from us again. I.= D. # 0214310

To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message