Oh, I did a mistake in the backported patch. snprintf(dest, len, "%s/lxc/lock/%s/.%s", rundir, p, n) # bad snprintf(dest, len, "%s/lxc/lock/%s/%s", rundir, p, n) # good The former will produce the error because it won't fit in the buffer.