This file is indexed.

/usr/lib/python2.7/dist-packages/txdav/xml/rfc3253.py is in calendarserver 5.2+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
##
# Copyright (c) 2005-2014 Apple Computer, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
##

"""
RFC 3253 (Versioning Extensions to WebDAV) XML Elements

This module provides XML element definitions for use with WebDAV.

See RFC 3253: http://www.ietf.org/rfc/rfc3253.txt
"""

__all__ = []


from txdav.xml.base import WebDAVElement, WebDAVTextElement, dav_namespace
from txdav.xml.element import registerElement, registerElementClass


##
# Section 1
##

@registerElement
@registerElementClass
class Error (WebDAVElement):
    """
    Specifies an error condition. (RFC 3253, section 1.6)
    """
    # FIXME: RFC 3253 doesn't quite seem to define this element...
    # FIXME: Move when we update to RFC 2518bis
    name = "error"

    allowed_children = { WebDAVElement: (0, None) }


##
# Section 3
##

@registerElement
@registerElementClass
class Comment (WebDAVTextElement):
    """
    Property used to track a brief comment about a resource that is suitable for
    presentation to a user. On a version, can be used to indicate why that
    version was created. (RFC 3253, section 3.1.1)
    """
    name = "comment"
    hidden = True


@registerElement
@registerElementClass
class CreatorDisplayName (WebDAVTextElement):
    """
    Property which contains a description of the creator of the resource that is
    suitable for presentation to a user. (RFC 3253, section 3.1.2)
    """
    name = "creator-displayname"
    hidden = True


@registerElement
@registerElementClass
class SupportedMethod (WebDAVElement):
    """
    Property which identifies a method that is supported by a resource. A method
    is supported by a resource if there is some state of that resource for which
    an application of that method will successfully satisfy all postconditions
    of that method, including any additional postconditions added by the
    features supported by that resource. (RFC 3253, section 3.1.3)
    """
    name = "supported-method"
    hidden = True

    allowed_children = { WebDAVElement: (0, None) }
    allowed_attributes = { "name": True }


@registerElement
@registerElementClass
class SupportedMethodSet (WebDAVElement):
    """
    Property which identifies the methods that are supported by a resource. (RFC
    3253, section 3.1.3)
    """
    name = "supported-method-set"
    protected = True
    hidden = True

    allowed_children = { (dav_namespace, "supported-method"): (0, None) }


@registerElement
@registerElementClass
class SupportedLiveProperty (WebDAVElement):
    """
    Property which identifies a live property that is supported by a resource. A
    live property is supported by a resource if that property has the semantics
    defined for that property.  The value of this property must identify all
    live properties defined by this document that are supported by the resource
    and should identify all live properties that are supported by the resource.
    (RFC 3253, section 3.1.4)
    """
    name = "supported-live-property"

    # FIXME: Where is the name element defined?
    allowed_children = { (dav_namespace, "name"): (1, 1) }


@registerElement
@registerElementClass
class SupportedLivePropertySet (WebDAVElement):
    """
    Property which identifies the live properties that are supported by a
    resource. (RFC 3253, section 3.1.4)
    """
    name = "supported-live-property-set"
    hidden = True
    protected = True

    allowed_children = { (dav_namespace, "supported-live-property"): (0, None) }


@registerElement
@registerElementClass
class Report (WebDAVElement):
    """
    A report. (RFC 3253, section 3.1.5)
    """
    # FIXME: Section 3.1.5 is pretty low on information.  Where else do we look?
    name = "report"

    allowed_children = { WebDAVElement: (0, None) }


@registerElement
@registerElementClass
class SupportedReport (WebDAVElement):
    """
    Identifies a report that is supported by the resource.  (RFC 3253, section
    3.1.5)
    """
    name = "supported-report"

    #
    # FIXME:
    #
    #   RFC 3253, section 3.1.5 defines supported-report as:
    #
    #     <!ELEMENT supported-report report>
    #
    #   Which means that a report child element is required.  However, section
    # 3.6 defined a precondition with the same name (DAV:supported-report),
    # which means that, according to section 1.6.1, this XML must be issued if
    # the precondition fails:
    #
    #     <?xml version="1.0"?>
    #     <D:error xmlns:D="DAV:">
    #      <D:supported-report/>
    #     </D:error>
    #
    #   Which is a problem because here we use supported-report with no
    # children.
    #
    #   Absent any better guidance, we'll allow no children for this element for
    # the time being.
    #
    allowed_children = { (dav_namespace, "report"): (0, 1) }


@registerElement
@registerElementClass
class SupportedReportSet (WebDAVElement):
    """
    Property which identifies the reports that are supported by the resource.
    (RFC 3253, section 3.1.5)
    """
    name = "supported-report-set"
    hidden = True
    protected = True

    allowed_children = { (dav_namespace, "supported-report"): (0, None) }


@registerElement
@registerElementClass
class ExpandProperty (WebDAVElement):
    """
    Report which provides a mechanism for retrieving in one request the
    properties from resources identified by DAV:href property values.
    (RFC 3253, section 3.8)
    """
    name = "expand-property"

    allowed_children = { (dav_namespace, "property"): (0, None) }


@registerElement
@registerElementClass
class Property (WebDAVElement):
    """
    Identifies a property by name. (RFC 3253, section 3.8)
    Principal which matches a user if the value of the identified property of a
    resource contains at most one DAV:href element, the value of that element
    identifies a principal, and the user matches that principal. (RFC 3744,
    section 5.5.1)
    """
    name = "property"

    allowed_children = { (dav_namespace, "property"): (0, None) }
    allowed_attributes = {
        "name"      : True,
        "namespace" : False,
    }