Bug 15838 - dhcp server creates symlinks to /tmp on host
Summary: dhcp server creates symlinks to /tmp on host
Status: RESOLVED MOVED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-01 22:01 UTC by Jonas
Modified: 2024-06-15 15:13 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!