mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Vfat increases file permissions
@ 2004-02-11 22:44 Steve G
  2004-02-12  1:52 ` Maciej Zenczykowski
  2004-02-12  5:53 ` Valdis.Kletnieks
  0 siblings, 2 replies; 3+ messages in thread
From: Steve G @ 2004-02-11 22:44 UTC (permalink / raw)
  To: linux-kernel

Hello,

I am wondering about something. Why is it that when I mount a
vfat floppy disk and copy a file to the disk, it becomes
executable?

[root@linux fd_test]# umask 277
[root@linux fd_test]# touch test.txt
[root@linux fd_test]# ls -l test.txt
-r--------    1 root     root            0 Feb 11 17:20 test.txt
[root@linux fd_test]# cp test.txt /mnt/floppy/
[root@linux fd_test]# ls -l /mnt/floppy/test.txt
-rwxrwxrwx    1 root     root            0 Feb 11 17:20
/mnt/floppy/test.txt

In the DOS world, not every file is executable. It uses the file
extention to decide if the file is executable. A text file is not
implicitly executable unless it has a .bat file extention.

Is the Linux implementation interpreting something that doesn't
actually exist in the original?

I am concerned about world writeable, executable files existing
on my floppies or USB devices that are formatted vfat. This seems
like a security concern to me.

Thanks,
Steve Grubb

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Vfat increases file permissions
  2004-02-11 22:44 Vfat increases file permissions Steve G
@ 2004-02-12  1:52 ` Maciej Zenczykowski
  2004-02-12  5:53 ` Valdis.Kletnieks
  1 sibling, 0 replies; 3+ messages in thread
From: Maciej Zenczykowski @ 2004-02-12  1:52 UTC (permalink / raw)
  To: Steve G; +Cc: linux-kernel


my fstab entry seems to work quite well:
/dev/hda1 /c vfat defaults,nosuid,nodev,quiet,umask=0000,showexec,noatime 0 0 # noexec

On Wed, 11 Feb 2004, Steve G wrote:

> Hello,
> 
> I am wondering about something. Why is it that when I mount a
> vfat floppy disk and copy a file to the disk, it becomes
> executable?
> 
> [root@linux fd_test]# umask 277
> [root@linux fd_test]# touch test.txt
> [root@linux fd_test]# ls -l test.txt
> -r--------    1 root     root            0 Feb 11 17:20 test.txt
> [root@linux fd_test]# cp test.txt /mnt/floppy/
> [root@linux fd_test]# ls -l /mnt/floppy/test.txt
> -rwxrwxrwx    1 root     root            0 Feb 11 17:20
> /mnt/floppy/test.txt
> 
> In the DOS world, not every file is executable. It uses the file
> extention to decide if the file is executable. A text file is not
> implicitly executable unless it has a .bat file extention.
> 
> Is the Linux implementation interpreting something that doesn't
> actually exist in the original?
> 
> I am concerned about world writeable, executable files existing
> on my floppies or USB devices that are formatted vfat. This seems
> like a security concern to me.
> 
> Thanks,
> Steve Grubb
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Vfat increases file permissions
  2004-02-11 22:44 Vfat increases file permissions Steve G
  2004-02-12  1:52 ` Maciej Zenczykowski
@ 2004-02-12  5:53 ` Valdis.Kletnieks
  1 sibling, 0 replies; 3+ messages in thread
From: Valdis.Kletnieks @ 2004-02-12  5:53 UTC (permalink / raw)
  To: Steve G; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

On Wed, 11 Feb 2004 14:44:33 PST, Steve G <linux_4ever@yahoo.com>  said:
> In the DOS world, not every file is executable. It uses the file
> extention to decide if the file is executable. A text file is not
> implicitly executable unless it has a .bat file extention.

Welcome to Linux, where files actually have permissions bits.  Of
course, the vfat filesystem doesn't have those bits, so we have to
invent something.  Sanest thing to do is just pretend all vfat
files are mode 0777...

> I am concerned about world writeable, executable files existing
> on my floppies or USB devices that are formatted vfat. This seems
> like a security concern to me.

mount -o noexec,nodev,nosuid /dev/floppy /mnt/floppy



[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-12  5:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-11 22:44 Vfat increases file permissions Steve G
2004-02-12  1:52 ` Maciej Zenczykowski
2004-02-12  5:53 ` Valdis.Kletnieks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®