Advertisement
Guest User

Untitled

a guest
May 6th, 2017
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.71 KB | None | 0 0
  1. From 53d3b2046d81da6a867da2b9bbc22c6c3f01eee4 Mon Sep 17 00:00:00 2001
  2. From: Otavio Salvador <otavio@ossystems.com.br>
  3. Date: Wed, 20 May 2009 15:24:12 -0300
  4. Subject: [PATCH] Use a specific script by suite for setting the password. This restores the compatibility with Lenny through lenny-support package (that will provide the lenny.sh script).
  5.  
  6. ---
  7. packages/user-setup/debian/changelog | 8 ++++++
  8. packages/user-setup/debian/user-setup-udeb.install | 1 +
  9. packages/user-setup/debian/user-setup.install | 1 +
  10. packages/user-setup/scripts/default.sh | 20 ++++++++++++++
  11. packages/user-setup/scripts/lenny.sh | 11 ++++++++
  12. packages/user-setup/user-setup-apply | 27 +++++--------------
  13. 6 files changed, 48 insertions(+), 20 deletions(-)
  14. create mode 100644 packages/user-setup/scripts/default.sh
  15. create mode 100644 packages/user-setup/scripts/lenny.sh
  16.  
  17. diff --git a/packages/user-setup/debian/changelog b/packages/user-setup/debian/changelog
  18. index 6330ce7..2d181ed 100644
  19. --- a/packages/user-setup/debian/changelog
  20. +++ b/packages/user-setup/debian/changelog
  21. @@ -1,3 +1,11 @@
  22. +user-setup (1.26) UNRELEASED; urgency=low
  23. +
  24. + * Use a specific script by suite for setting the password. This restores
  25. + the compatibility with Lenny through lenny-support package (that will
  26. + provide the lenny.sh script).
  27. +
  28. + -- Otavio Salvador <otavio@ossystems.com.br> Wed, 20 May 2009 15:22:25 -0300
  29. +
  30. user-setup (1.25) unstable; urgency=low
  31.  
  32. * Brown paper bag release
  33. diff --git a/packages/user-setup/debian/user-setup-udeb.install b/packages/user-setup/debian/user-setup-udeb.install
  34. index 29c7804..f351806 100644
  35. --- a/packages/user-setup/debian/user-setup-udeb.install
  36. +++ b/packages/user-setup/debian/user-setup-udeb.install
  37. @@ -1,6 +1,7 @@
  38. user-setup-ask usr/bin
  39. user-setup-apply usr/bin
  40. functions.sh usr/lib/user-setup
  41. +scripts usr/lib/user-setup
  42. reserved-usernames usr/lib/user-setup
  43. finish-install.d usr/lib
  44. pre-pkgsel.d usr/lib
  45. diff --git a/packages/user-setup/debian/user-setup.install b/packages/user-setup/debian/user-setup.install
  46. index 1014600..4a10db2 100644
  47. --- a/packages/user-setup/debian/user-setup.install
  48. +++ b/packages/user-setup/debian/user-setup.install
  49. @@ -2,4 +2,5 @@ user-setup usr/bin
  50. user-setup-ask usr/lib/user-setup
  51. user-setup-apply usr/lib/user-setup
  52. functions.sh usr/lib/user-setup
  53. +scripts usr/lib/user-setup
  54. reserved-usernames usr/lib/user-setup
  55. diff --git a/packages/user-setup/scripts/default.sh b/packages/user-setup/scripts/default.sh
  56. new file mode 100644
  57. index 0000000..6de3488
  58. --- /dev/null
  59. +++ b/packages/user-setup/scripts/default.sh
  60. @@ -0,0 +1,20 @@
  61. +# Set a password, via chpasswd.
  62. +# Use a heredoc rather than echo, to avoid the password
  63. +# showing in the process table. (However, this is normally
  64. +# only called when first installing the system, when root has no
  65. +# password at all, so that should be an unnecessary precaution).
  66. +#
  67. +# Pass in three arguments: the user, the password, and 'true' if the
  68. +# password has been pre-crypted (by preseeding).
  69. +setpassword () {
  70. + local USER PASSWD OPTS
  71. + USER="$1"
  72. + PASSWD="$2"
  73. + if [ "$3" = true ]; then
  74. + $chroot $ROOT usermod --password=$PASSWD $USER
  75. + else
  76. + $chroot $ROOT chpasswd $OPTS <<EOF
  77. +$USER:$PASSWD
  78. +EOF
  79. + fi
  80. +}
  81. diff --git a/packages/user-setup/scripts/lenny.sh b/packages/user-setup/scripts/lenny.sh
  82. new file mode 100644
  83. index 0000000..5d95bd3
  84. --- /dev/null
  85. +++ b/packages/user-setup/scripts/lenny.sh
  86. @@ -0,0 +1,11 @@
  87. +setpassword () {
  88. + local USER PASSWD OPTS
  89. + USER="$1"
  90. + PASSWD="$2"
  91. + if [ "$3" = true ]; then
  92. + OPTS=-e
  93. + fi
  94. + $chroot $ROOT chpasswd $OPTS <<EOF
  95. +$USER:$PASSWD
  96. +EOF
  97. +}
  98. diff --git a/packages/user-setup/user-setup-apply b/packages/user-setup/user-setup-apply
  99. index 56b2357..aef5161 100755
  100. --- a/packages/user-setup/user-setup-apply
  101. +++ b/packages/user-setup/user-setup-apply
  102. @@ -16,26 +16,13 @@ fi
  103.  
  104. . /usr/lib/user-setup/functions.sh
  105.  
  106. -# Set a password, via chpasswd.
  107. -# Use a heredoc rather than echo, to avoid the password
  108. -# showing in the process table. (However, this is normally
  109. -# only called when first installing the system, when root has no
  110. -# password at all, so that should be an unnecessary precaution).
  111. -#
  112. -# Pass in three arguments: the user, the password, and 'true' if the
  113. -# password has been pre-crypted (by preseeding).
  114. -setpassword () {
  115. - local USER PASSWD OPTS
  116. - USER="$1"
  117. - PASSWD="$2"
  118. - if [ "$3" = true ]; then
  119. - $chroot $ROOT usermod --password=$PASSWD $USER
  120. - else
  121. - $chroot $ROOT chpasswd $OPTS <<EOF
  122. -$USER:$PASSWD
  123. -EOF
  124. - fi
  125. -}
  126. +suite=default
  127. +db_get mirror/suite
  128. +if [ -n "$RET" ] && [ -e /usr/lib/user-setup/scripts/$RET ]; then
  129. + suite="$RET"
  130. +fi
  131. +
  132. +. /usr/lib/user-setup/scripts/$suite.sh
  133.  
  134. # Enable/disable shadow passwords.
  135. db_get passwd/shadow
  136. --
  137. 1.6.3.1.54.g99dd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement