<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39957 >

> [wsimpson - Sun Dec 09 22:15:45 2007]:
> 
> server/gamehand.c
>    handle_single_want_hack_req()
>      Sent send_ruleset_choices() when HACK is not successful.
>      Redundant send_conn_info() when HACK is not successful.
> 
> client/connectdlg_common.c
>    handle_single_want_hack_reply()
>      File should be deleted by server, client doesn't always have
> permission.
> 
> Implies every client request should have different file?
> 
> Really need different paradigm for 2.2, perhaps the AUTH system?
> 

We ameliorated this situation somewhat for warserver by
introducing/modifying the cmdlevels to:

  ALLOW_NONE = 0,     /* user may issue no commands at all */
  ALLOW_OBSERVER,     /* user may issue observer commands */
  ALLOW_BASIC,        /* user may issue basic commands - default */
  ALLOW_CTRL,         /* user may issue commands that affect game & 
users */
  ALLOW_ADMIN,        /* admin user */
  ALLOW_HACK,         /* user may issue *all* commands - dangerous! */

and implementing an ACL like system for assigning cmdlevels to
new connections based on action results:

  ACTION_BAN = 0,
  ACTION_GIVE_NONE,
  ACTION_GIVE_OBSERVER,
  ACTION_GIVE_BASIC,
  ACTION_GIVE_CTRL,
  ACTION_GIVE_ADMIN,
  ACTION_GIVE_HACK,

The ACL is a text file that gives the rules for computing the above
results per connection, e.g.:

ban   *.foo.com              # same as hostname=*.foo.com
ban   address=34.67.123.234
ctrl  username=book
admin address=127.0.0.1
basic *                      # everyone else gets basic 

Obviously before the ACL can be applied, AUTH must be enabled and
working and the hostname lookup must be completed. Now that I
think of it, it would probably better to make an ACL table in the
mysql database and load/save the rules from there.

I would not copy our implementation wholesale; there is lots of
cruft from older "experimental" versions bloating the ACL code, and
probably some bugs lurking around. But in the interests of sharing
our ideas and preventing you from re-inventing the wheel, I hope
this is of some help to you. :)

_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to