#873133 isc-dhcp-client: dhclient-scripts executes dhclient-{enter,exit}-hooks when it should not

Package:
isc-dhcp-client
Source:
isc-dhcp
Description:
DHCP client for automatically obtaining an IP address
Submitter:
"Timo Sigurdsson"
Date:
2026-08-05 17:34:11 UTC
Severity:
normal
#873133#5
Date:
2017-08-24 19:17:38 UTC
From:
To:
Dear Maintainer,

I noticed that dhclient-script does not honor the executability flag of
either /etc/dhcp/dhclient-{enter,exit}-hooks or files inside the directories
/etc/dhcp/dhclient-{enter,exit}-hooks.d/ and will execute even non-executable
files by sourcing them. This is not supposed to happen according to the
dhclient-script man page.

Quote from the man page:
  [dhclient-script] checks for the presence of an executable
  /etc/dhcp/dhclient-enter-hooks script, and if present, it invokes the
  script inline, using the Bourne shell '.' command. It also invokes all
  executable scripts in /etc/dhcp/dhclient-enter-hooks.d/* in the same way.

The passage on the exit-hooks reads likewise.

However, dhclient-script does not actually check the executability of any of
these files. The run-hook function in dhclient-script only checks whether the
argument is a file and then sources it, see lines 144-145 of dhclient-script:
  if [ -f $script ]; then
    . $script

In addition, the run-hookdir function also iterates over files that are not
executable, see line 162:
  for script in $(run-parts --list $dir); do

The problem here is the list switch of run-parts. Quote from the run-parts
man page:
  --list print the names of the all matching files (not limited to
         executables), but don't actually run them.

It would be better to use the --test switch here instead which will only
print the names of executable files in the folder without actually running
them.

Thus, a fix should be rather trivial to get dhclient-script to actually
invoke executables only.

On a sidenote, though, on my rather fresh installation of Debian Stretch, I
have several files inside /etc/dhcp/dhclient-exit-hooks.d/ that are not
executable by default such as
  debug
  timesyncd
  rfc3442-classless-routes
So, I'm wondering whether their respective authors actually meant them to be
run by default or not.

Regards,

Timo

#873133#10
Date:
2017-08-29 15:15:38 UTC
From:
To:
FYI, I also filed a bug report upstream since the same code is found in the current upstream git master branch as well:
https://bugs.isc.org/Public/Bug/Display.html?id=45874

#873133#15
Date:
2026-08-05 17:31:09 UTC
From:
To:
Dear submitter,

as the package isc-dhcp has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1143544

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)