]> git.xonotic.org Git - xonotic/darkplaces.git/commit
Extend rcon_restricted_commands to contain more complex patterns:
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Apr 2008 09:49:21 +0000 (09:49 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Apr 2008 09:49:21 +0000 (09:49 +0000)
commit7c264b15aec2bfbcf52ea8498bb240c23458a54a
treef3b547e0737332171116848a25e4c9b32541142a
parentf1e1232cf780b967812811af3740067d822c7430
Extend rcon_restricted_commands to contain more complex patterns:

- Wildcards are supported. A * matches EXACTLY one arg. ? never matches
  whitespace. * wildcards match AT LEAST one character.
- Multi-word patterns are supported - they then match EXACTLY the command.
- Single-word non-wildcard patterns still match if the first word of the command matches.

Currently, there is no way to enforce that a command is used ONLY without any args.
Also, wildcard expressions currently NEVER match a command with quotes, as quotes
could subvert the argument restrictions.

Examples:

  foo * bar * *
  - matches: foo XXX bar XXX XXX
  - does not match: foo bar XXX XXX, foo XXX bar XXX XXX XXX, foo XXX bar XXX

  foo
  - matches: foo, foo XXX, foo XXX XXX
  - does not match: foobar

  foo bar
  - matches: foo bar
  - does not match: foo bar baz

  foo*bar
  - matches: foo42bar, foo1bar
  - does not match: foobar, foo bar

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8267 d7cf8633-e32d-0410-b094-e92efae38249
common.h
filematch.c
netconn.c