summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
Commit message (Collapse)AuthorAgeFilesLines
* ShellPkg/UefiShellLevel2CommansLib: Pointer Resonse should be checkedGao, Zhichao2019-08-121-1/+4
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2049 ShellPkg\Library\UefiShellLevel2CommandsLib\Cp.c line 104 and ShellPkg\Library\UefiShellLevel2CommandsLib\Mv.c line 640, the pointer variable Response may be a NULL pointer. So we should make sure that it isn't NULL before dereference it. If Response is NULL that indicates a EFI_OUT_OF_RESOURCES error, directly return SHELL_ABORTED. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Clean up source filesLiming Gao2018-06-281-16/+16
| | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg/MV: Fix MV to deny moving parent of current directoryChen A Chen2016-12-051-6/+75
| | | | | | | | | | | | | When user types "mv -r fs0:\A\ fs1:\" under directory "fs0:\A\B\", MV command should deny such movement. The patch fixes the above issue. It also denies moving current directory. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg/UefiShellLevel2CommandsLib: Remove unnecessary EFIAPIChen A Chen2016-10-091-7/+0
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
* ShellPkg/Mv: Handle memory allocation failureRuiyu Ni2016-07-181-5/+9
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Fix Shell ASSERT when mv file with cwd is NULL.Qiu Shumin2016-04-111-13/+16
| | | | | | | | | | | | | | | Shell will ASSERT when doing the following operation: "" Shell> mv fs2:\file1 fs2:\file2 "" This patch add NULL pointer check to fix this issue. Fixes: https://github.com/tianocore/edk2/issues/76 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg: Fix Shell assert when mv a file to a NULL target.Qiu Shumin2016-01-061-2/+2
| | | | | | | | | | When run command 'mv file ' the Shell assert. The patch refined the length of the buffer to fix this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19607 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Follow spec to remove the last '\' char in return name of GetCurDir().Qiu Shumin2015-10-231-4/+28
| | | | | | | | | | | | | | | | | | In Shell spec 2.1 the return name of EFI_SHELL_PROTOCOL.GetCurDir() is defined as 'fs0:\current-dir' while in current implementation it's 'fs0:\current-dir\'. To follow spec the patch removed the redundant '\' char. Since it has been broken for a long time, some codes may depend on the broken behavior. After this change 'EFI_SHELL_PROTOCOL.GetCurDir()' and 'UefiShellLib.ShellGetCurrentDir()' will return a current directory string without tailing '\' (fs0:\current-dir), the value of Shell environment variable 'cwd' will become 'fs0:\current-dir' as well. This patch has updated all the code in EDKII to make them depend on the new behavior. Developers should check whether 'GetCurDir()' and 'ShellGetCurrentDir' are used in their source code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18653 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Refine the code logic of mv.c.Qiu Shumin2015-07-011-3/+5
| | | | | | | | | | | | | When doing the mv we should check whether source is 'above' dest on file path tree. This patch make the check logic more precise. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hp.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17750 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Use safe string functions to refine code.Qiu Shumin2015-06-301-14/+14
| | | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17730 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: fix mv and cp command related issuesTapan Shah2015-04-071-6/+19
| | | | | | | | | | | | | | 1.mv deletes file/directory when trying to move it to non-existing file system. 2.mv causes RSOD in system when trying to move same file at the same location. 3.Refactor mv and cp command with command name passed-in. remove redundant move status error message when file failed to move across file system. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17129 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Standardized HP Copyright Message StringTapan Shah2015-02-041-1/+1
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16759 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Update Level2 profile commands response outputTapan Shah2015-02-031-9/+9
| | | | | | | | | | | | Updates to Level2 profile commands response output. Updating Level2 profile commands source code to include command name as a prefix in error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16730 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Comments update and code refine.Qiu Shumin2014-10-141-15/+43
| | | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16209 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Add a typecast to 'BOOLEAN' to avoid build failure in VS2005. Qiu Shumin2014-10-091-1/+1
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16199 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: fix "incompatible pointer type" build errorGabriel Somlo2014-10-081-1/+1
| | | | | | | | | | | | | Following commit 7fe3fbad05cd6ef23e83ab5da8c5a82ff9bb456e, building OvmfPkg on Linux breaks with an "incompatible pointer type" error. This patch adds a cast to supress the warning and allow the build to complete Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16198 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Update MV. now supports across file system moves.Jaben Carsey2014-10-021-195/+330
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> Reviewed-by: Tapan Shah <tapandshah@hp.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16193 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Refine code style to avoid potential NullPointer dereference.Qiu Shumin2014-09-231-0/+2
| | | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16161 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Refine code style to avoid potential uninitialized local variable.Qiu Shumin2014-09-191-3/+4
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16146 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Remove redundant quotes in file path string for Shell command ↵Qiu Shumin2014-09-171-1/+12
| | | | | | | | | | | parameters. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16122 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix 'mv' command to not attempt moving a file from write-protected ↵Chris Phillips2014-06-241-10/+16
| | | | | | | | | | | media Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips <chrisp@hp.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15584 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix for the ‘mv’ command when destination starts with ‘\’.Chris Phillips2013-10-181-0/+9
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips <chrisp@hp.com> reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14787 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fixed build errors related to variable declarationsOlivier Martin2013-08-271-2/+1
| | | | | | | | | | | | - variable "TempLocation" was set but never used Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14605 6f19259b-4bc3-4df7-8a09-765794883524
* Update Code to pass EBC compiler.lgao42013-05-131-18/+13
| | | | | | | Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14352 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fixed build error 'variable set but not used'jcarsey2013-05-071-2/+1
| | | | | | | | | | | GCC toolchain cannot build ShellPkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Harry Liebel <Harry.Liebel@arm.com> Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Jaben Carsey <Jaben.Carsey@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14326 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Correct incorrect use of sizeof to use macro for EFI_FILE_INFO size.jcarsey2011-11-181-3/+3
| | | | | | | | Signed-off-by: jcarsey Reviewed-by: niruiyu git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12740 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Verify memory allocations without ASSERT.jcarsey2011-10-101-3/+11
| | | | | | | signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12522 6f19259b-4bc3-4df7-8a09-765794883524
* Refine comments and two code style.ydong102011-09-021-3/+3
| | | | | | Signed-off-by: ydong10 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12263 6f19259b-4bc3-4df7-8a09-765794883524
* This refactors 3 functions out of ShellCommandLib and puts them into a new ↵jcarsey2011-06-301-2/+2
| | | | | | | | | | | | | | library (but as 2 functions instead of 3). This allows for users outside of the shell itself to have access to these functions. 1) Remove the 3 functions out of the shell's internal library (ShellCommandLib) 2) Add a new library class (PathLib) 3) Add an instance of this class (BasePathLib) 4) Change all internal shell callers to use this new library class. signed-off-by: jcarsey reviewed-by: jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11936 6f19259b-4bc3-4df7-8a09-765794883524
* Cd - add more input verification.jcarsey2011-03-251-13/+76
| | | | | | | | | | | | | | Cp - support "\" as root of drive indicator. Load - invert "-nc" to not connect. Ls - ignore archive file attribute. Map - add more input verification. fix add by handle. Mv - support overwrite question. support "\" as root of drive indicator. Parse - add comments. Rm - add comments. TimeDate - add more input verification. add comments. Vol - add new command. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11426 6f19259b-4bc3-4df7-8a09-765794883524
* Verify more memory allocations.jcarsey2010-10-041-3/+8
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10910 6f19259b-4bc3-4df7-8a09-765794883524
* Verify memory allocations were successful.jcarsey2010-10-041-48/+64
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10909 6f19259b-4bc3-4df7-8a09-765794883524
* udk2010.up2.shell initial release.jcarsey2010-09-141-0/+478
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10874 6f19259b-4bc3-4df7-8a09-765794883524