linuxmuster / linuxmuster-linuxclient7

The new approach on connecting linuxclients to the Linuxmuster.net v7 Active Directory server.
3 stars 5 forks source link

Execution order of scripts in /etc/linuxmuster7-linuxclient #48

Closed lemertens closed 2 years ago

lemertens commented 2 years ago

The example script's name (00_example.sh) implies that scripts are executed in alphabetical order. This is is not ensured as os.listdir does not ensure any order ( as stated here: " The list is in arbitrary order, "). Example output of os.listdir ( Ubuntu 20.04)

>>> import os
>>> print (os.listdir('/tmp/test'))
['02_asd', '03_234', '01_a']
>>> 

I propose changing line 57 of hook.py from for fileName in os.listdir(hookDir): to for fileName in sorted(os.listdir(hookDir)):

dorianim commented 2 years ago

Feel free to open a pull request :)