Skip to contentSkip to conversation

Revert "package/bash: add /bin/bash to /etc/shells"

PATCH New Arnout Vandecappelle (Essensium/Mind) 4 participants 4 messages Apr 17, 2018 – Apr 29, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "package/bash: add /bin/bash to /etc/shells"

Commit 4d279697af added /bin/bash to /etc/shells. In the default skeleton, however, /etc/shells doesn't exist, so in fact it creates this file, containing only /bin/bash. Therefore, when bash is selected, /bin/sh does not appear in /etc/shells and bash is the only shell allowed. Since /bin/sh is the shell that is used for root in the default skeleton's /etc/passwd, root is no longer able to log in.

The proper solution is to add all available shells to /etc/shells. For now, however, just revert commit 4d279697af as a stop-gap measure. That way, the default situation still works, and only people who update /etc/passwd with additional logins but don't update /etc/shells will suffer.

This reverts commit 4d279697afbf8fb295274784103be2b837113d5e.

---
This is for the 2018.02.x branch; master should take the series at
http://patchwork.ozlabs.org/project/buildroot/list/?series=24357
I believe that series is too invasive for the 2018.02.x branch.

---
 package/bash/bash.mk | 4 ----
 1 file changed, 4 deletions(-)
package/bash/bash.mk +0 -4
index e9384911a0..6e58f0fd64 100644
@@ -39,14 +39,10 @@ BASH_CONF_ENV += bash_cv_getenv_redef=yes
 endif
 endif
 
-# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
-# can reject the user connexion. See man shells.
 define BASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
 	rm -f $(TARGET_DIR)/bin/bashbug
-	grep -qsE '^/bin/bash' $(TARGET_DIR)/etc/shells \
-		|| echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
 endef
 
 $(eval $(autotools-package))
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 Revert "package/bash: add /bin/bash to /etc/shells"

Hi Arnout,

Le 17/04/2018 ? 12:01, Arnout Vandecappelle (Essensium/Mind) a ?crit?:

Quoted 7 lines

Commit 4d279697af added /bin/bash to /etc/shells. In the default skeleton, however, /etc/shells doesn't exist, so in fact it creates this file, containing only /bin/bash. Therefore, when bash is selected, /bin/sh does not appear in /etc/shells and bash is the only shell allowed. Since /bin/sh is the shell that is used for root in the default skeleton's /etc/passwd, root is no longer able to log in.

Quoted 5 lines

The proper solution is to add all available shells to /etc/shells. For now, however, just revert commit 4d279697af as a stop-gap measure. That way, the default situation still works, and only people who update /etc/passwd with additional logins but don't update /etc/shells will suffer.

This issue appear with dropbear as far I know.

Quoted 11 lines

This reverts commit 4d279697afbf8fb295274784103be2b837113d5e.

---
This is for the 2018.02.x branch; master should take the series at
http://patchwork.ozlabs.org/project/buildroot/list/?series=24357
I believe that series is too invasive for the 2018.02.x branch.

Agree, the work on /etc/shells is not complete without the entire series. I don't know if there is any blocker for this series. Hopefully it will be merged for 2018.05 :)

Best regards,
Romain

Quoted 24 lines
---
 package/bash/bash.mk | 4 ----
 1 file changed, 4 deletions(-)
package/bash/bash.mk +0 -4
index e9384911a0..6e58f0fd64 100644
@@ -39,14 +39,10 @@ BASH_CONF_ENV += bash_cv_getenv_redef=yes
 endif
 endif
 
-# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
-# can reject the user connexion. See man shells.
 define BASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
 	rm -f $(TARGET_DIR)/bin/bashbug
-	grep -qsE '^/bin/bash' $(TARGET_DIR)/etc/shells \
-		|| echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
 endef
 
 $(eval $(autotools-package))
#2 lore raw

PATCH 1/1 Revert "package/bash: add /bin/bash to /etc/shells"

In reply to Arnout Vandecappelle (Essensium/Mind)

Arnout, All,

On 2018-04-17 12:01 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 13 lines

Commit 4d279697af added /bin/bash to /etc/shells. In the default skeleton, however, /etc/shells doesn't exist, so in fact it creates this file, containing only /bin/bash. Therefore, when bash is selected, /bin/sh does not appear in /etc/shells and bash is the only shell allowed. Since /bin/sh is the shell that is used for root in the default skeleton's /etc/passwd, root is no longer able to log in.

The proper solution is to add all available shells to /etc/shells. For now, however, just revert commit 4d279697af as a stop-gap measure. That way, the default situation still works, and only people who update /etc/passwd with additional logins but don't update /etc/shells will suffer.

Quoted 6 lines

This reverts commit 4d279697afbf8fb295274784103be2b837113d5e.

Regards,
Yann E. MORIN.

Quoted 34 lines

---
This is for the 2018.02.x branch; master should take the series at
http://patchwork.ozlabs.org/project/buildroot/list/?series=24357
I believe that series is too invasive for the 2018.02.x branch.

---
 package/bash/bash.mk | 4 ----
 1 file changed, 4 deletions(-)
package/bash/bash.mk +0 -4
index e9384911a0..6e58f0fd64 100644
@@ -39,14 +39,10 @@ BASH_CONF_ENV += bash_cv_getenv_redef=yes
 endif
 endif
 
-# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
-# can reject the user connexion. See man shells.
 define BASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
 	rm -f $(TARGET_DIR)/bin/bashbug
-	grep -qsE '^/bin/bash' $(TARGET_DIR)/etc/shells \
-		|| echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
 endef
 
 $(eval $(autotools-package))
Signature · 6 lines
2.17.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 Revert "package/bash: add /bin/bash to /etc/shells"

In reply to Arnout Vandecappelle (Essensium/Mind)
Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:

Commit 4d279697af added /bin/bash to /etc/shells. In the default skeleton, however, /etc/shells doesn't exist, so in fact it creates this file, containing only /bin/bash. Therefore, when bash is selected, /bin/sh does not appear in /etc/shells and bash is the only shell allowed. Since /bin/sh is the shell that is used for root in the default skeleton's /etc/passwd, root is no longer able to log in.

The proper solution is to add all available shells to /etc/shells. For now, however, just revert commit 4d279697af as a stop-gap measure. That way, the default situation still works, and only people who update /etc/passwd with additional logins but don't update /etc/shells will suffer.

This reverts commit 4d279697afbf8fb295274784103be2b837113d5e.

Quoted 8 lines

---
This is for the 2018.02.x branch; master should take the series at
http://patchwork.ozlabs.org/project/buildroot/list/?series=24357
I believe that series is too invasive for the 2018.02.x branch.

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard