diff options
author | Petr Pisar <ppisar@redhat.com> | 2011-05-12 13:13:56 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-05-16 17:39:33 +0200 |
commit | 3ad0b3622cf92989584097787323f00bc7a36c48 (patch) | |
tree | 60f203a986e4f36d5ae7723258cec91ab277ad0c /quota.c | |
parent | c3a392437a2ec4793f2b1112058de0c3b459b6fe (diff) |
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 <jack@suse.cz>
Diffstat (limited to 'quota.c')
-rw-r--r-- | quota.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -76,10 +76,10 @@ #define FL_SHOW_MNTPOINT 16384 #define FL_SHOW_DEVICE 32768 -int flags, fmt = -1; +static int flags, fmt = -1; char *progname; -void usage(void) +static void usage(void) { errstr( "%s%s%s%s%s", _("Usage: quota [-guqvswim] [-l | [-Q | -A]] [-F quotaformat]\n"), @@ -112,7 +112,7 @@ void usage(void) exit(1); } -void heading(int type, qid_t id, char *name, char *tag) +static void heading(int type, qid_t id, char *name, char *tag) { char *spacehdr; @@ -130,7 +130,7 @@ void heading(int type, qid_t id, char *name, char *tag) } } -void print_fs_location(struct dquot *q) +static void print_fs_location(struct dquot *q) { struct quota_handle *h = q->dq_h; @@ -172,7 +172,7 @@ void print_fs_location(struct dquot *q) } } -int showquotas(int type, qid_t id, int mntcnt, char **mnt) +static int showquotas(int type, qid_t id, int mntcnt, char **mnt) { struct dquot *qlist, *q; char *msgi, *msgb; |