[pve-devel] [RFC PATCH common] Tools: tempfile and tempfile_contents
Fabian Grünbichler
f.gruenbichler at proxmox.com
Mon Apr 4 15:11:09 CEST 2016
> Wolfgang Bumiller <w.bumiller at proxmox.com> hat am 4. April 2016 um 14:43
> geschrieben:
>
>
> ---
> This might be useful for the ssh-key code: since ssh-keygen apparently
> needs seekable files (iow. doesn't work with pipes) we need a place
> to temporarily store keys. This code currently is a bit more flexible
> than necessary - the basic usage is as follows:
>
> my ($filename, $handle) = tempfile_contents($my_data);
>
> As long as the $handle exists the file will be accessible.
> The $filename points to `/proc/$PID/fd/$fileno`. It is never linked
> into the file system (and cannot be unless the allow_links option is
> set.)
>
Looks good to me, will post a rebased version of the validate_ssh_keys patch
tomorrow.
Thanks!
More information about the pve-devel
mailing list