winboat icon indicating copy to clipboard operation
winboat copied to clipboard

[Bug] Files created in Winboat are owned by root

Open Jagholin opened this issue 2 months ago • 5 comments

What version of WinBoat are you running?

0.8.7 from aur/winboat-bin

Your Environment

OS: EndeavourOS x86_64 DE: KDE Plasma 6.5.1 FreeRDP version: 3.17.2, 2.11.7

Steps to Reproduce / Context

  1. Share home folder using switch in WinBoat UI
  2. In windows, create any file in the shared folder
  3. In linux, ls -l in the folder and check owner/group of the created file.

Logs

install.log winboat.log

Expected Behavior

new files having owner/group of the user that run WinBoat (or as an alternative the user that the shared folder belongs to)

Current Behavior

new files have user/group of root:root .

Yes I can run chown recursively if need be, but it's still an annoyance.

Possible Solution

No response

Quality Notice

  • [x] I have checked the issue tracker and verified that this bug is a unique case.

Jagholin avatar Oct 29 '25 13:10 Jagholin

Edit: I think this is possible with --user/its docker compose equivalent Edit x2: Nope, it doesn't seem like it, perhaps we'll have to wait for rootless podman support

auri-f5bde6 avatar Oct 29 '25 22:10 auri-f5bde6

We can also manually chroot the files, though I don't know how well that's work

Levev avatar Nov 01 '25 11:11 Levev

I think this might have something to do with this function in /run/samba.sh file:

addShare() {
  local dir="$1"
  local ref="$2"
  local name="$3"
  local comment="$4"

  mkdir -p "$dir" || return 1
  ls -A "$dir" >/dev/null 2>&1 || return 1

  if [ -z "$(ls -A "$dir")" ]; then
    chmod 777 "$dir" || return 1
  fi

  if [[ "$dir" == "$tmp" ]]; then

    {      echo "--------------------------------------------------------"
            echo " $APP for Docker v$(</run/version)..."
            echo " For support visit $SUPPORT"
            echo "--------------------------------------------------------"
            echo ""
            echo "Using this folder you can exchange files with the host machine."
            echo ""
            echo "To select a folder on the host for this purpose, include the following bind mount in your compose file:"
            echo ""
            echo "  volumes:"
            echo "    - \"./example:${ref}\""
            echo ""
            echo "Or in your run command:"
            echo ""
            echo "  -v \"\${PWD:-.}/example:${ref}\""
            echo ""
            echo "Replace the example path ./example with your desired shared folder, which then will become visible here."
            echo ""
    } | unix2dos > "$dir/readme.txt"

  fi

  {      echo ""
          echo "[$name]"
          echo "    path = $dir"
          echo "    comment = $comment"
          echo "    writable = yes"
          echo "    guest ok = yes"
          echo "    guest only = yes"
          echo "    force user = root"
          echo "    force group = root"
  } >> "/etc/samba/smb.conf"

  return 0
}

In particular, force user and force group parameters seem to be connected to the observed behavior. I wonder if we can change the assignment to root, or maybe, use inherit owner = unix only parameter instead ( https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#INHERITOWNER ). I can't check right now if this will work.

Jagholin avatar Nov 01 '25 13:11 Jagholin

In the short term, I have been getting around this by making copys of the files. Fortunately, all the files I generally need from windows applications are under 20mb.

kachapman avatar Nov 02 '25 22:11 kachapman

This has already been fixed in the latest version of the docker container, but WinBoat uses an older release.

I submitted a pull request to make WinBoat use the latest version: https://github.com/TibixDev/winboat/pull/473

kroese avatar Nov 06 '25 01:11 kroese