> Hello Team,
>
> According to current functionality for configuration files: "From WebUI,
> config file comparison doesnt check for user, group and permissions".
> It displays compare results for only selinux and file content.
>
> Other way when checking from client side
> rhncfg-client verify
>
> It display diff results for user, group, permissions, selinux and file
> content
>
> Bugzilla - https://bugzilla.redhat.com/show_bug.cgi?id=1021930
>
> Attached the proposed patch to add User, mode and permissions diff results to
> web-UI similar to CLI.
> Please share your feedback on this.
>
> Thanks,
> Neha
Hello Neha.
I see lack of information regarding permission change as problematic too,
so time and thoughts you have invested into this issue is greatly appreciated
:-).
I have seen few example results of code you have provided, here are some rather
general thoughts:
* There is no formal specification of diff format beyond implementation.
Document that describes at least something and is from relevant source
[https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html]
is not very precise (or is there better source?). That complicates
things a little.
* Cited source says that "The unified output format starts with a two-line
header, which looks like this", introducing ambiguity (while based on that
wording I personally would say that patch must start with those two lines,
one of "referential" implementations (patch) accepts diffs that start
with "garbage" as long as valid header and chunks follows).
* So it looks like your solution would work:
* there is additional information for the user;
* information is gracefully ignored by `patch`, so it can be used.
But... there is too often "but" in my thoughts I'm afraid :-/
... "specification" is interpreted so that the "two-line header" must
be present and followed by at least one hunk. This is a complication,
as in case where only permissions are changed, your code would
produce output, that is not valid (by impolite language of patch
"only garbage was found in the patch input"). I can imagine all those
people complaining that lines we present to them as diff is not a
diff. Adding header without hunk would not help, and adding some
obscure hunk that would say that nothing has been changed (I haven't
tried that, so I do not know whether that would be possible or not)
is simply not good idea.
Another (I admit only hypothetical) thing to consider is, that
this being patch, someone might think that added part of file have
some semantic beyond being just a comment for reader/user.
Maybe some kind of separate meta-data that would describe the permissions
change? I wish I would have been able to help some more here.
As I said: those are only my thoughts. Maybe someone else would like
to add something or correct me in case I'm wrong.
Thanks again :-)
--
Matej Kollar
Satellite Engineering, Red Hat
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel