<div dir="ltr"><div>Hello and merry Christmas!</div><div><br></div>what about this patch?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 7:35 PM, éÇÏÒØ ûÅÓÔÁËÏ× <span dir="ltr"><<a href="mailto:shine@selectel.ru" target="_blank">shine@selectel.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>From 8118b81626a73fcb83b6b21d498b6724c4b63817 Mon Sep 17 00:00:00 2001</div><div>From: Igor Shestakov <<a href="mailto:shinespb@gmail.com" target="_blank">shinespb@gmail.com</a>></div>
<div>Date: Mon, 16 Dec 2013 17:39:09 +0400</div>
<div>Subject: [PATCH] changed set_rootpasswd method for ploop support</div><div><br></div><div><br></div><div>Signed-off-by: Igor Shestakov <<a href="mailto:shinespb@gmail.com" target="_blank">shinespb@gmail.com</a>></div>
<div>---</div>
<div>šPVE/API2/OpenVZ.pm | 12 +++++++++++-</div><div>šPVE/OpenVZ.pm š š š| š7 ++++---</div><div>š2 files changed, 15 insertions(+), 4 deletions(-)</div><div><br></div><div>diff --git a/PVE/API2/OpenVZ.pm b/PVE/API2/OpenVZ.pm</div>
<div>index d9993fd..c5707e3 100644</div><div>--- a/PVE/API2/OpenVZ.pm</div><div>+++ b/PVE/API2/OpenVZ.pm</div><div>@@ -413,10 +413,20 @@ __PACKAGE__->register_method({</div><div class="im"><div>š<span style="white-space:pre-wrap"> </span></div>
<div>š<span style="white-space:pre-wrap"> </span># hack: vzctl '--userpasswd' starts the CT, but we wantš</div></div><div class="im"><div>š<span style="white-space:pre-wrap"> </span># to avoid that for create</div>
<div>-<span style="white-space:pre-wrap"> </span>PVE::OpenVZ::set_rootpasswd($private, $password)š</div>
</div><div class="im"><div>+<span style="white-space:pre-wrap"> </span>my $rootdir = PVE::OpenVZ::get_rootdir($conf, $vmid);</div><div>+</div></div><div>+<span style="white-space:pre-wrap"> </span>#mount container(for ploop support)</div>
<div class="im"><div>
+<span style="white-space:pre-wrap"> </span>$cmd = ['/usr/sbin/vzctl', '--skiplock', 'mount', $vmid];</div><div>+<span style="white-space:pre-wrap"> </span>run_command($cmd);</div><div>+<span style="white-space:pre-wrap"> </span>die "Cannot mount $vmid" if !PVE::OpenVZ::check_mounted($conf, $vmid);</div>
<div>+</div></div><div>+<span style="white-space:pre-wrap"> </span>PVE::OpenVZ::set_rootpasswd($password, $rootdir)š</div><div>š<span style="white-space:pre-wrap"> </span> š šif defined($password);</div><div class="im">
<div>š<span style="white-space:pre-wrap"> </span> š š}</div>
<div>š</div><div>+<span style="white-space:pre-wrap"> </span> š š$cmd = ['/usr/sbin/vzctl', '--skiplock', 'umount', $vmid];</div><div>+<span style="white-space:pre-wrap"> </span> š šrun_command($cmd);</div>
<div>+</div><div>š<span style="white-space:pre-wrap"> </span> š šPVE::AccessControl::add_vm_to_pool($vmid, $pool) if $pool;</div></div><div>š<span style="white-space:pre-wrap"> </span>};</div><div>š</div><div>diff --git a/PVE/OpenVZ.pm b/PVE/OpenVZ.pm</div>
<div>index 2b92979..c01665d 100644</div><div>--- a/PVE/OpenVZ.pm</div><div>+++ b/PVE/OpenVZ.pm</div><div>@@ -1243,14 +1243,15 @@ sub replacepw {</div><div class="im"><div>š š š}<span style="white-space:pre-wrap"> </span></div>
<div>š}</div>
<div>š</div><div>+</div><div>šsub set_rootpasswd {</div><div>- š šmy ($privatedir, $opt_rootpasswd) = @_;</div><div>+ š šmy ($opt_rootpasswd, $rootdir) = @_;</div><div>š</div><div>- š šmy $pwfile = "$privatedir/etc/passwd";</div>
<div>+ š šmy $pwfile = "$rootdir/etc/passwd";</div><div>š</div><div>š š šreturn if ! -f $pwfile;</div><div>š</div><div>- š šmy $shadow = "$privatedir/etc/shadow";</div><div>+ š šmy $shadow = "$rootdir/etc/shadow";</div>
<div>š</div><div>š š šif ($opt_rootpasswd !~ m/^\$/) {</div><div>š<span style="white-space:pre-wrap"> </span>my $time = substr (Digest::SHA::sha1_base64 (time), 0, 8);</div></div><span class="HOEnZb"><font color="#888888"><div>
--š</div><div>1.8.1.msysgit.1</div></font></span></div>
<div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 9:46 AM, Dietmar Maurer <span dir="ltr"><<a href="mailto:dietmar@proxmox.com" target="_blank">dietmar@proxmox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>> Can we apply this patch as preparation for future ploop use?<br>
> If yes, later(this week) i send you correct patch.<br>
<br>
</div>Yes, but only if it works without problems. So please test your code before sending<br>
patches to the list.<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><div class="im">-- <br>ó Õ×ÁÖÅÎÉÅÍ, ûÅÓÔÁËÏ× éÇÏÒØ<br>óÅÔØ ÄÁÔÁ-ÃÅÎÔÒÏ× "óÅÌÅËÔÅÌ"
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>ó Õ×ÁÖÅÎÉÅÍ, ûÅÓÔÁËÏ× éÇÏÒØ<br>óÅÔØ ÄÁÔÁ-ÃÅÎÔÒÏ× "óÅÌÅËÔÅÌ"
</div>