Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation failure due to -Werror flag #4777

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docsrc/imap/concepts/deployment/storage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,3 @@ chunks, which may not be what you require at that moment.
.. _Cluster LVM: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/LVM_Cluster_Overview.html
.. _dm-cache: http://en.wikipedia.org/wiki/Dm-cache
.. _Kolab Systems AG: https://kolabsys.com

.. glossary::
MTBF
Mean Time Between Failures

.. glossary::
HBA
Host Bus Adapter - connects a host system (computer) to other network and storage devices
Thor-x86 marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 0 additions & 10 deletions docsrc/imap/concepts/features/server-aggregation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,3 @@ Back to :ref:`imap-features`

Including but not limited to ``SELECT``, ``UID MOVE``, ``RENAME``,
etc.

.. glossary::

frontend
the user interface

.. glossary::

backend
the server components
Thor-x86 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion imap/http_dav.c
Original file line number Diff line number Diff line change
Expand Up @@ -3816,7 +3816,7 @@ int parse_xml_body(struct transaction_t *txn, xmlNodePtr *root,
return HTTP_BAD_REQUEST;
}
else {
xmlErrorPtr err = xmlCtxtGetLastError(txn->conn->xml);
const xmlError *err = xmlCtxtGetLastError(txn->conn->xml);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ksmurchison can you have a look at this one please, I'm not familiar with the XML library.

In particular, a few lines later we save err->message in txn->error.desc. That might not be safe if we don't have lifetime ownership of the err object, which the constness might imply.

Since we aren't getting this warning/error outselves, perhaps this is an API change in the XML library that we haven't stumbled upon yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding const seems correct as that is what the API specifies. Since we're getting the error from the XML parser context, and there is a xmlCtxtResetLastError() function, I assume its safe to reference the error until we free the parser context.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an information, the Arch distribution uses libxml2 v2.12.3. I see the changes at libxml2 GitLab repository which related to this issue. This is what maintainer's say:

This is a slight break of the API, but users really shouldn't modify the global error struct. The goal is to make xmlLastError use static buffers for its strings eventually. This should warn people if they're abusing the struct.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding const seems correct as that is what the API specifies. Since we're getting the error from the XML parser context, and there is a xmlCtxtResetLastError() function, I assume its safe to reference the error until we free the parser context.

Alright, thanks for the clarification. Is there anything I can do?

if (err) {
xmlFreeDoc(doc);
txn->error.desc = err->message;
Expand Down