Halflife: Overwriting protected configs in 'writecfg' command

Created on 27 May 2019  路  9Comments  路  Source: ValveSoftware/halflife

The writecfg command has restrictions on writing configs that can be automatically executed when client or server starts. Their list includes:

config.cfg
autoexec.cfg
listenserver.cfg
server.cfg
userconfig.cfg
  1. The check can be bypassed by adding a forward slash to beginning of name:
] writecfg config
skipping writecfg output, invalid filename given
] writecfg /config
/config.cfg successfully created!
  1. I also suggest adding to the list language.cfg, since game client tries to execute this config at startup as well.

Most helpful comment

Thanks @Splatt581.
The list that will be blocked from writecfg is:

  • config.cfg
  • autoexec.cfg
  • listenserver.cfg
  • server.cfg
  • userconfig.cfg
  • language.cfg
  • violence.cfg
  • banned.cfg
  • listip.cfg
  • skill.cfg
  • game.cfg
  • joystick.cfg
  • hw/*.cfg

All 9 comments

HL1 also tries to execute violence.cfg on startup. It may still be worthwhile to add substring hw/ to list of blocked ones, so that configs for video cards that are on valve/hw/ path cannot be overwritten.

And also valve \ valve.rc

And also valve \ valve.rc

writecfg can only write files with .cfg extension, so valve.rc cannot be overwritten.

Once, after connecting with one unreliable REHLDS server, a line appeared in this file:
connect ip: port
Perhaps not these, but by some other workaround, it was rewritten from the server side. Therefore, it is also a good idea to fix it here. It also modifies or creates the file "joystick.cfg", which is also readable if available.

Fixed, this will be included in the next beta update.

game.cfg
joystick.cfg

I think this list should also include banned.cfg, which uses cvar bannedcfgfile by default and listip.cfg, where writeip command writes data. HL1 also executes skill.cfg in a singleplayer game.

I will summarize resulting list:

language.cfg
violence.cfg
hw/
joystick.cfg
game.cfg
banned.cfg
listip.cfg
skill.cfg

Thanks @Splatt581.
The list that will be blocked from writecfg is:

  • config.cfg
  • autoexec.cfg
  • listenserver.cfg
  • server.cfg
  • userconfig.cfg
  • language.cfg
  • violence.cfg
  • banned.cfg
  • listip.cfg
  • skill.cfg
  • game.cfg
  • joystick.cfg
  • hw/*.cfg

I confirm, fixed in 8254 build.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

twisterniq picture twisterniq  路  4Comments

Yetoo1 picture Yetoo1  路  3Comments

ptrBR picture ptrBR  路  3Comments

perforatorRU picture perforatorRU  路  3Comments

metita picture metita  路  3Comments