Re: [Github-comments] [geany/geany] Domain socket error: Not working via sudo is a geany bug, not a feature or bug in sudo (#1150)

2016-09-17 Thread elextr
For the information of people who read this issue in the future.

It is mentioned above that some developers won't use Geany as root because of 
the risks.  But it was not explained what the risk is.

The risk is because, as Geany is an IDE, it has the capability to run random 
commands, and as it has a plugin interface, it can run random code.  If a root 
instance of Geany was to use the user configuration it could run, as root, 
commands or code installed as user.  This could be any rubbish a user was 
experimenting with, or it could be malicious code installed with user 
privileges.  Running user code as root is an archetypal  privilege escalation 
attack.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1150#issuecomment-247822120

Re: [Github-comments] [geany/geany] Allow plugins to get the data they set (#1234)

2016-09-17 Thread Matthew Brush
codebrainz commented on this pull request.



> @@ -554,6 +554,24 @@ void plugin_builder_connect_signals(GeanyPlugin *plugin,
 }
 
 
+/** Get the additional data that corresponds to the plugin.
+ *
+ * @param plugin The plugin provided by Geany
+ * @return The data corresponding to the plugin or @c NULL if none set.
+ *
+ * @since 1.29 (API 230)
+ *
+ * @see geany_plugin_set_data()
+ */
+gpointer geany_plugin_get_data(const GeanyPlugin *plugin)
+{
+   g_return_val_if_fail (plugin != NULL, NULL);
+   g_return_val_if_fail (PLUGIN_LOADED_OK (plugin->priv), NULL);

Look at [the function 
below](https://github.com/geany/geany/pull/1234/commits/84720babfbce2642289a8c038137402533e5d2c5#diff-68052c9feb0f8c0562bf6f40b8b19669R602)
 this one. I copied the pre-conditions but added an additional one for the 
`plugin != NULL` for good measure.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1234

Re: [Github-comments] [geany/geany] Allow plugins to get the data they set (#1234)

2016-09-17 Thread elextr
elextr commented on this pull request.



> @@ -554,6 +554,24 @@ void plugin_builder_connect_signals(GeanyPlugin *plugin,
 }
 
 
+/** Get the additional data that corresponds to the plugin.
+ *
+ * @param plugin The plugin provided by Geany
+ * @return The data corresponding to the plugin or @c NULL if none set.
+ *
+ * @since 1.29 (API 230)
+ *
+ * @see geany_plugin_set_data()
+ */
+gpointer geany_plugin_get_data(const GeanyPlugin *plugin)
+{
+   g_return_val_if_fail (plugin != NULL, NULL);
+   g_return_val_if_fail (PLUGIN_LOADED_OK (plugin->priv), NULL);

Indeed, but plugins are external code, and can pass bad parameters at any time. 
All functions in the API should be permanently checked.  (yes Geany is not 
consistent about that, but you can have the honour of being the first to get it 
right :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1234

Re: [Github-comments] [geany/geany] Allow plugins to get the data they set (#1234)

2016-09-17 Thread Matthew Brush
codebrainz commented on this pull request.



> @@ -554,6 +554,24 @@ void plugin_builder_connect_signals(GeanyPlugin *plugin,
 }
 
 
+/** Get the additional data that corresponds to the plugin.
+ *
+ * @param plugin The plugin provided by Geany
+ * @return The data corresponding to the plugin or @c NULL if none set.
+ *
+ * @since 1.29 (API 230)
+ *
+ * @see geany_plugin_set_data()
+ */
+gpointer geany_plugin_get_data(const GeanyPlugin *plugin)
+{
+   g_return_val_if_fail (plugin != NULL, NULL);
+   g_return_val_if_fail (PLUGIN_LOADED_OK (plugin->priv), NULL);

They check programming errors and so should be removed for non-debug builds.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1234

Re: [Github-comments] [geany/geany] Allow plugins to get the data they set (#1234)

2016-09-17 Thread elextr
elextr commented on this pull request.

Guess its reasonable to get the data you set :)

> @@ -554,6 +554,24 @@ void plugin_builder_connect_signals(GeanyPlugin *plugin,
 }
 
 
+/** Get the additional data that corresponds to the plugin.
+ *
+ * @param plugin The plugin provided by Geany
+ * @return The data corresponding to the plugin or @c NULL if none set.
+ *
+ * @since 1.29 (API 230)
+ *
+ * @see geany_plugin_set_data()
+ */
+gpointer geany_plugin_get_data(const GeanyPlugin *plugin)
+{
+   g_return_val_if_fail (plugin != NULL, NULL);
+   g_return_val_if_fail (PLUGIN_LOADED_OK (plugin->priv), NULL);

These should be normal `if(..)return val` because they should not be removable 
by compile option as the `g_...` checks are.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1234#pullrequestreview-466730

Re: [Github-comments] [geany/geany] Allow plugins to get the data they set (#1234)

2016-09-17 Thread Matthew Brush
Ammended to add `@see geany_plugin_set_data()` reference.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1234#issuecomment-247819073

[Github-comments] [geany/geany] Allow plugins to get the data they set (#1234)

2016-09-17 Thread Matthew Brush

You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/1234

-- Commit Summary --

  * Allow plugins to get the data they set

-- File Changes --

M src/plugindata.h (1)
M src/pluginutils.c (16)

-- Patch Links --

https://github.com/geany/geany/pull/1234.patch
https://github.com/geany/geany/pull/1234.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1234


Re: [Github-comments] [geany/geany] Add utils_get_real_path() and use it (#1224)

2016-09-17 Thread elextr
elextr commented on this pull request.

LGBI



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1224#pullrequestreview-466340

Re: [Github-comments] [geany/geany] Add "project-before-close" signal to API (#1223)

2016-09-17 Thread elextr
elextr approved this pull request.

LGTM



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1223#pullrequestreview-466296

Re: [Github-comments] [geany/geany] Add "project-before-close" signal to API (#1223)

2016-09-17 Thread Matthew Brush
If there are no objections, I will merge this "soon".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1223#issuecomment-247817103

Re: [Github-comments] [geany/geany] Add new API function to open a project file (#1222)

2016-09-17 Thread Matthew Brush
If there are no objections, I will merge this "soon".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1222#issuecomment-247817083

Re: [Github-comments] [geany/geany] Add utils_get_real_path() and use it (#1224)

2016-09-17 Thread Matthew Brush
If there are no objections, I will merge this "soon".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1224#issuecomment-247817059

[Github-comments] [geany/geany-plugins] git-changebar: Fix handling of documents with a Unicode BOM (#483)

2016-09-17 Thread Colomban Wendling
Properly restore the BOM in the document buffer before diffing it against the 
Git buffer, not to diff the missing BOM.

Fixes #482.
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany-plugins/pull/483

-- Commit Summary --

  * git-changebar: Fix handling of documents with a Unicode BOM

-- File Changes --

M git-changebar/src/gcb-plugin.c (52)

-- Patch Links --

https://github.com/geany/geany-plugins/pull/483.patch
https://github.com/geany/geany-plugins/pull/483.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/483


[Github-comments] [geany/geany-plugins] git-changebar: unicode BOM always shown as changed line (#482)

2016-09-17 Thread dpirch
If a UTF-8 file starts with a BOM character, the changebar plugin always shows 
the first line as changed even if there is no change.

To reproduce this, create a file with some lines of text, set encoding to UTF-8 
and set "Document -> Write Unicode BOM"; save the file and git add and commit. 
The changebar immediately (or when reloading the file) shows the first line as 
changed.

Geany 1.27 on Linux (ubuntu 16.04)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/482