IRCConnectEnabled is unexpectedly set to yes in znc.conf #52

Closed
opened 2026-10-05 03:56:22 +02:00 by adam · 5 comments
Owner

znc sets IRCConnectEnabled to true in znc.conf under several circumstances.

SetIRCConnectEnabled(true or false); is called when

  1. you execute "/znc jump, connect, or disconnect" (ClientCommand.cpp deals with it)
  2. you issue "/msg *admin reconnect or disconnect"
  3. CBlockUser::Block() is called
  4. CIRCNetwork::CIRCNetwork() is called

And IRCConnectEnabled is written to znc.conf when WriteConfig is called.
WriteConfig is called when

  1. you execute "/znc shutdown, restart, or saveconfig"
  2. znc receives SIGUSR1
  3. you save settings in webadmin.

Since I use webadmin frequently, this is a problem.

When znc is started, znc automatically connects to networks with IRCConnectEnabled set to yes.
But I don't want znc to automatically connect to any network when znc is started.
So I don't want znc to set IRCConnectEnabled to true in any circumstance.
But CIRCNetwork::Connect() refuses to connect if m_bIRCConnectEnabled is false.

How can I prevent znc from automatically connecting to networks?
I want to obtain manual control over whether and when znc connects to a network.

znc sets IRCConnectEnabled to true in znc.conf under several circumstances. SetIRCConnectEnabled(true or false); is called when 1) you execute "/znc jump, connect, or disconnect" (ClientCommand.cpp deals with it) 2) you issue "/msg *admin reconnect or disconnect" 3) CBlockUser::Block() is called 4) CIRCNetwork::CIRCNetwork() is called And IRCConnectEnabled is written to znc.conf when WriteConfig is called. WriteConfig is called when 1) you execute "/znc shutdown, restart, or saveconfig" 2) znc receives SIGUSR1 3) you save settings in webadmin. Since I use webadmin frequently, this is a problem. When znc is started, znc automatically connects to networks with IRCConnectEnabled set to yes. But I don't want znc to automatically connect to any network when znc is started. So I don't want znc to set IRCConnectEnabled to true in any circumstance. But CIRCNetwork::Connect() refuses to connect if m_bIRCConnectEnabled is false. How can I prevent znc from automatically connecting to networks? I want to obtain manual control over whether and when znc connects to a network. <!-- github-sync-id:2945379 -->
adam closed this issue 2026-10-05 03:56:22 +02:00
Author
Owner

Please can you tell me which commit you are having issues with because I recently rewrote the IRCConnectEnabled to fix some bugs.

Please can you tell me which commit you are having issues with because I recently rewrote the IRCConnectEnabled to fix some bugs. <!-- github-comment-id:3629656 -->
Author
Owner

I compiled the latest revision, and it doesn't seem to have this behavior.
I think I can close it now.

I compiled the latest revision, and it doesn't seem to have this behavior. I think I can close it now. <!-- github-comment-id:3630657 -->
Author
Owner

I'm reopening this issue since I found the exact cause of this issue.
The detail explanation is in the main article.

I'm reopening this issue since I found the exact cause of this issue. The detail explanation is in the main article. <!-- github-comment-id:3687598 -->
Author
Owner

Write a global module, which would prevent any connection between OnLoad and OnBoot, and which would set IRCConnectEnabled to false for every user in OnBoot.

It's not a bug at all, and therefore it won't be "fixed" in ZNC.

Write a global module, which would prevent any connection between OnLoad and OnBoot, and which would set IRCConnectEnabled to false for every user in OnBoot. It's not a bug at all, and therefore it won't be "fixed" in ZNC. <!-- github-comment-id:3689551 -->
Author
Owner

What znc assumes is that when you tell a user to "connect" is that you want to have it stay connected. That's why it's getting saved to the config file. One could argue that "connect" should only establish a temporary connection that would have to be reconnected manually in case it drops, but that's not the design we chose.

What znc assumes is that when you tell a user to "connect" is that you want to have it stay connected. That's why it's getting saved to the config file. One could argue that "connect" should only establish a temporary connection that would have to be reconnected manually in case it drops, but that's not the design we chose. <!-- github-comment-id:3690325 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#52