Original DBUS bindings for TQt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

201 lines
7.0KB

  1. The guidelines in this file are the ideals; it's better to send a
  2. not-fully-following-guidelines patch than no patch at all, though. We
  3. can always polish it up.
  4. Mailing list
  5. ===
  6. The D-BUS mailing list is message-bus-list@freedesktop.org; discussion
  7. of patches, etc. should go there.
  8. Security
  9. ===
  10. Most of D-BUS is security sensitive. Guidelines related to that:
  11. - avoid memcpy(), sprintf(), strlen(), snprintf, strlcat(),
  12. strstr(), strtok(), or any of this stuff. Use DBusString.
  13. If DBusString doesn't have the feature you need, add it
  14. to DBusString.
  15. There are some exceptions, for example
  16. if your strings are just used to index a hash table
  17. and you don't do any parsing/modification of them, perhaps
  18. DBusString is wasteful and wouldn't help much. But definitely
  19. if you're doing any parsing, reallocation, etc. use DBusString.
  20. - do not include system headers outside of dbus-memory.c,
  21. dbus-sysdeps.c, and other places where they are already
  22. included. This gives us one place to audit all external
  23. dependencies on features in libc, etc.
  24. - do not use libc features that are "complicated"
  25. and may contain security holes. For example, you probably shouldn't
  26. try to use regcomp() to compile an untrusted regular expression.
  27. Regular expressions are just too complicated, and there are many
  28. different libc's out there.
  29. - we need to design the message bus daemon (and any similar features)
  30. to use limited privileges, run in a chroot jail, and so on.
  31. http://vsftpd.beasts.org/ has other good security suggestions.
  32. Coding Style
  33. ===
  34. - The C library uses GNU coding conventions, with GLib-like
  35. extensions (e.g. lining up function arguments). The
  36. Qt wrapper uses KDE coding conventions.
  37. - Write docs for all non-static functions and structs and so on. try
  38. "doxygen Doxyfile" prior to commit and be sure there are no
  39. warnings printed.
  40. - All external interfaces (network protocols, file formats, etc.)
  41. should have documented specifications sufficient to allow an
  42. alternative implementation to be written. Our implementation should
  43. be strict about specification compliance (should not for example
  44. heuristically parse a file and accept not-well-formed
  45. data). Avoiding heuristics is also important for security reasons;
  46. if it looks funny, ignore it (or exit, or disconnect).
  47. Making a release
  48. ===
  49. To make a release of D-BUS, do the following:
  50. - check out a fresh copy from CVS
  51. - verify that the libtool versioning/library soname is
  52. changed if it needs to be, or not changed if not
  53. - update the file NEWS based on the ChangeLog
  54. - add a ChangeLog entry containing the version number
  55. you're releasing ("Released 0.3" or something)
  56. so people can see which changes were before and after
  57. a given release.
  58. - "make distcheck" (DO NOT just "make dist" - pass the check!)
  59. - if make distcheck fails, fix it.
  60. - once distcheck succeeds, "cvs commit"
  61. - if someone else made changes and the commit fails,
  62. you have to "cvs up" and run "make distcheck" again
  63. - once the commit succeeds, "cvs tag DBUS_X_Y_Z" where
  64. X_Y_Z map to version X.Y.Z
  65. - bump the version number up in configure.in, and commit
  66. it. Make sure you do this *after* tagging the previous
  67. release!
  68. - scp your tarball to freedesktop.org server and copy it
  69. to /srv/dbus.freedesktop.org/releases. This should
  70. be possible if you're in group "dbus"
  71. - update the wiki page http://www.freedesktop.org/Software/dbus by
  72. adding the new release under the Download heading. Then, cut the
  73. link and changelog for the previous that was there.
  74. - update the wiki page
  75. http://www.freedesktop.org/Software/DbusReleaseArchive pasting the
  76. previous release. Note that bullet points for each of the changelog
  77. items must be indented three more spaces to conform to the
  78. formatting of the other releases there.
  79. - post to dbus@lists.freedesktop.org announcing the release.
  80. Environment variables
  81. ===
  82. These are the environment variables that are used by the D-BUS client library
  83. DBUS_VERBOSE=1
  84. Turns on printing verbose messages. This only works if D-BUS has been
  85. compiled with --enable-verbose-mode
  86. DBUS_MALLOC_FAIL_NTH=n
  87. Can be set to a number, causing every nth call to dbus_alloc or
  88. dbus_realloc to fail. This only works if D-BUS has been compiled with
  89. --enable-tests.
  90. DBUS_MALLOC_FAIL_GREATER_THAN=n
  91. Can be set to a number, causing every call to dbus_alloc or
  92. dbus_realloc to fail if the number of bytes to be allocated is greater
  93. than the specified number. This only works if D-BUS has been compiled with
  94. --enable-tests.
  95. DBUS_TEST_MALLOC_FAILURES=n
  96. Many of the D-BUS tests will run over and over, once for each malloc
  97. involved in the test. Each run will fail a different malloc, plus some
  98. number of mallocs following that malloc (because a fair number of bugs
  99. only happen if two or more mallocs fail in a row, e.g. error recovery
  100. that itself involves malloc). This env variable sets the number of
  101. mallocs to fail.
  102. Here's why you care: If set to 0, then the malloc checking is skipped,
  103. which makes the test suite a heck of a lot faster. Just run with this
  104. env variable unset before you commit.
  105. Tests
  106. ===
  107. These are the test programs that are built if dbus is compiled using
  108. --enable-tests.
  109. dbus/dbus-test
  110. This is the main unit test program that tests all aspects of the D-BUS
  111. client library.
  112. dbus/bus-test
  113. This it the unit test program for the message bus.
  114. test/break-loader
  115. A test that tries to break the message loader by passing it randomly
  116. created invalid messages.
  117. "make check" runs all the deterministic test programs (i.e. not break-loader).
  118. "make check-coverage" is available if you configure with --enable-gcov and
  119. gives a complete report on test suite coverage. You can also run
  120. "test/decode-gcov foo.c" on any source file to get annotated source,
  121. after running make check with a gcov-enabled tree.
  122. Patches
  123. ===
  124. Please file them at http://bugzilla.freedesktop.org under component
  125. dbus, and also post to the mailing list for discussion. The commit
  126. rules are:
  127. - for fixes that don't affect API or protocol, they can be committed
  128. if any one qualified reviewer other than patch author
  129. reviews and approves
  130. - for fixes that do affect API or protocol, two people
  131. in the reviewer group have to review and approve the commit, and
  132. posting to the list is definitely mandatory
  133. - if there's a live unresolved controversy about a change,
  134. don't commit it while the argument is still raging.
  135. - regardless of reviews, to commit a patch:
  136. - make check must pass
  137. - the test suite must be extended to cover the new code
  138. as much as reasonably feasible
  139. - the patch has to follow the portability, security, and
  140. style guidelines
  141. - the patch should as much as reasonable do one thing,
  142. not many unrelated changes
  143. No reviewer should approve a patch without these attributes, and
  144. failure on these points is grounds for reverting the patch.
  145. The reviewer group that can approve patches: Havoc Pennington, Michael
  146. Meeks, Alex Larsson, Zack Rusin, Joe Shaw, Mikael Hallendal, Richard
  147. Hult, Owen Fraser-Green, Olivier Andrieu, Colin Walters.