func (p *Profile) writeConfWgQuick(data *WgConf) (pth string, err error) {
	allowedIps := []string{}
	if data.Routes != nil {
		for _, route := range data.Routes {
			allowedIps = append(allowedIps, route.Network)
		}
	}
	if data.Routes6 != nil {
		for _, route := range data.Routes6 {
			allowedIps = append(allowedIps, route.Network)
		}
	}

	addr := data.Address
	if data.Address6 != "" {
		addr += "," + data.Address6
	}

	templData := WgConfData{
		Address:    addr,
		PrivateKey: p.PrivateKeyWg,
		PublicKey:  data.PublicKey,
		AllowedIps: strings.Join(allowedIps, ","),
		Endpoint:   fmt.Sprintf("%s:%d", data.Hostname, data.Port),
	}

	if data.DnsServers != nil && len(data.DnsServers) > 0 {
		templData.HasDns = true
		templData.DnsServers = strings.Join(data.DnsServers, ",")
	}

	output := &bytes.Buffer{}
	err = WgConfTempl.Execute(output, templData)
	if err != nil {
		err = &errortypes.ParseError{
			errors.Wrap(err, "profile: Failed to exec wg template"),
		}
		return
	}

	rootDir := ""
	switch runtime.GOOS {
	case "linux":
		rootDir = WgLinuxConfPath

		err = os.MkdirAll(WgLinuxConfPath, 0700)
		if err != nil {
			err = &errortypes.WriteError{
				errors.Wrap(
					err, "profile: Failed to create wg conf directory"),
			}
			return
		}
	case "darwin":
		rootDir = WgMacConfPath

		err = os.MkdirAll(WgMacConfPath, 0700)
		if err != nil {
			err = &errortypes.WriteError{
				errors.Wrap(
					err, "profile: Failed to create wg conf directory"),
			}
			return
		}
	default:
		rootDir, err = utils.GetTempDir()
		if err != nil {
			return
		}
	}

	pth = filepath.Join(rootDir, p.Iface+".conf")

	os.Remove(pth)
	err = ioutil.WriteFile(
		pth,
		[]byte(output.String()),
		os.FileMode(0600),
	)
	if err != nil {
		err = &WriteError{
			errors.Wrap(err, "profile: Failed to write wg conf"),
		}
		return
	}

	return
}
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.