Skip to content

Commit 6b12e0d

Browse files
committed
Refactor: lib/services: ensure *.h declare externally hidden functions
...following the precedent of {upstart,systemd}.h. Note also that since hardening-related commit 658fff9 [$LD -z now], it's even more desirable to limit "symbol smog" as much as possible and symbols only used within the library like these are trivially expendable (assuming suitable toolchain). As we use G_GNU_C_INTERNAL macro from glib2, we should care to require at least that version that introduced it, i.e., 2.6 per documentation.
1 parent 5dc4937 commit 6b12e0d

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

lib/services/pcmk-dbus.h

+13
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,32 @@
1414
# define DBUS_TIMEOUT_USE_DEFAULT -1
1515
# endif
1616

17+
G_GNUC_INTERNAL
1718
DBusConnection *pcmk_dbus_connect(void);
19+
20+
G_GNUC_INTERNAL
1821
void pcmk_dbus_connection_setup_with_select(DBusConnection *c);
22+
23+
G_GNUC_INTERNAL
1924
void pcmk_dbus_disconnect(DBusConnection *connection);
2025

26+
G_GNUC_INTERNAL
2127
DBusPendingCall *pcmk_dbus_send(DBusMessage *msg, DBusConnection *connection,
2228
void(*done)(DBusPendingCall *pending, void *user_data), void *user_data, int timeout);
29+
30+
G_GNUC_INTERNAL
2331
DBusMessage *pcmk_dbus_send_recv(DBusMessage *msg, DBusConnection *connection, DBusError *error, int timeout);
32+
33+
G_GNUC_INTERNAL
2434
bool pcmk_dbus_type_check(DBusMessage *msg, DBusMessageIter *field, int expected, const char *function, int line);
35+
36+
G_GNUC_INTERNAL
2537
char *pcmk_dbus_get_property(
2638
DBusConnection *connection, const char *target, const char *obj, const gchar * iface, const char *name,
2739
void (*callback)(const char *name, const char *value, void *userdata), void *userdata,
2840
DBusPendingCall **pending, int timeout);
2941

42+
G_GNUC_INTERNAL
3043
bool pcmk_dbus_find_error(DBusPendingCall *pending, DBusMessage *reply,
3144
DBusError *error);
3245

lib/services/services_private.h

+14
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,44 @@ struct svc_action_private_s {
4545
#endif
4646
};
4747

48+
G_GNUC_INTERNAL
4849
GList *services_os_get_directory_list(const char *root, gboolean files, gboolean executable);
4950

51+
G_GNUC_INTERNAL
5052
gboolean services_os_action_execute(svc_action_t * op, gboolean synchronous);
5153

54+
G_GNUC_INTERNAL
5255
GList *resources_os_list_lsb_agents(void);
5356

57+
G_GNUC_INTERNAL
5458
GList *resources_os_list_ocf_providers(void);
5559

60+
G_GNUC_INTERNAL
5661
GList *resources_os_list_ocf_agents(const char *provider);
5762

63+
G_GNUC_INTERNAL
5864
GList *resources_os_list_nagios_agents(void);
5965

66+
G_GNUC_INTERNAL
6067
gboolean cancel_recurring_action(svc_action_t * op);
6168

69+
G_GNUC_INTERNAL
6270
gboolean recurring_action_timer(gpointer data);
71+
72+
G_GNUC_INTERNAL
6373
gboolean operation_finalize(svc_action_t * op);
6474

75+
G_GNUC_INTERNAL
6576
void services_add_inflight_op(svc_action_t *op);
6677

78+
G_GNUC_INTERNAL
6779
void handle_blocked_ops(void);
6880

81+
G_GNUC_INTERNAL
6982
gboolean is_op_blocked(const char *rsc);
7083

7184
#if SUPPORT_DBUS
85+
G_GNUC_INTERNAL
7286
void services_set_op_pending(svc_action_t *op, DBusPendingCall *pending);
7387
#endif
7488

pacemaker.spec.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ BuildRequires: coreutils findutils grep sed
190190

191191
# Required for core functionality
192192
BuildRequires: automake autoconf libtool pkgconfig libtool-ltdl-devel
193-
BuildRequires: pkgconfig(glib-2.0) libxml2-devel libxslt-devel libuuid-devel
193+
## version lower bound for: G_GNUC_INTERNAL
194+
BuildRequires: pkgconfig(glib-2.0) >= 2.6
195+
BuildRequires: libxml2-devel libxslt-devel libuuid-devel
194196
BuildRequires: bzip2-devel pam-devel
195197

196198
# Required for agent_config.h which specifies the correct scratch directory

0 commit comments

Comments
 (0)