WUBI Ubuntu 8.04, access permissions on "/host" folder cannot be changed

Bug #236975 reported by Georgios Kolomvos

This bug report was converted into a question: question #35664: WUBI Ubuntu 8.04, access permissions on "/host" folder cannot be changed .

6
Affects Status Importance Assigned to Milestone
Wubi
Invalid
Undecided
Unassigned
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

I have installed Wubi Ubuntu 8.04 on the 12 computers of a school laboratory and i would like to change the access permissions of the folder that has all the "windows XP" files, so that the students that login, will not be able to make any damages to the windows system of the computers.
I tried to "chmod 700 /host" but although it seems that the command is executed correctly, the permissions of the folder are not changed. I also tried to change the owner from "root" to "my_user_name" (with chown) but happened the same result (it seemed that the command was executed but the owner remained "root"). The same happened when i tried to change the permissions and the owner to subfolders of "/host".

Changed in wubi:
status: New → Invalid
Revision history for this message
benmhall (ubuntu-linuxgruven) wrote :

Hello,

I am now facing the same problem. In the related question (#35664) Agostino Russo mentioned: "You might have to pass them as a kernel boot parameter in menu.lst via rootflags=YOURMOUNTOPTIONS"

Would it be possible for someone to provide a working an example of this? To be honest, I've looked in the usual places (mtab, fstab, menu.lst) and I can't see where /host is mounted. (When I say umount /host or mount -o remount /host the system says unmountable/unable to remount.) I would think that the loopback mount needs rw access to /host/ubuntu/disk/* but to make all files in /host 777 is maybe overkill... Any help out there?

Revision history for this message
benmhall (ubuntu-linuxgruven) wrote :

The mounting for /host is done in the initramfs, which makes this tricky (for me anyway) to track down. I've found a workaround for the problem:

Edit /usr/share/initramfs-tools/scripts/local-premount/root_locale

Append ,umask=022 to this line:

   echo ROOTFLAGS=\"${ROOTFLAGS}locale=$ROOT_LOCALE\" >> /conf/param.conf

so that it reads:

   echo ROOTFLAGS=\"${ROOTFLAGS}locale=$ROOT_LOCALE,umask=022\" >> /conf/param.conf

Save, run:

update-initramfs -k all -u

Reboot. /host will now be 755.

There may be a more appropriate place to make this change, but after hours of googling and poking around various scripts, that worked for me.

Revision history for this message
Andrew Flegg (aflegg) wrote :

A slightly neater way, rather than modifying root_locale is to add a new root_opts file:

1) Create "/usr/share/initramfs-tools/conf.d/root_opts" containing "export ROOTFLAGS" <----[ this is the root cause of step 2 not working alone]
2) Append "rootflags=gid=115,fmask=113,dmask=002" to the end of the "#kopt=" line in /boot/grub/menu.lst
3) Run "sudo update-initramfs -k all -u" and "sudo update-grub"

Revision history for this message
benmhall (ubuntu-linuxgruven) wrote :

Thank you for the update.

If I'm not wrong, this would make it easier for end-users to "tweak" permissions if you don't put a password on the grub menu entries (which you should do anyway, as otherwise unprivileged users could be dropped to a root shell)

I know it's a bit of security-through-obscurity and is certainly less flexible, but I think it might be safer to have the desired permissions hard-coded in the initramfs. Perhaps I'm worng/misguided. Wouldn't be the first time.

Anyway, either way it does the job. It'd be just fantastic if there was a nice little GUI that would do this for you (or at least documentation, which I guess is what this is now.) Alas, I'm not volunteering to do it. This workaround was my best effort.

Revision history for this message
Georgios Kolomvos (kolomvosg) wrote : Re: [Bug 236975] Re: WUBI Ubuntu 8.04, access permissions on "/host" folder cannot be changed

Thank you Andrew, these last instructions worked very well for me (I
applied them on the 12 windows XP machines with WUBI 8.04 that i have in
the computer lab of the school i work for as a teacher).

Georgios Kolomvos
Patras, Greece

Andrew Flegg:
> A slightly neater way, rather than modifying root_locale is to add a new
> root_opts file:
>
> 1) Create "/usr/share/initramfs-tools/conf.d/root_opts" containing "export ROOTFLAGS" <----[ this is the root cause of step 2 not working alone]
> 2) Append "rootflags=gid=115,fmask=113,dmask=002" to the end of the "#kopt=" line in /boot/grub/menu.lst
> 3) Run "sudo update-initramfs -k all -u" and "sudo update-grub"
>
>

Revision history for this message
Colin Watson (cjwatson) wrote :

I don't see why a separate 'export ROOTFLAGS' is necessary. init already exports ROOTFLAGS right up at the top, which is sufficient to export all later settings of it. If this doesn't work it's a shell bug, but one I can't reproduce in isolated testing on Intrepid.

Revision history for this message
Colin Watson (cjwatson) wrote :

Agostino points out that 'export ROOTFLAGS' was introduced in initramfs-tools in intrepid, so this was needed in hardy but is no longer needed in intrepid.

Revision history for this message
Agostino Russo (ago) wrote :

I think that Andrew is referring to a Hardy installation, where export ROOTFLAGS is required. This was corrected in Intrepid (0.92a), so there is no need for step 1 and 3 in 8.10. In intrepid, it should be sufficient to pass any required rootflags argument in menu.lst (step #2) and run update-grub. In hardy, follow Andrew's recipe above.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.