README: add link for automatic readme display
[sudo-osx-update.git] / patches / README_PATCHES.txt
blobf1f60c10c9a2d5d8a61e4ba998bfd94883e51936
1 ===========================
2 Apple Specific sudo Patches
3 ===========================
5 The Apple version of the sudo sources can be found on the Apple Open Source
6 site at http://opensource.apple.com/source/sudo/ in various subdirectories.
8 OS X version 10.4.11 and 10.5.8 uses sudo-28, OS X version 10.6.8 uses sudo-46
9 and OS X version 10.8.4 uses sudo-67.  OS X 10.7.5+security update and OS X
10 10.8.5 use sudo-67.1 and OS X 10.9.0 uses sudo-72.
12 The Apple sudo-16, sudo-17 and sudo-23 versions conveniently provide a set of
13 patches (in the patches subdirectory) against an official sudo release tarball.
14 The other Apple versions do not.
16 The patches in this directory were culled from sudo-28, sudo-46 and sudo-67
17 by examining the contents of the patches subdirectory (sudo-28) and/or
18 performing diffs against the related official sudo release tarball.  They were
19 then adjusted for use with the official sudo-1.7.10p7 release tarball.
21 The top-level build script will automatically apply all these patches before
22 building sudo.
24 Here's a summary of the patches provided:
27 0001-Add-BSM-auditing-support.patch.txt:
29 Most all of the Apple BSM auditing changes/fixes have been picked up by the
30 official sudo source releases in 1.7.10p7, however this patch does add a check
31 to prevent calling au_to_exec_args with a NULL pointer and two additional
32 audit_failure calls.
35 0002-Remove-sudoedit-and-sudoreplay-references.patch.txt:
37 This is a cosmetic patch.  The Apple version of sudo includes neither sudoedit
38 nor sudoreplay.  This patch removes references to those from the man page and
39 avoids installing them.
42 0003-Remove-login_cap-reference-from-man-page.patch.txt:
44 Another cosmetic patch.  OS X has no login_cap functions so this patch removes
45 the reference to such from the man page.
48 0004-Disable-tty_tickets-by-default.patch.txt
50 Not strictly required except to match existing OS X behavior.  This patch
51 changes the tty_tickets default from on to off (and updates the man page).
54 0005-Allow-admin-group-by-default.patch.txt
56 On OS X the root user is normally not enabled and the first user created is
57 made a member of the admin group which must be able to run sudo.  This patch
58 adds "%admin    ALL=(ALL) ALL" to the default sudoers file.
61 0006-Friendlier-warning-on-first-usage.patch.txt
63 The Apple management prefers a different warning on first use of sudo.  This
64 patch makes it so.  Only required to match pre-existing Apple sudo behavior.
67 0007-Clean-the-environment.patch.txt
69 The Apple version of sudo keeps both HOME and MAIL environment variables by
70 default and has an explicit (and somewhat smaller) list of environment
71 variables in the default sudoers file.  Only required to mirror pre-existing
72 Apple sudo behavior.
75 0008-Restore-sudoers-samples.patch.txt
77 The Apple version of sudo includes some additional "Samples" lines that are
78 commented out in the example sudoers file.  This patch restores them and is
79 strictly cosmetic.
82 0009-Do-not-close-fds-on-OS-X.patch.txt
84 The Apple version of sudo prefers to set the close-on-exec flag for file
85 descriptors that need to be closed when running the sudo child executable
86 rather than actually closing them in the parent process.  This may even be
87 Apple internal bug number 6497333 judging by the patch.  Presumably this patch
88 corrects some undesirable failure on OS X.  Also changes the location to read
89 the current list of open file descriptors from "/proc/self/fd" to "/dev/fd".
92 0010-Handle-EINTR-when-calling-tcsetattr.patch.txt
94 Apparently on OS X tcsetattr can return EINTR.  This patch handles this error
95 by retrying the call.  Only the tcsetattr in term_restore and term_noecho get
96 this treatment though.  Presumably this addresses an OS X specific failure.
99 0011-Do-not-quote-possible-meta-characters.patch.txt
101 With sudo versions 1.7.0-1.7.2*, using "sudo -s 'echo ${PWD+abc}'" will output
102 the string "abc".  Prior sudo versions do not invoke the shell with "-c" and
103 later versions escape anything that could possibly be a shell meta character by
104 preceding it with a '\' character.  When Apple switched to an sudo based on the
105 official sudo 1.7.4p6 release they included a patch to revert to the
106 1.7.0-1.7.2* behavior.  This patch implements that change in order to maintain
107 compatibility with Apple sudo behavior.  This really only matters if both the
108 sudo "-s" option is given AND following arguments are given.  This would seem
109 to likely be a corner case and is only required to mirror pre-existing Apple
110 sudo behavior.
113 0012-Allow-without-iologdir-configure-option-to-build.patch.txt
115 Even though the INSTALL option describes the --without-iologdir configure
116 option, attempting to use it causes exec.c to fail to build.  This patch
117 corrects the problem so "configure --without-iologdir" can be used
118 successfully.  This is a general fix that is not specific to OS X.