Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use same shell across all Debian packaging scriptlets #7123

Open
legoktm opened this issue Feb 28, 2024 · 0 comments
Open

Use same shell across all Debian packaging scriptlets #7123

legoktm opened this issue Feb 28, 2024 · 0 comments

Comments

@legoktm
Copy link
Member

legoktm commented Feb 28, 2024

copied from freedomofpress/securedrop-client#1878

Description

We currently inconsistently use bash and dash (/bin/sh) when executing postinst/prerm/etc. scripts in Debian packaging:

user@dev ~/g/f/securedrop (develop)> rg bin/sh securedrop/debian/
securedrop/debian/securedrop-ossec-agent.postinst
1:#!/bin/sh

securedrop/debian/securedrop-app-code.postrm
1:#!/bin/sh

securedrop/debian/securedrop-ossec-server.postinst
1:#!/bin/sh

securedrop/debian/securedrop-config.postinst
1:#!/bin/sh

securedrop/debian/app-code/etc/apparmor.d/usr.sbin.apache2
103:  /usr/bin/shred rix,
user@dev ~/g/f/securedrop (develop)> rg bin/bash securedrop/debian/
securedrop/debian/securedrop-app-code.preinst
1:#!/bin/bash

securedrop/debian/securedrop-app-code.postinst
1:#!/bin/bash

securedrop/debian/securedrop-app-code.config
1:#!/bin/bash

In the case of securedrop-export.postrm, I had used bash syntax in freedomofpress/securedrop-client@a56b866 except it's shebang is plain /bin/sh, so it uses the POSIX dash shell, causing issues.

My preference is using bash everywhere unconditionally, using dash gives a small performance benefit but given the number of packages we're installing, it's pretty minor IMO (unlike across all of Debian) versus the nicer feature set of bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant