Jump to content

Can windows permissions be changed from linux. Seems yes !!


Guest ndeb
 Share

Recommended Posts

I have a dual boot system:

linux-mandrake 9.0 (ext3)

win2k/SP2 (FAT32)

 

On linux, I have the win2k partition mounted as /mnt/windows (C: on win2k). I noticed that the default permissions on /mnt/windows allows even a non-root user to write, which is not good at all as I do not want to accidentally delete any win2k system files. So I tried (as root) using chmod to change the permissions on /mnt/windows. Now, ls -l always shows the root and non-root permissions for /mnt/windows to be the same. In other words, if I try for a mode of 755, all I get is rwxrwxrwx !! Similarly, if I try 700, I still get rwxrwxrwx for /mnt/windows. Therefore, the only command that worked was chmod -R 500 /mnt/windows, which gave me r-xr-xr-x on /mnt/windows. Very surprisingly, this gave read-write permission to root while giving read-only access to non-root users. Why the permissions setup of /mnt/windows (FAT32 filesystem) is so weird is beyond my knowledge now.

 

The real problem happenned when I booted to win2k, which now was restricted to a virtual memory (swap space) of 20MB, because (I found out after a lot of debugging) the swap file C:pagefile.sys had become read-only. Such a small swap made win2k booting very slow. Once I made C:pagefile.sys writable (on win2k), the swap size problem went away (it got set to the default of 256MB). In fact, even after making the win2k swap file writable, the boot process was still slow, so I booted to linux, did chmod -R 700 /mnt/windows and when I rebooted to win2k again, the boot up was fast (normal speed).

 

What I am worried about is that I changed the permissions of the files in /mnt/windows to r-xr-xr-x from within linux and that made these files read-only to win2k so much so that even the swap file could not be written into by win2k !! And similarly, when I made them writable (rwxrwxrwx) from within linux, they became writable on win2k and all problems (swap size and slow boot up of win2k) went away. Basically, file permissions set by linux on a FAT32 partition are being recognized by win2k. Why ?

 

Just as note, I did the same experiment on a redhat-8.0/win2k machine and there, chmod simply failed to change the permissions from 777 to 755 with a lot of error messages. Basically, redhat-8.0 refused to alter permissions of files on a FAT32 filesystem (which is much better than my experience with mandrake-9.0 and win2k).

 

I hope somebody can explain this permission drama with FAT32.

Link to comment
Share on other sites

I got some info from http://www.itc.virginia.edu/homedir/hdloginlinux.html , which explains the issue of linux file permissions on fat32:

 

When you inspect HDS file permissions from Linux using the ls -l command, you do not get accurate information because CIFS cannot provide this information. Linux just fills it in. You are listed as the owner of every file, and the group is always root. The file permissions are fictitious. 

 

You can use the chmod command on Linux to modify the permissions of HDS files, but it doesn't work like you think. In a fat32 file system, each file has a readonly bit and the HDS file servers implement this bit, but it is separate from the Unix permissions. If you enable the readonly bit from CIFS, it has the side effect of disabling all Unix write permissions. If you disable the readonly bit from CIFS, it restores any underlying Unix write permissions. So the Linux chmod command can only manipulate the readonly bit on HDS files, which may or may not do what you want.

 

I guess this explains my experience quite well. But this also means that from linux, one can change the readonly status of windows system files (on a fat32 file system). Does that mean a linux virus can also infect ur windows files ?

Link to comment
Share on other sites

I got what I wanted (rwxr-xr-x on /mnt/windows) by changing the umask value to 022 (from the mandrake default of 0) in the entry that mounts /mnt/windows in the file /etc/fstab.

My old entry was:

/dev/hda1 /mnt/windows vfat iocharset=iso8859-1,codepage=850,umask=0 0 0
while my current entry is:
/dev/hda1 /mnt/windows vfat iocharset=iso8859-1,codepage=850,umask=022 0 0

 

Got this idea from http://lists.suse.com/archive/suse-linux-e...0-Feb/0217.html .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...