mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-26 19:46:27 -08:00
The Taildrive file server for a share is started as the share's user with sudo, falling back to su. If neither works and tailscaled is root, userServer.run refuses to start it. On systems that ship neither tool, such as OpenWrt, a share created by root could therefore never be served: the run loop kept failing with `"root" is root` and remote peers saw an empty, unwritable share until sudo was installed. When the share's user is the user tailscaled is already running as, there is nothing to switch to, so run the file server directly. This is what `sudo -u root` already did where sudo is installed. Shares owned by any other user still go through sudo or su as before. Fixes #22413 Change-Id: Ied5f51e01183f90ef1f7d2ffc386847d9eea633a Signed-off-by: Sai Kumar Pola <[email protected]>