/sbin/dhclient-script has bashisms

Bug #1448690 reported by Kevin Otte
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
isc-dhcp (Ubuntu)
Fix Released
High
Unassigned

Bug Description

/sbin/dhclient-script calls /bin/sh, which is of course dash, but contains bash-specific functions:

root@mystic:~# ifup br0
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/br0/00:1d:92:d7:ad:8a
Sending on LPF/br0/00:1d:92:d7:ad:8a
Sending on Socket/fallback
DHCPREQUEST of 172.31.3.6 on br0 to 255.255.255.255 port 67 (xid=0x7488da46)
DHCPACK of 172.31.3.6 from 172.31.3.4
RTNETLINK answers: File exists
bound to 172.31.3.6 -- renewal in 38988 seconds.
/sbin/dhclient-script: 55: /sbin/dhclient-script: shopt: not found
/sbin/dhclient-script: 60: /sbin/dhclient-script: [[: not found
/sbin/dhclient-script: 60: /sbin/dhclient-script: [[: not found
/sbin/dhclient-script: 68: /sbin/dhclient-script: shopt: not found
root@mystic:~# head -n1 /sbin/dhclient-script
#!/bin/sh
root@mystic:~#

Shebang line needs to be /bin/bash, or the script needs to be rewritten.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: isc-dhcp-client 4.3.1-5ubuntu2
ProcVersionSignature: Ubuntu 3.19.0-15.15-generic 3.19.3
Uname: Linux 3.19.0-15-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
Date: Sun Apr 26 10:29:56 2015
EcryptfsInUse: Yes
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: isc-dhcp
UpgradeStatus: Upgraded to vivid on 2015-04-24 (1 days ago)

Revision history for this message
Kevin Otte (nivex) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in isc-dhcp (Ubuntu):
status: New → Confirmed
Changed in isc-dhcp (Ubuntu):
importance: Undecided → Low
Revision history for this message
Thomas Ward (teward) wrote :

Note that because of the Bashisms whatever address was negotiated is not assigned. This applies at least to IPv6, and if the bashisms interfere in IPv4 then it also interferes there.

This means the essential function of the application does not operate, and the bug should potentially be a higher severity level. (I'm setting to High because it "renders essential features or functionality of the application or dependencies broken or ineffective" - which is defined as a "High" criterion in the Bug Importance page of the bugsquad documentation)

Changed in isc-dhcp (Ubuntu):
importance: Low → High
Revision history for this message
Benjamin Drung (bdrung) wrote :

I just checked it on Ubuntu 23.04:

```
shellcheck -e SC2086,SC2154 -s dash /sbin/dhclient-script
grep shopt /sbin/dhclient-script
```

This does not complain about any bashism. So I am marking the bug as fixed.

Changed in isc-dhcp (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.