Skip to content

Commit

Permalink
fix scripts with chrooted=true via nfs (bnc#829265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fehr committed Jul 17, 2013
1 parent 8725ccf commit 69f1966
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/include/io.ycp
Expand Up @@ -72,7 +72,12 @@

string tmp_dir = (string)WFM::Read(.local.tmpdir, []);
string mount_point = tmp_dir + "/tmp_mount";
WFM::Execute(.local.mkdir, mount_point );
string mp_in_local = mount_point;
string chr = WFM::SCRGetName(WFM::SCRGetDefault());
if( search(chr,"chroot=/mnt:")==0 )
mp_in_local = AutoinstConfig::destdir+mount_point;
y2milestone( "Chr:%3 TmpDir:%1 Mp:%2", tmp_dir, mp_in_local, chr );
WFM::Execute(.local.mkdir, mp_in_local );

if ( Scheme == "http" || Scheme == "https" )
{
Expand Down Expand Up @@ -197,7 +202,7 @@
return (false);
}

string copyCmd = "/bin/cp " + mount_point + "/" + basename(Path) +
string copyCmd = "/bin/cp " + mp_in_local + "/" + basename(Path) +
" " + Localfile;
y2milestone("Copy Command: %1", copyCmd);
if (WFM::Execute (.local.bash, copyCmd ) == 0)
Expand All @@ -214,7 +219,7 @@

}

WFM::Execute(.local.umount, mount_point);
SCR::Execute(.target.umount, mount_point);

}
else if (Scheme == "cifs") // CIFS
Expand All @@ -228,7 +233,7 @@
return (false);
}

string copyCmd = "/bin/cp " + mount_point + "/" + basename(Path) +
string copyCmd = "/bin/cp " + mp_in_local + "/" + basename(Path) +
" " + Localfile;
y2milestone("Copy Command: %1", copyCmd);
if (WFM::Execute (.local.bash, copyCmd ) == 0)
Expand All @@ -245,7 +250,7 @@

}

WFM::Execute(.local.umount, mount_point);
SCR::Execute(.target.umount, mount_point);

}
else if (Scheme == "floppy")
Expand Down Expand Up @@ -362,6 +367,8 @@
y2error("Protocol not supported");
ok = false;
}
if( !isempty(GET_error) )
y2warning("GET_error:%1",GET_error);
return ( ok );
}

Expand Down

0 comments on commit 69f1966

Please sign in to comment.