mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Do not expose any file sharing if ${PUBLIC} is not set.
This commit is contained in:
		
							parent
							
								
									ec89223b22
								
							
						
					
					
						commit
						fd52be1dfb
					
				
					 1 changed files with 11 additions and 8 deletions
				
			
		
							
								
								
									
										19
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -587,7 +587,7 @@ function vm_boot() { | ||||||
|       echo " - SPICE:    Enabled" |       echo " - SPICE:    Enabled" | ||||||
|     else |     else | ||||||
|       echo -n " - SPICE:    On host:  spicy --title \"${VMNAME}\" --port ${SPICE_PORT}" |       echo -n " - SPICE:    On host:  spicy --title \"${VMNAME}\" --port ${SPICE_PORT}" | ||||||
|       if [ "${guest_os}" != "macos" ]; then |       if [ "${guest_os}" != "macos" ] && [ -n "${PUBLIC}"]; then | ||||||
|         echo -n " --spice-shared-dir ${PUBLIC}" |         echo -n " --spice-shared-dir ${PUBLIC}" | ||||||
|       fi |       fi | ||||||
|       echo "${FULLSPICY}" |       echo "${FULLSPICY}" | ||||||
|  | @ -595,11 +595,11 @@ function vm_boot() { | ||||||
|     fi |     fi | ||||||
| 
 | 
 | ||||||
|     # Reference: https://gitlab.gnome.org/GNOME/phodav/-/issues/5 |     # Reference: https://gitlab.gnome.org/GNOME/phodav/-/issues/5 | ||||||
|     if [ "${guest_os}" != "macos" ]; then |     if [ "${guest_os}" != "macos" ] && [ -n "${PUBLIC}"]; then | ||||||
|       echo " - WebDAV:   On guest: dav://localhost:9843/" |       echo " - WebDAV:   On guest: dav://localhost:9843/" | ||||||
|     fi |     fi | ||||||
| 
 | 
 | ||||||
|     if [ "${guest_os}" != "windows" ]; then |     if [ "${guest_os}" != "windows" ] && [ -n "${PUBLIC}"]; then | ||||||
|       echo -n " - 9P:       On guest: " |       echo -n " - 9P:       On guest: " | ||||||
|       if [ "${guest_os}" == "linux" ]; then |       if [ "${guest_os}" == "linux" ]; then | ||||||
|         echo "sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 ${PUBLIC_TAG} ~/Public" |         echo "sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 ${PUBLIC_TAG} ~/Public" | ||||||
|  | @ -607,7 +607,7 @@ function vm_boot() { | ||||||
|         # PUBLICSHARE needs to be world writeable for seamless integration with |         # PUBLICSHARE needs to be world writeable for seamless integration with | ||||||
|         # macOS. Test if it is world writeable, and prompt what to do if not. |         # macOS. Test if it is world writeable, and prompt what to do if not. | ||||||
|         echo "sudo mount_9p ${PUBLIC_TAG}" |         echo "sudo mount_9p ${PUBLIC_TAG}" | ||||||
|         if [ -n "${PUBLIC}" ] && [ "${PUBLIC_PERMS}" != "drwxrwxrwx" ]; then |         if [ "${PUBLIC_PERMS}" != "drwxrwxrwx" ]; then | ||||||
|           echo " - 9P:       On host:  chmod 777 ${PUBLIC}" |           echo " - 9P:       On host:  chmod 777 ${PUBLIC}" | ||||||
|           echo "             Required for macOS integration 👆" |           echo "             Required for macOS integration 👆" | ||||||
|         fi |         fi | ||||||
|  | @ -714,7 +714,7 @@ function vm_boot() { | ||||||
| 
 | 
 | ||||||
|   # https://wiki.qemu.org/Documentation/9psetup |   # https://wiki.qemu.org/Documentation/9psetup | ||||||
|   # https://askubuntu.com/questions/772784/9p-libvirt-qemu-share-modes |   # https://askubuntu.com/questions/772784/9p-libvirt-qemu-share-modes | ||||||
|   if [ "${guest_os}" != "windows" ]; then |   if [ "${guest_os}" != "windows" ] && [ -n "${PUBLIC}"]; then | ||||||
|       # shellcheck disable=SC2054 |       # shellcheck disable=SC2054 | ||||||
|       args+=(-fsdev local,id=fsdev0,path="${PUBLIC}",security_model=mapped-xattr |       args+=(-fsdev local,id=fsdev0,path="${PUBLIC}",security_model=mapped-xattr | ||||||
|              -device virtio-9p-pci,fsdev=fsdev0,mount_tag="${PUBLIC_TAG}") |              -device virtio-9p-pci,fsdev=fsdev0,mount_tag="${PUBLIC_TAG}") | ||||||
|  | @ -748,7 +748,11 @@ function vm_boot() { | ||||||
| 
 | 
 | ||||||
|   # If output is 'none' then SPICE was requested. |   # If output is 'none' then SPICE was requested. | ||||||
|   if [ ${OUTPUT} == "none" ]; then |   if [ ${OUTPUT} == "none" ]; then | ||||||
|     spicy --title "${VMNAME}" --port "${SPICE_PORT}" --spice-shared-dir "${PUBLIC}" "${FULLSPICY}" >/dev/null 2>&1 & |     if [ -n "${PUBLIC}"]; then | ||||||
|  |       spicy --title "${VMNAME}" --port "${SPICE_PORT}" --spice-shared-dir "${PUBLIC}" "${FULLSPICY}" >/dev/null 2>&1 & | ||||||
|  |     else | ||||||
|  |       spicy --title "${VMNAME}" --port "${SPICE_PORT}" "${FULLSPICY}" >/dev/null 2>&1 & | ||||||
|  |     fi | ||||||
|   fi |   fi | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -830,8 +834,7 @@ readonly DISK_MIN_SIZE=$((197632 * 8)) | ||||||
| readonly VERSION="2.2.3" | readonly VERSION="2.2.3" | ||||||
| 
 | 
 | ||||||
| # PUBLICSHARE is the only directory exposed to guest VMs for file | # PUBLICSHARE is the only directory exposed to guest VMs for file | ||||||
| # sharing via 9P and spice-webdavd. This path is not configurable. | # sharing via 9P, spice-webdavd and Samba. This path is not configurable. | ||||||
| PUBLIC="" |  | ||||||
| if command -v xdg-user-dir &>/dev/null; then | if command -v xdg-user-dir &>/dev/null; then | ||||||
|   PUBLIC=$(xdg-user-dir PUBLICSHARE) |   PUBLIC=$(xdg-user-dir PUBLICSHARE) | ||||||
|   if [ "${PUBLIC%/}" != ${HOME} ]; then |   if [ "${PUBLIC%/}" != ${HOME} ]; then | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue