bugFreeciv - Bugs: bug #20556, No way to disable hack access of...

Show feedback again

bug #20556: No way to disable hack access of new clients of local server with same user

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sun Feb 24 14:35:32 2013  
Category: clientSeverity: 1 - Wish
Priority: 5 - NormalStatus: Fixed
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: Operating System: None
Planned Release: 2.6.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Tue Aug 26 22:51:12 2014, SVN revision 26055:

Added commandline option "--Hackless" to client in debug builds. It allows to mimic
connection to remote server with local server.

Requested by Jacob Nevins

See bug #20556

(Browse SVN revision 26055)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun Aug 24 20:29:59 2014, comment #6:

Implementation that adds commandline parameter "--Hackless" to debug builds.

(file #21826)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue Jun 3 23:13:27 2014, comment #5:

> Is attached patch sufficient?

Mm. It's clearly better than nothing, and cheap, but to be honest I suspect I'd be more likely to actually use it if it didn't involve a slow configure-and-compile-from-scratch.

Points taken about the extra flexibility of doing it client-side rather than server-side, though.
I guess ideally I'd have a client option like "--no-hack Do not request 'hack' privileges when connecting to server (has no effect on locally spawned server)".

Jacob Nevins <jtn>
Project Administrator
Fri May 30 18:46:58 2014, comment #4:

I have probably missed something when reading your patch, sorry.

pepeto <pepeto>
Project Member
Fri May 30 06:49:02 2014, comment #3:

> If you connect a second client to the server, it will get hack
> access.

Um... no? Server is not spawned by that client either.
Unless you mean compiling second client without --disable-client-hack, but one would do that quite intentionally. Remember that this is not a security feature, but debug/testing feature. It's actually a valid use-case to test combination of hack and non-hack clients together.

> Why not using a server option (from command line) like
> "--hack"?

How spawned server could then tell the spawning client apart from others? Or, assuming test involving both hack and non-hack clients, how does it know should-allow-hack clients in general? That's why I think it should be in client side.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri May 30 06:36:44 2014, comment #2:

I don't think this is sufficient. If you connect a second client to the server, it will get hack access.

Why not using a server option (from command line) like "--hack"?

I would expect that client get hack access on its spawn one, but not if running the server separatly.

Maybe a second option for client side should be welcome to prevent to spawn the server with "--hack"?

pepeto <pepeto>
Project Member
Thu May 29 23:08:54 2014, comment #1:

Is attached patch sufficient?

It adds configure option --disable-client-hack. Behavior without this option (client-hack enabled) remains exactly the same. With the option (client-hack disabled) client will request hack access only if it has spawned the server itself.

(file #20858)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun Feb 24 14:35:32 2013, original submission:

When I'm testing Freeciv from my checkout, and I launch a server separately from the clients (to simulate a "real" client/server setup), all the clients automatically get 'hack' access.

It's possible to downgrade already-connected clients with a server command like 'cmdlevel basic', but this doesn't affect newly connecting clients.

This means it's hard (particularly for developers) to test the server the way a real network server would be run; clients with "hack" access get all sorts of random extra allowances (such as non-ASCII city names), so it would be easy to miss bugs impacting real use.

It needs to remain possible for local separate-server-and-client setups to use 'hack', or e.g. editing will become impossible in that scenario. Arguably it should remain the default behaviour (certainly it needs to be the default for client-spawned servers).

I think the easiest answer is a server option or similar that allows automatic hack access to be completely turned off. In this mode any single_want_hack_req from the client is ignored. (This option ought to be only changeable at 'hack' level, I think.)

In this mode, "hack" access would still be possible manually via /cmdlevel (e.g. from the console).

If not the default, for this to be useful developers have to remember to use it, but that's an improvement on the current situation.

Could have a server in this mode signal its unwillingness to play by returning a blank filename to the client in join_reply, but that requires a capability bump as existing clients will try to create the empty file. On stable branches it's harmless to have the client create the file and return you_have_hack=false anyway.

Might want to hide/disable/ignore this option for client-spawned servers, to stop single-player users getting themselves into trouble by getting it somehow saved it in their .freeciv-client-rc-X.X and being completely unable to start a controlled server.

Jacob Nevins <jtn>
Project Administrator


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #21826:  Hackless.patch added by cazfi (3kB - text/x-diff)
file #20858:  ClientHack.patch added by cazfi (2kB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by pepeto (Posted a comment)
  • -unavailable- added by cazfi (Updated the item)
  • -unavailable- added by jtn (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Aug 26 22:51:25 2014cazfiCategorygeneral=>client
      StatusReady For Test=>Fixed
      Assigned toNone=>cazfi
    Sun Aug 24 20:29:59 2014cazfiAttached File-=>Added Hackless.patch, #21826
    Thu May 29 23:08:54 2014cazfiAttached File-=>Added ClientHack.patch, #20858
      StatusNone=>Ready For Test
      Planned Release=>2.6.0
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup