canonical / core-build

GNU General Public License v3.0
8 stars 18 forks source link

scripts/ubuntu-core/rootfs: fix mkdir error when the file exists #35

Closed mvo5 closed 6 years ago

mvo5 commented 6 years ago

We have code in ubuntu-core-rootfs that processes all mounts in /etc early. Part of it does a mkdir to create missing mount-points.

However some mounts in /etc are file-based bind mounts (like /etc/hosts). For those the current code will try to mkdir /etc/hosts but that fails because the file may exist already.

This PR fixes this error by checking for the existance of the target only (the previous code was checking for the directory).