
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
58 lines
1.3 KiB
Plaintext
58 lines
1.3 KiB
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
For https://docs.python.org/3/library/os.html#os.umask[os.umask]:
|
|
|
|
----
|
|
os.umask(0) # Sensitive
|
|
----
|
|
|
|
For https://docs.python.org/3/library/os.html#os.chmod[os.chmod], https://docs.python.org/3/library/os.html#os.lchmod[os.lchmod], and https://docs.python.org/3/library/os.html#os.fchmod[os.fchmod]:
|
|
|
|
----
|
|
os.chmod("/tmp/fs", stat.S_IRWXO) # Sensitive
|
|
os.lchmod("/tmp/fs", stat.S_IRWXO) # Sensitive
|
|
os.fchmod(fd, stat.S_IRWXO) # Sensitive
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
For https://docs.python.org/3/library/os.html#os.umask[os.umask]:
|
|
|
|
[source,python]
|
|
----
|
|
os.umask(0o777)
|
|
----
|
|
|
|
For https://docs.python.org/3/library/os.html#os.chmod[os.chmod], https://docs.python.org/3/library/os.html#os.lchmod[os.lchmod], and https://docs.python.org/3/library/os.html#os.fchmod[os.fchmod]:
|
|
|
|
[source,python]
|
|
----
|
|
os.chmod("/tmp/fs", stat.S_IRWXU)
|
|
os.lchmod("/tmp/fs", stat.S_IRWXU)
|
|
os.fchmod(fd, stat.S_IRWXU)
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|