From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Steve G <linux_4ever@yahoo.com>, SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Latest patch for policycoreutils, reworked from previous.
Date: Mon, 18 Sep 2006 17:37:12 -0400 [thread overview]
Message-ID: <450F1188.9010603@redhat.com> (raw)
In-Reply-To: <1158611077.14194.65.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
> On Fri, 2006-09-15 at 09:25 -0400, Daniel J Walsh wrote:
>
>> Reworked patch.
>>
>> restorecon -v goes back to stdout
>>
>> added "verify" to print out files with out the verbose mode.
>>
>
> Hmm...just noticed this:
>
> diff --exclude-from=exclude --exclude='*.po' -N -u -r nsapolicycoreutils/restorecon/restorecon.c policycoreutils-1.30.29/restorecon/restorecon.c
> --- nsapolicycoreutils/restorecon/restorecon.c 2006-09-01 22:32:11.000000000 -0400
> +++ policycoreutils-1.30.29/restorecon/restorecon.c 2006-09-15 09:19:49.000000000 -0400
> @@ -249,7 +254,10 @@
> freecon(scontext);
> return 1;
> }
> - }
> + }
> + else
> + change_ctr++;
> +
>
>
> I don't think this is matching up with the right if statement; it
> currently matches if (change), so it only executes if restorecon is
> making no changes (-n option). Looks like you meant it to match the if
> (lsetfilecon(...) < 0).
>
> <snip>
> @@ -428,5 +445,7 @@
> if (outfile)
> fclose(outfile);
>
> + if (change) return change_ctr;
>
Yes this should be
if (!change) return change_ctr;
The idea is to check how many files would be changed if the tool was
run, as opposed to whether
the tool was successful.
I agree this is a little shaky.
> +
> return errors;
> }
>
> The problem here is that existing callers may assume that an exit status
> of non-zero means failure. Again, an interface change. How did you
> intend to use this?
>
>
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
prev parent reply other threads:[~2006-09-18 21:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-14 12:30 Latest patch for policycoreutils, reworked from previous Daniel J Walsh
2006-09-14 19:53 ` Stephen Smalley
2006-09-14 20:13 ` Steve G
2006-09-14 20:25 ` Stephen Smalley
2006-09-14 21:00 ` Steve G
2006-09-15 13:25 ` Daniel J Walsh
2006-09-15 21:03 ` Stephen Smalley
2006-09-18 20:24 ` Stephen Smalley
2006-09-18 21:37 ` Daniel J Walsh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=450F1188.9010603@redhat.com \
--to=dwalsh@redhat.com \
--cc=linux_4ever@yahoo.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.