Control: tags -1 + help

On Sat, 6 Mar 2021 17:22:17 +0100 Frederik Lindenaar
<frede...@lindenaar.nl> wrote:
> Hi Cyril,
> 
> Thank you for the quick reply
> 
> As Ben also pointed out, I probably have indeed mixed up /dev/zero
and /dev/null and had already fixed that by using an empty file.
Nevertheless the result was pretty odd (the disk filling up rapidly)
and very confusing so might still be useful to prevent this (if
possible).
> 
> Why not use a cp -aLt <directory> {} instead to prevent this?
> 

This wouldn't produce the right result afaics. If you mask a file by
symlinking it to /dev/null, the current code produces a file with zero-
size (which is also acceptable for masking files).

If you dereference (-L), you instead copy a character device, which is
not the same as a zero-sized file.

We also have to keep in mind, that if a .link file in
/etc/system/network, pointing to some link elsewhere, we probably do
want to resolve that and not copy a dangling symlink.

The current code is already ugly as it is. I'm not sure, adding more
corner cases is a good idea. That said, I'm open to suggestions. The
code must

- make sure files with the same name in /etc/systemd/network take
precedence of files in /lib/systemd/network
- correctly handle masked .link files (i.e. files pointing at
/dev/null)
- correctly handle the case that /etc/systemd/network doesn't exist or
itself is a symlink

I'm happy to take a patch for that.

Regards,
Michael

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to