summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-08 14:39:57 +0200
committerLukas Nykryn <lnykryn@redhat.com>2020-02-06 10:41:56 +0100
commit73b87f8c73af714a32e7b56b217cd4e4f46a5ea7 (patch)
tree81aa4c274f87f3e60d5c27511b06408f12ee1328 /man
parent8efdae75ddf035c8c04983820f8d8cf767cc17b1 (diff)
downloadsystemd-73b87f8c73af714a32e7b56b217cd4e4f46a5ea7.tar.gz
sd-event: add sd_event_source_disable_unref() helper
(cherry picked from commit afd15bbb4b6414b9356799c63029e36642dae8e4) Related: CVE-2020-1712
Diffstat (limited to 'man')
-rw-r--r--man/rules/meson.build4
-rw-r--r--man/sd_event_source_unref.xml30
2 files changed, 22 insertions, 12 deletions
diff --git a/man/rules/meson.build b/man/rules/meson.build
index 989d11c9b9..7ae94ea265 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -340,7 +340,9 @@ manpages = [
['sd_event_source_set_userdata', '3', ['sd_event_source_get_userdata'], ''],
['sd_event_source_unref',
'3',
- ['sd_event_source_ref', 'sd_event_source_unrefp'],
+ ['sd_event_source_disable_unref',
+ 'sd_event_source_ref',
+ 'sd_event_source_unrefp'],
''],
['sd_event_wait',
'3',
diff --git a/man/sd_event_source_unref.xml b/man/sd_event_source_unref.xml
index d1b83c57aa..af8fed33f2 100644
--- a/man/sd_event_source_unref.xml
+++ b/man/sd_event_source_unref.xml
@@ -22,6 +22,7 @@
<refname>sd_event_source_unref</refname>
<refname>sd_event_source_unrefp</refname>
<refname>sd_event_source_ref</refname>
+ <refname>sd_event_source_disable_unref</refname>
<refpurpose>Increase or decrease event source reference counters</refpurpose>
</refnamediv>
@@ -45,6 +46,10 @@
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
+ <funcprototype>
+ <funcdef>sd_event_source* <function>sd_event_source_disable_unref</function></funcdef>
+ <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
+ </funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@@ -80,23 +85,26 @@
the passed event source object is
<constant>NULL</constant>.</para>
- <para>Note that event source objects stay alive and may be
- dispatched as long as they have a reference counter greater than
- zero. In order to drop a reference of an event source and make
- sure the associated event source handler function is not called
- anymore it is recommended to combine a call of
+ <para>Note that event source objects stay alive and may be dispatched as long as they have a reference
+ counter greater than zero. In order to drop a reference of an event source and make sure the associated
+ event source handler function is not called anymore it is recommended to combine a call of
<function>sd_event_source_unref()</function> with a prior call to
- <function>sd_event_source_set_enabled()</function> with
- <constant>SD_EVENT_OFF</constant>.</para>
+ <function>sd_event_source_set_enabled()</function> with <constant>SD_EVENT_OFF</constant> or call
+ <function>sd_event_source_disable_unref()</function>, see below.</para>
+
+ <para><function>sd_event_source_disable_unref()</function> combines a call to
+ <function>sd_event_source_set_enabled()</function> with <constant>SD_EVENT_OFF</constant> with
+ <function>sd_event_source_unref()</function>. This ensures that the source is disabled before the local
+ reference to it is lost. The <parameter>source</parameter> parameter is allowed to be
+ <constant>NULL</constant>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
- <para><function>sd_event_source_unref()</function> always returns
- <constant>NULL</constant>.
- <function>sd_event_source_ref()</function> always returns the
- event source object passed in.</para>
+ <para><function>sd_event_source_unref()</function> and
+ <function>sd_event_source_disable_unref()</function> always return <constant>NULL</constant>.
+ <function>sd_event_source_ref()</function> always returns the event source object passed in.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />