News for hackers. Stuff that matters.
Re:Microsoft’s failed attempt on Debian packaging by Someone1234 on Tuesday June 12, 2018 @11:26AM (#17294168)
Edit: Just nevermind. I don't want to be the target of this hate train.
Re:Microsoft’s failed attempt on Debian packaging by JdeBP on Tuesday June 12, 2018 @11:50AM (#17294418)
Aside from the fact that it leaves a window where there is no /bin/sh on the system, because it is not using atomic replacement, that is not what the script is doing. This is a Debian package. /bin/sh has been the Debian Almquist shell for almost three quarters of a decade at this point.

* https://lists.debian.org/debian-release/2007/07/msg00027.htm...

* https://wiki.debian.org/BootProcessSpeedup#Using_a_faster_sy...

* https://wiki.debian.org/DashAsBinSh

* https://wiki.ubuntu.com/DashAsBinSh

* https://wiki.ubuntu.com/DashAsBinSh/Spec

Re:Microsoft’s failed attempt on Debian packaging by pjc50 on Tuesday June 12, 2018 @11:38AM (#17294296)
It's not a requirement for /bin/sh to point to bash, only that it be a POSIX shell. The user might have chosen "dash" instead, and the one guy out there who doesn't have "bash" installed might find his system no longer boots.
Re:Microsoft’s failed attempt on Debian packaging by jwilk on Tuesday June 12, 2018 @11:46AM (#17294370)
In Debian, bash is an essential package. You can assume it's always installed.
Re:Microsoft’s failed attempt on Debian packaging by kakwa_ on Tuesday June 12, 2018 @01:41PM (#17295759)
Not necessarily, imagine for example an embedded OS with only dash or busybox based on Debian.

Also, even with bash installed, bash doesn't always behave like sh does.

A common example is echo:

With /bin/sh on an OpenBSD:

>>>

kakwa@openbsd ~ sh -c 'echo "print\n"'

print

<new line>

>>>

With /bin/dash (aka /bin/sh on Debian)

>>>

kakwa@debian dash -c 'echo "print\n"'

print

<new line>

>>>

This is consistent so far.

But, now, with /bin/bash

>>>

kakwa@debian ~ » bash -c 'echo "print\n"'

print\n

>>>

That's why I tend to use printf more than echo in my shell scripts.

Also, I'm not a big fan of what RHEL/CentOS/Fedora does symlinking /bin/sh and /bin/bash. It blurs the line between bash and sh, which results a lot of scripts with a /bin/sh shebang containing bashism.

Re:Microsoft’s failed attempt on Debian packaging by dozzie on Tuesday June 12, 2018 @12:41PM (#17295024)
OK, fine, then don't add it to the Depends field. But don't replace randomly things with a symlink to bash just because it's installed. If the scripts fail because /bin/sh is not bash, update your fsckin' broken shee-bang line.
Re:Microsoft’s failed attempt on Debian packaging by teknopaul on Tuesday June 12, 2018 @11:55AM (#17294507)
You can make assumptions like that if the consequences are not serious. In this case boot fails next time if your assumption is wrong.
Re:Microsoft’s failed attempt on Debian packaging by dredmorbius on Tuesday June 12, 2018 @12:16PM (#17294746)
"Essential" is not some arbitrary assumption, but a term of art specific to Debian Policy, and a flag applied to specific packages:

Essential is defined as the minimal set of functionality that must be available and usable on the system at all times, even when packages are in the “Unpacked” state. Packages are tagged essential for a system using the Essential control field. The format of the Essential control field is described in Essential.

https://www.debian.org/doc/debian-policy/#essential-packages

Diversions are addressed in 3.9: https://www.debian.org/doc/debian-policy/#maintainer-scripts

Debian Policy, generally, tells package maintainers, not users, what they may or may not do. Several classes of conflict are listed in the document; Microsoft's scrips violate multiple requirements.

The goal and result of this ststem, arrived at over 21 years collaborative development (Policy was first published in August 1996) is a system which provides well over 60,000 packages and behaves surprisingly robustly from the user-administrator's perspective. Which is to say, there are few surprises.

Microsoft have violated multiple Policy requirements. This is considered a release-critical bug in distro packages for very good reasons.

Re:Microsoft’s failed attempt on Debian packaging by tankenmate on Tuesday June 12, 2018 @12:07PM (#17294647)
Re:Microsoft’s failed attempt on Debian packaging by _jal on Tuesday June 12, 2018 @11:40AM (#17294310)
Uh, I find unrelated software messing with my shell potentially catastrophic.

We absolutely blacklist software pulling crap like this - it is a loud, blinking demonstration that the packager is incompetent and will do other, potentially less obvious dangerous things out of ignorance or impatience. Or is there a darker explanation? Untrustworthy, in either case.