From: <mil...@us...> - 2008-01-08 16:16:42
|
Revision: 2724 http://selinux.svn.sourceforge.net/selinux/?rev=2724&view=rev Author: millertc Date: 2008-01-08 08:16:39 -0800 (Tue, 08 Jan 2008) Log Message: ----------- Subject: quiet policycoreutils warnings Avoid using "log" as a variable name, it conflicts with the gcc log() builtin. Fix gcc uninitialized variable warning false positives. Signed-off-by: Todd C. Miller <tm...@tr...> Acked-by: Stephen Smalley <sd...@ty...> Modified Paths: -------------- trunk/policycoreutils/audit2why/audit2why.c trunk/policycoreutils/semodule/semodule.c trunk/policycoreutils/semodule_deps/semodule_deps.c trunk/policycoreutils/setfiles/setfiles.c Modified: trunk/policycoreutils/audit2why/audit2why.c =================================================================== --- trunk/policycoreutils/audit2why/audit2why.c 2008-01-08 16:15:19 UTC (rev 2723) +++ trunk/policycoreutils/audit2why/audit2why.c 2008-01-08 16:16:39 UTC (rev 2724) @@ -28,7 +28,7 @@ char *buffer = NULL, *bufcopy = NULL; unsigned int lineno = 0; size_t len = 0, bufcopy_len = 0; - FILE *fp; + FILE *fp = NULL; int opt, rc, set_path = 0; char *p, *scon, *tcon, *tclassstr, *permstr; sepol_security_id_t ssid, tsid; Modified: trunk/policycoreutils/semodule/semodule.c =================================================================== --- trunk/policycoreutils/semodule/semodule.c 2008-01-08 16:15:19 UTC (rev 2723) +++ trunk/policycoreutils/semodule/semodule.c 2008-01-08 16:16:39 UTC (rev 2724) @@ -339,8 +339,8 @@ for (i = 0; i < num_commands; i++) { enum client_modes mode = commands[i].mode; char *mode_arg = commands[i].arg; - char *data; - size_t data_len; + char *data = NULL; + size_t data_len = 0; if (mode == INSTALL_M || mode == UPGRADE_M || mode == BASE_M) { if ((data_len = map_file(mode_arg, &data)) == 0) { fprintf(stderr, Modified: trunk/policycoreutils/semodule_deps/semodule_deps.c =================================================================== --- trunk/policycoreutils/semodule_deps/semodule_deps.c 2008-01-08 16:15:19 UTC (rev 2723) +++ trunk/policycoreutils/semodule_deps/semodule_deps.c 2008-01-08 16:16:39 UTC (rev 2724) @@ -139,7 +139,7 @@ * of the policy. * - levels / cats: can't be required or used in modules. */ -static int generate_requires(policydb_t * p, hashtab_t * r) +static hashtab_t generate_requires(policydb_t * p) { avrule_block_t *block; avrule_decl_t *decl; @@ -154,7 +154,7 @@ mods = hashtab_create(reqsymhash, reqsymcmp, 64); if (mods == NULL) - return -1; + return NULL; for (block = p->global; block != NULL; block = block->next) { if (block->flags & AVRULE_OPTIONAL) @@ -196,14 +196,14 @@ reqsymcmp, 64); if (reqs == NULL) { - return -1; + return NULL; } ret = hashtab_insert(mods, mod_name, reqs); if (ret != SEPOL_OK) - return ret; + return NULL; } ret = hashtab_insert(reqs, req_name, @@ -211,16 +211,14 @@ if (! (ret == SEPOL_EEXIST || ret == SEPOL_OK)) - return -1; + return NULL; } } } } - *r = mods; - - return 0; + return mods; } static void free_requires(hashtab_t req) @@ -323,6 +321,7 @@ int verbose = 0, exclude_base = 1, command = SHOW_DEPS; char *basename; sepol_module_package_t *base, **mods; + policydb_t *p; hashtab_t req; while ((ch = getopt(argc, argv, "vgb")) != EOF) { @@ -383,10 +382,14 @@ exit(1); } - if (generate_requires - ((policydb_t *) sepol_module_package_get_policy(base), &req) < 0) + p = (policydb_t *) sepol_module_package_get_policy(base); + if (p == NULL) exit(1); + req = generate_requires(p); + if (req == NULL) + exit(1); + if (command == SHOW_DEPS) output_requirements(req, exclude_base, stdout); else Modified: trunk/policycoreutils/setfiles/setfiles.c =================================================================== --- trunk/policycoreutils/setfiles/setfiles.c 2008-01-08 16:15:19 UTC (rev 2723) +++ trunk/policycoreutils/setfiles/setfiles.c 2008-01-08 16:16:39 UTC (rev 2724) @@ -53,7 +53,7 @@ static int quiet = 0; static int ignore_enoent; static int verbose = 0; -static int log = 0; +static int logging = 0; static int warn_no_match = 0; static char *rootpath = NULL; static int rootpathlen = 0; @@ -519,7 +519,7 @@ } } - if (log && !user_only_changed) { + if (logging && !user_only_changed) { if (context) syslog(LOG_INFO, "relabeling %s from %s to %s\n", my_file, context, newcon); @@ -858,7 +858,7 @@ ignore_enoent = 1; break; case 'l': - log = 1; + logging = 1; break; case 'F': force = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |