Bug 15838

Summary: dhcp server creates symlinks to /tmp on host
Product: buildroot Reporter: Jonas <jonas.d.karlsson>
Component: OtherAssignee: unassigned
Status: RESOLVED MOVED    
Severity: normal CC: buildroot, yann.morin.1998
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Jonas 2023-11-01 22:01:07 UTC
In package/dhcp/dhcp.mk this section can be found:

ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)    
define DHCP_INSTALL_CTL_LIBS    
        $(MAKE) -C $(@D)/dhcpctl install-exec DESTDIR=$(TARGET_DIR)    
endef    
define DHCP_INSTALL_SERVER    
        mkdir -p $(TARGET_DIR)/var/lib    
        (cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)    
        $(MAKE) -C $(@D)/server DESTDIR=$(TARGET_DIR) install-sbinPROGRAMS    
        $(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf \    
                $(TARGET_DIR)/etc/dhcp/dhcpd.conf    
endef    
endif

The symlink that is created from /var/lib/dhcp to /tmp seem to cause a symlink to the host /tmp which creates access privilege problems.

Shouldn't the symlink be to ../../tmp rather than /tmp like the misc symlink under /var/lib? See below 

cd output/target/var/lib

ls -al

drwxr-xr-x 2 jonkar jonkar 4096 nov  1 17:09 arpd
lrwxrwxrwx 1 jonkar jonkar    4 nov  1 18:27 dhcp -> /tmp
lrwxrwxrwx 1 jonkar jonkar    9 nov  1 16:13 misc -> ../../tmp
Comment 1 Yann E. MORIN 2024-06-15 15:13:28 UTC
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!