From 3ad0b3622cf92989584097787323f00bc7a36c48 Mon Sep 17 00:00:00 2001 From: Petr Pisar Date: Thu, 12 May 2011 13:13:56 +0200 Subject: Make global symbols static as possible There are some calls (e.g. getpwnam(3)) that can lead to dlopening other libraries that could jump to symbol with name clashing to one of global quota symbols. (e.g. Name server switch plug-in nss_db calls dirname(3) that's already defined in edquota.c and tht can cause segmentation fault.) Although it's not possible to solve all these problems, making as much as possible global objects and functions static is the best thing we can do to avoid name space polution. Signed-off-by: Jan Kara --- quota_nld.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'quota_nld.c') diff --git a/quota_nld.c b/quota_nld.c index 538702d..de9504e 100644 --- a/quota_nld.c +++ b/quota_nld.c @@ -62,8 +62,8 @@ static struct nla_policy quota_nl_warn_cmd_policy[QUOTA_NL_A_MAX+1] = { #define FL_NODAEMON 4 #define FL_PRINTBELOW 8 -int flags; -DBusConnection *dhandle; +static int flags; +static DBusConnection *dhandle; static const struct option options[] = { { "version", 0, NULL, 'V' }, @@ -75,7 +75,7 @@ static const struct option options[] = { { NULL, 0, NULL, 0 } }; -void show_help(void) +static void show_help(void) { errstr(_("Usage: %s [options]\nOptions are:\n\ -h --help shows this text\n\ -- cgit v1.2.1