Re: [PATCH 4/4] policycoreutils -- Make restorecon return 0 when a file has changed context with no error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 26, 2012 at 11:45 AM, Laurent Bigonville <bigon@xxxxxxxxxx> wrote:
> Hi,
>
> restorecon should return 0 when a file has changed context with no
> error. With the last version it's returning 1.
>
> I'm not sure if a patch has already been proposed for this issue.
>
> Laurent
>
> Description: Make restorecon return 0 when a file has changed context with no error
> Author: Russell Coker <russell@xxxxxxxxxxxx>
> Last-Update: 2012-03-07
> Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662990
>
> ---
>  setfiles/restore.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/policycoreutils/setfiles/restore.c b/policycoreutils/setfiles/restore.c
> index 9a7d315..a378af0 100644
> --- a/policycoreutils/setfiles/restore.c
> +++ b/policycoreutils/setfiles/restore.c
> @@ -218,10 +218,9 @@ static int restore(FTSENT *ftsent)
>                        r_opts->progname, my_file, newcon, strerror(errno));
>                goto skip;
>        }
> -       ret = 1;
>  out:
>        freecon(newcon);
> -       return ret;
> +       return 0;
>  skip:
>        freecon(newcon);
>        return SKIP;

Is this right?  Don't we get to "out" from a number of error cases?
Do we always want 0?


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux