Re: [libvirt] [PATCH] phyp: ssh authentication with pub keys fixed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/11/6 Eduardo Otubo <otubo@xxxxxxxxxxxxxxxxxx>:
> +    char *pubkey = NULL;
> +    char *pvtkey = NULL;
> +
> +    if (virAsprintf(&pubkey, "%s/.ssh/id_rsa.pub", getenv("HOME")) < 0) {
> +        virReportOOMError(conn);
> +        goto err;
> +    }
> +
> +    if (virAsprintf(&pvtkey, "%s/.ssh/id_rsa", getenv("HOME")) < 0) {
> +        virReportOOMError(conn);
> +        goto err;
> +    }

You should use virGetUserDirectory() instead of getenv("HOME"):

    char *userdir = virGetUserDirectory(NULL, geteuid());

    if (userdir == NULL)
        goto err;

Matthias

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]