l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 20: Web Application Hacking: How to Make and Break Security on the Web
Next Installfest:
TBD
Latest News:
Oct. 10: LUGOD Installfests coming again soon
Page last updated:
2002 Mar 15 08:52

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Re: vfat and permissions - anyone seen this before?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Re: vfat and permissions - anyone seen this before?



>
>
>**Original Message**
>From: Ryan <ryan@mother.com>
>To: vox-tech@lists.lugod.org
>Subject: Re: [vox-tech] vfat and permissions - anyone seen this before?
>Date: Mon, 11 Mar 2002 18:24:34 -0800
>Reply-To: vox-tech@lists.lugod.org
>
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Vfat has some permission flags, hidden, system, archive, and read only.
>
>Perhaps you had one of these set?
>
>Windows usualy uses hidden and system to keep people from finding the sys=
>tem=20
>files to mess with them (windows won't let you see them unless you tell i=
>t to=20
>byy ajusting some settings.)
>
I thought of that but discounted it because I was always able to drag 
files into those directories under Windows.

However, when I got your answer, I did a little bit of experimentation 
using my roommate's computer, and a FAT formatted floppy disk. I touched 
two files and created two folders on that floppy and proceeded to make 
one of each read-only (using chmod -x):

drwxr-xr-x    2 bloom    bloom         512 Mar 11 19:16 dir1/
-rwxr-xr-x    1 bloom    bloom           0 Mar 11 19:16 file1*
-r-xr-xr-x    1 bloom    bloom           0 Mar 11 19:16 filetobereadonly*
dr-xr-xr-x    2 bloom    bloom         512 Mar 11 19:16 readonlydir/

I took the disk to my roommate's XP computer, and put it in. I looked at 
the files and folders that were read-only there, and the list didn't 
agree (although there were clearly some read-only files and dirs and 
some read-write files and dirs).

I found I was able to drag files into the read-only directories under 
windows, which may lend truth to the situation.

I was about to ask if anybody knew of official documenation about this, 
but then I found the kernel code that seems to explain this:

/*  /usr/src/linux/include/linux/msdos_fs.h line 192   */
#define MSDOS_MKMODE(a,m) (m & (a & ATTR_RO ? S_IRUGO|S_IXUGO : S_IRWXUGO))
(if the Read-Only attribute is set, permissions should be UMASK & 0555 
otherwise they should be UMASK & 0777 )

In the reverse direction,
#define MSDOS_MKATTR(m) ((m & S_IWUGO) ? ATTR_NONE : ATTR_RO)
if the file is not writable by everyone (it it isn't ugo+w) then the 
read-only bit will be set.

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.