Skip to content

Commit

Permalink
Refactor: lib/services: ensure *.h declare externally hidden functions
Browse files Browse the repository at this point in the history
...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.
  • Loading branch information
jnpkrn committed Feb 10, 2017
1 parent 5dc4937 commit 6b12e0d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
13 changes: 13 additions & 0 deletions lib/services/pcmk-dbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@
# define DBUS_TIMEOUT_USE_DEFAULT -1
# endif

G_GNUC_INTERNAL
DBusConnection *pcmk_dbus_connect(void);

G_GNUC_INTERNAL
void pcmk_dbus_connection_setup_with_select(DBusConnection *c);

G_GNUC_INTERNAL
void pcmk_dbus_disconnect(DBusConnection *connection);

G_GNUC_INTERNAL
DBusPendingCall *pcmk_dbus_send(DBusMessage *msg, DBusConnection *connection,
void(*done)(DBusPendingCall *pending, void *user_data), void *user_data, int timeout);

G_GNUC_INTERNAL
DBusMessage *pcmk_dbus_send_recv(DBusMessage *msg, DBusConnection *connection, DBusError *error, int timeout);

G_GNUC_INTERNAL
bool pcmk_dbus_type_check(DBusMessage *msg, DBusMessageIter *field, int expected, const char *function, int line);

G_GNUC_INTERNAL
char *pcmk_dbus_get_property(
DBusConnection *connection, const char *target, const char *obj, const gchar * iface, const char *name,
void (*callback)(const char *name, const char *value, void *userdata), void *userdata,
DBusPendingCall **pending, int timeout);

G_GNUC_INTERNAL
bool pcmk_dbus_find_error(DBusPendingCall *pending, DBusMessage *reply,
DBusError *error);

Expand Down
14 changes: 14 additions & 0 deletions lib/services/services_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,44 @@ struct svc_action_private_s {
#endif
};

G_GNUC_INTERNAL
GList *services_os_get_directory_list(const char *root, gboolean files, gboolean executable);

G_GNUC_INTERNAL
gboolean services_os_action_execute(svc_action_t * op, gboolean synchronous);

G_GNUC_INTERNAL
GList *resources_os_list_lsb_agents(void);

G_GNUC_INTERNAL
GList *resources_os_list_ocf_providers(void);

G_GNUC_INTERNAL
GList *resources_os_list_ocf_agents(const char *provider);

G_GNUC_INTERNAL
GList *resources_os_list_nagios_agents(void);

G_GNUC_INTERNAL
gboolean cancel_recurring_action(svc_action_t * op);

G_GNUC_INTERNAL
gboolean recurring_action_timer(gpointer data);

G_GNUC_INTERNAL
gboolean operation_finalize(svc_action_t * op);

G_GNUC_INTERNAL
void services_add_inflight_op(svc_action_t *op);

G_GNUC_INTERNAL
void handle_blocked_ops(void);

G_GNUC_INTERNAL
gboolean is_op_blocked(const char *rsc);

#if SUPPORT_DBUS
G_GNUC_INTERNAL
void services_set_op_pending(svc_action_t *op, DBusPendingCall *pending);
#endif

Expand Down
4 changes: 3 additions & 1 deletion pacemaker.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ BuildRequires: coreutils findutils grep sed

# Required for core functionality
BuildRequires: automake autoconf libtool pkgconfig libtool-ltdl-devel
BuildRequires: pkgconfig(glib-2.0) libxml2-devel libxslt-devel libuuid-devel
## version lower bound for: G_GNUC_INTERNAL
BuildRequires: pkgconfig(glib-2.0) >= 2.6
BuildRequires: libxml2-devel libxslt-devel libuuid-devel
BuildRequires: bzip2-devel pam-devel

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

0 comments on commit 6b12e0d

Please sign in to comment.