summaryrefslogtreecommitdiffstats
path: root/lib/libugidfw
diff options
context:
space:
mode:
authoraraujo <araujo@FreeBSD.org>2015-06-24 01:48:44 +0000
committeraraujo <araujo@FreeBSD.org>2015-06-24 01:48:44 +0000
commitcce1064454bef10bbe1d0b8a157d4cdee65e95b7 (patch)
tree5bbf7b7dc00053f7e80d308779aa8b644c003bd5 /lib/libugidfw
parent8d3d80571c8b20ad80689a068e39f56b8fcfd442 (diff)
downloadFreeBSD-src-cce1064454bef10bbe1d0b8a157d4cdee65e95b7.zip
FreeBSD-src-cce1064454bef10bbe1d0b8a157d4cdee65e95b7.tar.gz
Set some internal helpers as static and initialize few variables to silence
CLANG WARNINGS. BUMP SHLIB_MAJOR version as the ABI potentially changed. Also run an 'exp run' to double check if any external project are using those functions. Thanks antoine@. PR: 200807 Differential Revision: D2775 Reviewed by: kib, ngie
Diffstat (limited to 'lib/libugidfw')
-rw-r--r--lib/libugidfw/Makefile2
-rw-r--r--lib/libugidfw/ugidfw.c19
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/libugidfw/Makefile b/lib/libugidfw/Makefile
index 2e09565..f11200d 100644
--- a/lib/libugidfw/Makefile
+++ b/lib/libugidfw/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
LIB= ugidfw
-SHLIB_MAJOR= 4
+SHLIB_MAJOR= 5
SRCS= ugidfw.c
INCS= ugidfw.h
diff --git a/lib/libugidfw/ugidfw.c b/lib/libugidfw/ugidfw.c
index 479ab46..a1e36d2 100644
--- a/lib/libugidfw/ugidfw.c
+++ b/lib/libugidfw/ugidfw.c
@@ -505,7 +505,7 @@ truncated:
return (-1);
}
-int
+static int
bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max,
size_t buflen, char *errstr){
struct passwd *pwd;
@@ -554,7 +554,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max,
return (0);
}
-int
+static int
bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max,
size_t buflen, char *errstr){
struct group *grp;
@@ -603,7 +603,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max,
return (0);
}
-int
+static int
bsde_parse_subject(int argc, char *argv[],
struct mac_bsdextended_subject *subject, size_t buflen, char *errstr)
{
@@ -612,7 +612,7 @@ bsde_parse_subject(int argc, char *argv[],
char *endp;
uid_t uid_min, uid_max;
gid_t gid_min, gid_max;
- int jid;
+ int jid = 0;
size_t len;
long value;
@@ -720,7 +720,7 @@ bsde_parse_subject(int argc, char *argv[],
return (0);
}
-int
+static int
bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr)
{
size_t len;
@@ -764,7 +764,7 @@ bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr)
return (0);
}
-int
+static int
bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr)
{
size_t len;
@@ -781,15 +781,15 @@ bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr)
return (0);
}
-int
+static int
bsde_parse_object(int argc, char *argv[],
struct mac_bsdextended_object *object, size_t buflen, char *errstr)
{
int not_seen, flags;
int current, neg, nextnot;
+ int type;
uid_t uid_min, uid_max;
gid_t gid_min, gid_max;
- int type;
struct fsid fsid;
size_t len;
@@ -797,6 +797,7 @@ bsde_parse_object(int argc, char *argv[],
flags = 0;
neg = 0;
nextnot = 0;
+ type = 0;
if (strcmp("not", argv[current]) == 0) {
not_seen = 1;
@@ -1101,7 +1102,7 @@ bsde_get_mib(const char *string, int *name, size_t *namelen)
return (0);
}
-int
+static int
bsde_check_version(size_t buflen, char *errstr)
{
size_t len;
OpenPOWER on IntegriCloud