[GH-ISSUE #761] check_permissions.sh : add a check framework #610

Closed
opened 2026-02-27 02:02:38 +03:00 by kerem · 8 comments
Owner

Originally created by @UltimateByte on GitHub (Mar 15, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/761

Originally assigned to: @UltimateByte on GitHub.

check_permissions.sh : add a check framework
So that we can check a file or folder before trying to write on/in it.
https://github.com/dgibbs64/linuxgsm/blob/development/lgsm/functions/check_permissions.sh

Originally created by @UltimateByte on GitHub (Mar 15, 2016). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/761 Originally assigned to: @UltimateByte on GitHub. check_permissions.sh : add a check framework So that we can check a file or folder before trying to write on/in it. https://github.com/dgibbs64/linuxgsm/blob/development/lgsm/functions/check_permissions.sh
kerem 2026-02-27 02:02:38 +03:00
Author
Owner

@dgibbs64 commented on GitHub (Jul 12, 2016):

I have updated check_permissions.sh that it checks all files in rootdir. On my tests this took no time at all.

I think this may be all that is required for this function.

<!-- gh-comment-id:232072356 --> @dgibbs64 commented on GitHub (Jul 12, 2016): I have updated check_permissions.sh that it checks all files in rootdir. On my tests this took no time at all. I think this may be all that is required for this function.
Author
Owner

@UltimateByte commented on GitHub (Jul 12, 2016):

Mh... Couldn't be problematic for non SSD + many files combo ?

<!-- gh-comment-id:232202649 --> @UltimateByte commented on GitHub (Jul 12, 2016): Mh... Couldn't be problematic for non SSD + many files combo ?
Author
Owner

@dgibbs64 commented on GitHub (Jul 12, 2016):

I tested on my main server that uses a HDD and completed almost instantly :)

<!-- gh-comment-id:232203084 --> @dgibbs64 commented on GitHub (Jul 12, 2016): I tested on my main server that uses a HDD and completed almost instantly :)
Author
Owner

@dgibbs64 commented on GitHub (Jul 12, 2016):

[ FAIL ] Update LGSM nmrih-server-7: Permissions issues found
Infomation! The current user (nmrihserver) does not have ownership of the following files:
User  Group  File
root         root  /var/home/nmrihserver/skel
root         root  /var/home/nmrihserver/skel/serverfiles
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/nmrih-server.cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/mapchooser.cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/funcommands.cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/plugin.motdgd_adverts.cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/rtv.cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/randomcycle.cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/motd_text.txt
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/server.cfg
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/motd.txt
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/plugins
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/plugins/motdgd_adverts.smx
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting/motdgd_adverts.sp
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting/include
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting/include/SteamWorks.inc
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/configs
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/configs/admins_simple.ini
root         root  /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/configs/maplists.cfg
root         root  /var/home/nmrihserver/nmrihservermonitor
root         root  /var/home/nmrihserver/serverfiles/nmrih/cfg/nmrih-server.cfg
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/rockthevote.smx
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/randomcycle.smx
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/nominations.smx
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/mapchooser.smx
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/scripting/include/SteamWorks.inc
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/bin/sourcemod.2.bms.so
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/extensions/sdktools.ext.2.bms.so
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/extensions/sdkhooks.ext.2.bms.so
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/gamedata/core.games/engine.bms.txt
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/gamedata/sdkhooks.games/game.bms.txt
root         root  /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/gamedata/sdktools.games/game.bms.txt
    fetching core_exit.sh...OK

Output I just did fyi

<!-- gh-comment-id:232203301 --> @dgibbs64 commented on GitHub (Jul 12, 2016): ``` [ FAIL ] Update LGSM nmrih-server-7: Permissions issues found Infomation! The current user (nmrihserver) does not have ownership of the following files: User Group File root root /var/home/nmrihserver/skel root root /var/home/nmrihserver/skel/serverfiles root root /var/home/nmrihserver/skel/serverfiles/nmrih root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/nmrih-server.cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/mapchooser.cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/funcommands.cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/plugin.motdgd_adverts.cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/rtv.cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/sourcemod/randomcycle.cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/motd_text.txt root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/server.cfg root root /var/home/nmrihserver/skel/serverfiles/nmrih/cfg/motd.txt root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/plugins root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/plugins/motdgd_adverts.smx root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting/motdgd_adverts.sp root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting/include root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/scripting/include/SteamWorks.inc root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/configs root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/configs/admins_simple.ini root root /var/home/nmrihserver/skel/serverfiles/nmrih/addons/sourcemod/configs/maplists.cfg root root /var/home/nmrihserver/nmrihservermonitor root root /var/home/nmrihserver/serverfiles/nmrih/cfg/nmrih-server.cfg root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/rockthevote.smx root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/randomcycle.smx root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/nominations.smx root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/plugins/disabled/mapchooser.smx root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/scripting/include/SteamWorks.inc root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/bin/sourcemod.2.bms.so root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/extensions/sdktools.ext.2.bms.so root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/extensions/sdkhooks.ext.2.bms.so root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/gamedata/core.games/engine.bms.txt root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/gamedata/sdkhooks.games/game.bms.txt root root /var/home/nmrihserver/serverfiles/nmrih/addons/sourcemod/gamedata/sdktools.games/game.bms.txt fetching core_exit.sh...OK ``` Output I just did fyi
Author
Owner

@UltimateByte commented on GitHub (Jul 12, 2016):

Well, why not then. ^^

<!-- gh-comment-id:232203562 --> @UltimateByte commented on GitHub (Jul 12, 2016): Well, why not then. ^^
Author
Owner

@dgibbs64 commented on GitHub (Jul 12, 2016):

The only issue I had with my update to check_permissions.sh was I am unable to check group permissions as you can have multiple groups per user. Really complicates the checked but if a user has multiple groups then the admin is probably advanced enough not to need to check.

Unless you think anything more needs to be added I think we can close this one

<!-- gh-comment-id:232204021 --> @dgibbs64 commented on GitHub (Jul 12, 2016): The only issue I had with my update to check_permissions.sh was I am unable to check group permissions as you can have multiple groups per user. Really complicates the checked but if a user has multiple groups then the admin is probably advanced enough not to need to check. Unless you think anything more needs to be added I think we can close this one
Author
Owner

@UltimateByte commented on GitHub (Jul 12, 2016):

Well i had the same issue with multiple groups, so if you used the same method as my initial code, it makes sense. There might be a way but i don't have a great idea on how to check multiple groups.
Framework isn't needed if it checks the whole folder btw, so yeah, we can close this. ^^

<!-- gh-comment-id:232213428 --> @UltimateByte commented on GitHub (Jul 12, 2016): Well i had the same issue with multiple groups, so if you used the same method as my initial code, it makes sense. There might be a way but i don't have a great idea on how to check multiple groups. Framework isn't needed if it checks the whole folder btw, so yeah, we can close this. ^^
Author
Owner

@lock[bot] commented on GitHub (Jul 19, 2018):

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:406222037 --> @lock[bot] commented on GitHub (Jul 19, 2018): This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#610
No description provided.