geany-plugins icon indicating copy to clipboard operation
geany-plugins copied to clipboard

lineoperations plugin: spurious "VALUE=<n>" printed on the standard output when geany starts

Open 3-14152898 opened this issue 4 months ago • 2 comments

After watching a security report on how to get hacked, I remembered seeing in a terminal, when I run Geany from the command line, the string

VALUE=0

As I'm suspicious by nature I wanted to investigate whether this would be the consequence of malicous activity on my machine (it was not, otherwise I wouldn't have reported this 😆 ). With strace I narrowed down the search after seeing plugin lineoperations being loaded, grabbing its configuration file, at which moment the string is written to the console. Looking up at the source code, it appears in function lo_init_prefs() and is, IMHO, a remnant of a previous debug attempt. Whatever, it has nothing to do there as it might, proof of that here above, rise suspicion as it doesn't (seem to) follow any Gtk message pattern.

Here's a patch I came up with to remove the "offending" line:

Spurious output of VALUE=0 on the standard output when starting Geany.

This is most probably a debugging remnant and should be removed as no
other plugin does (appear to) use the standard output.

--- old/lineoperations/src/lo_prefs.c	2025-08-24 12:31:55.672533102 +0200
+++ new/lineoperations/src/lo_prefs.c	2025-08-24 12:32:41.970729917 +0200
@@ -117,8 +117,6 @@
 	lo_info->use_collation_compare = utils_get_setting_boolean(config,
 		"general", "use_collation_compare", FALSE);
 
-	printf("VALUE: %d\n", lo_info->use_collation_compare);
-
 	g_key_file_free(config);
 }

I haven't verified the latest source tree but it seems to appear also in Geany 1.38 on a "recent" install of Linix Mint. And it happens with Geany 2.0 for sure.

Peace.

π

3-14152898 avatar Aug 24 '25 11:08 3-14152898

I won't download and open your ZIP archive.

Just create a fork and open a PR on this repository, or at least put the patch as plaintext here, like this:

```diff
diff --git a/src/keyfile.c b/src/keyfile.c
index c3b2ce17c..cff0cfbf8 100644
--- a/src/keyfile.c
+++ b/src/keyfile.c
@@ -108,6 +108,7 @@
 #define GEANY_MAX_SYMBOLS_UPDATE_FREQ	250
 #define GEANY_DEFAULT_FILETYPE_REGEX    "-\\*-\\s*([^\\s]+)\\s*-\\*-"
 
+just an example
 
 static gchar *scribble_text = NULL;
 static gint scribble_pos = -1;
```

eht16 avatar Aug 24 '25 13:08 eht16

I made it a zip file because that stupid GitHub web falsely claims to accept attachments as text files, patches and so on but stubbornly refuses to upload any of these (someone out there at github.com needs a lecture on usability, Geany repo is not the only one concerned)... I'll edit my post and show the text as plain.

Done.

3-14152898 avatar Aug 27 '25 08:08 3-14152898