Closed DavidMarchant closed 6 years ago
It's worth noting that as a result of the same functionality you can now comma separate lists of nodes!
e.g. --node node1,node2,node4
is now valid
so :tada: :tada: i guess?
@DavidMarchant I have no problem with using --node
with multiple nodenames and genders-friendly format. There shouldn't be need for periods in hostnames either so it's all good to me.
Cheers, great :)
We can reasonably assume that a general user won't be trying to break the system. So a try-catch
block should be sufficient for the odd case.
@mjtko That is unless genders
could become the source of an injection attack?
I don't believe so as it is mainly doing expansions.
If we're passing unsanitized user input to external commands, we should certainly be testing for the possibility of an injection attack. Maybe it's a shlex
quoting thing again, worth a bit of testing around this to make sure!
In this case, we can take advantage of the fact that genders files have rather precise syntax. As commas and spaces have defined meanings, these shouldn't be allowed (in addition to anything dangerous).
EDIT: Commas are probably fine, BUT no spaces
This limits the valid characters to the genders file to: /a-Z0-9,[]/
It might just be easier to limit the input to those characters (possible with click
)? A try-catch
might still be required by some garbage edge cases.
We don't want to give the user the ability to define groups during the genders expansion (even though this wouldn't be an issue in itself).
Due the node range expansion introduced in https://github.com/alces-software/adminware/commit/be4c96f7ab8f69bf1ada932b98cf63aca0bee891 many values for --node now result in an error & a crash. This is due to the change to nodes being built into a genders file and then parsed with the '--expand' genders option - any invalid nodename breaks this process. Any nodename that contains a period is invalid
@ColonelPanicks please can you confirm to what extent this is an issue & if we need to re-implement functionality to allow nodenames w/ periods Either way I will surround this in a
try-except
block shortly