7
2
I have Cygwin installed on Windows 7 in a windows domain sign-on environment. I can run most typical commands without issue, but I cannot for the life of me use the "mv" command to move or rename files, regardless of the file or directory.
I can copy and create files without issue.
┌─[12:27:57]─[mbutl2@MYHOSTNAME]
└──> tmp $ >> pwd
/tmp
┌─[12:27:58]─[mbutl2@MYHOSTNAME]
└──> tmp $ >> touch test.txt
┌─[12:28:02]─[mbutl2@MYHOSTNAME]
└──> tmp $ >> mv test.txt hello
-bash: /usr/bin/mv: Permission denied
I have already tried running Cygwin terminal as Administrator and the problem is the same.
I'm open to workarounds, such as trying another exe for moving files and redirecting the mv command to it. Moving files works in the Windows Command Prompt.
UPDATE: It appears that there may be a security restriction on my laptop that either prevents accessing/copying/executing the "mv.exe" program by its name or by its heuristics. Still willing to accept workarounds that replace the mv command as mentioned above.
UPDATE 2: Screenshots in windows command line and when I open mv.exe in Windows.
UPDATE 3: output of file
command:
┌─[12:36:09]─[mbutl2@MYHOSTNAME]
└──> ~ $ >> file /usr/bin/mv
/usr/bin/mv: writable, executable, regular file, no read permission
┌─[12:36:15]─[mbutl2@MYHOSTNAME]
└──> ~ $ >> chmod 777 /usr/bin/mv
chmod: changing permissions of `/usr/bin/mv': Permission denied
┌─[✗]─[12:36:29]─[mbutl2@MYHOSTNAME]
└──> ~ $ >> mv
-bash: /usr/bin/mv: Permission denied
┌─[✗]─[12:36:35]─[mbutl2@MYHOSTNAME]
└──> ~ $ >>
ldd
also reports permission denied.
try changing the file permissions Mv.exe,see this article:http://www.uwec.edu/Help/drives/permissions.htm
– stderr – 2013-07-08T19:32:34.767Does this also happen in the Windows command prompt (cmd) ? – harrymc – 2013-07-08T19:58:25.850
It's worth checking that the permissions on
c:\cygwin\bin\mv.exe
, in both Windows and Cygwin, permit execution for the accounts you're using. Also, see what happens when you double-click that executable in Windows Explorer -- if you see a UAC prompt, then that's why you're getting the error in Cygwin, and it will occur regardless of permissions; I do not know a way of working around that except to disable UAC entirely, which is rarely desirable. – Aaron Miller – 2013-07-08T20:58:25.943I updated the question with screenshots on what happens in the proposed scenarios. If UAC is causing this, is that controlled by the file name, file path, or some kind of hash key of the executable. In other words, could I change the executable (or create a new one) that does the same thing but lives somewhere else, with a different hash signature? – Michael Butler – 2013-07-09T13:18:38.543
What does 'ldd /usr/bin/mv' or 'file /usr/bin/mv' say? – golimar – 2013-07-09T13:21:50.683
1@MichaelButler: what is your antivirus? – stderr – 2013-07-09T16:49:01.037
have you checked ownership / tried
chmod 755
on ~ ? – Ben Plont – 2013-07-13T03:14:53.700Yes I did Ben, that didn't fix it. The problem is an enterprise McAfee policy rule blocking all access to mv.exe at the kernel level. – Michael Butler – 2013-07-15T13:04:27.993