matanui159 / ReplaySorcery

An open-source, instant-replay solution for Linux
GNU General Public License v3.0
854 stars 27 forks source link

Can't save video due to always running as root #78

Closed kattjevfel closed 3 years ago

kattjevfel commented 3 years ago

Describe the bug Due to replay-sorcery always running as root, I cannot save the videos to a sensible directory that only my user has access to, and instead crashes when trying to save the video.

The folder in question is on a NFS share and root can't (nor should) access it.

Desktop:

Configuration: Default

Logs:

Dec 22 17:34:31 main replay-sorcery[35420]: Saving video to '/home/katt/Videos/ReplaySorcery_2020-12-22_17-34-31.mp4'...
Dec 22 17:34:31 main replay-sorcery[35420]: [mp4 @ 0x564e192ed380] Failed to open output: Permission denied
Dec 22 17:34:31 main replay-sorcery[35420]:  - /usr/src/debug/replay-sorcery/src/output.c:63 (rsOutputCreate)
Dec 22 17:34:31 main replay-sorcery[35420]:  - /usr/src/debug/replay-sorcery/src/main.c:73 (mainOutput)
Dec 22 17:34:31 main replay-sorcery[35420]:  - /usr/src/debug/replay-sorcery/src/main.c:186 (main)
Dec 22 17:34:31 main replay-sorcery[35420]: Segment violation
Dec 22 17:34:31 main replay-sorcery[35420]:  - /usr/src/debug/replay-sorcery/src/log.c:74 (logSignal)
Dec 22 17:34:31 main replay-sorcery[35420]:  - /usr/src/debug/replay-sorcery/src/output.c:156 (rsOutputDestroy)
Dec 22 17:34:31 main replay-sorcery[35420]:  - /usr/src/debug/replay-sorcery/src/main.c:105 (mainOutput)
Dec 22 17:34:31 main replay-sorcery[35420]:  - /usr/src/debug/replay-sorcery/src/main.c:186 (main)

Running replaysorcery ef4c6a2

matanui159 commented 3 years ago

The problem is I need it running as root for hardware acceleration. I might add a CMake option to remove the SETUID and SETGID flags.

matanui159 commented 3 years ago

I have added a RS_SETID CMake option that you can turn off to disable the SETUID and SETGID permissions. Do note that this will prevent you from being able to use hardware acceleration.