Skip to content

Instantly share code, notes, and snippets.

@rmi1974
Last active January 1, 2021 18:09
Show Gist options
  • Save rmi1974/a158b676b72f23043a08ff67a37e107d to your computer and use it in GitHub Desktop.
Save rmi1974/a158b676b72f23043a08ff67a37e107d to your computer and use it in GitHub Desktop.
How to mount a directory in HOME as no-exec #wine #commandlinefu

How to mount a directory in HOME as no-exec

To test broken applications, for example Wine Bugzilla #11661.

sudo mount --bind $HOME/.wine $HOME/.wine

sudo mount /home/focht/.wine -o remount,noexec
mount | grep home

/dev/mapper/luks-9a3155b7-c22b-4d00-8f68-c2285afc374e on /home type ext4 (rw,relatime,seclabel)
/dev/mapper/luks-9a3155b7-c22b-4d00-8f68-c2285afc374e on /home/focht/.wine type ext4 (rw,noexec,relatime,seclabel)

Test application with no-exec (should error out):

# copy the installer into .wine/drive_c as needed

# run the installer
wine ./vve201setup.exe
...
0024:err:virtual:map_file_into_view failed to set PROT_EXEC on file map, noexec filesystem?
0024:err:virtual:virtual_map_section mapping 0x1310000 174f000 000000000 failed

Revert:

sudo umount $HOME/.wine

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment