Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > HUGE BUG in zip and UAC: copy a file from a zip.

Reply
Thread Tools Display Modes

HUGE BUG in zip and UAC: copy a file from a zip.

 
 
BillD
Guest
Posts: n/a

 
      09-06-2007
When you copy a file from a zip (integrated zip function) to any folder in
c:\program files\ in order to replace a file, the copy fails and the target
folder will be empty! You lose the files!

reproduction steps:
1. suppose in c:\program files\app1\ you have these 3 files:
file1.exe, file2.dll, file2.txt
2. suppose in your Documents folder you have a zip contains file1.exe,
file2.dll, file2.txt
3. explorer the zip and copy the 3 files to c:\program files\app1\
4. give the UAC consent
.... but the copy will fail and the whole app1 folder will be empty. COPY IS
FAILED AND YOU LOSE OLD FILES.

 
Reply With Quote
 
 
 
 
Rick Rogers
Guest
Posts: n/a

 
      09-06-2007
Hi Bill,

No bug it is, as a standard or admin user account will not have sufficient
privileges to overwrite files in the C:\Program Files directory unless the
commands are run from an elevated prompt. It's not UAC but rather
permissions that are involved here. Keep in mind that programs in Vista are
run from the user's appdata folder, not the program files directory. This is
by design to keep malware from extending throughout the system even if one
user chooses to run it.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com

"BillD" <> wrote in message
news:CB3D9326-4817-4B55-86B9-...
> When you copy a file from a zip (integrated zip function) to any folder in
> c:\program files\ in order to replace a file, the copy fails and the
> target
> folder will be empty! You lose the files!
>
> reproduction steps:
> 1. suppose in c:\program files\app1\ you have these 3 files:
> file1.exe, file2.dll, file2.txt
> 2. suppose in your Documents folder you have a zip contains file1.exe,
> file2.dll, file2.txt
> 3. explorer the zip and copy the 3 files to c:\program files\app1\
> 4. give the UAC consent
> ... but the copy will fail and the whole app1 folder will be empty. COPY
> IS
> FAILED AND YOU LOSE OLD FILES.
>


 
Reply With Quote
 
Charlie Tame
Guest
Posts: n/a

 
      09-06-2007
Rick Rogers wrote:
> Hi Bill,
>
> No bug it is, as a standard or admin user account will not have
> sufficient privileges to overwrite files in the C:\Program Files
> directory unless the commands are run from an elevated prompt. It's not
> UAC but rather permissions that are involved here. Keep in mind that
> programs in Vista are run from the user's appdata folder, not the
> program files directory. This is by design to keep malware from
> extending throughout the system even if one user chooses to run it.
>



So does it sound sensible that this deletes files?

You really don't need to bother downloading hardware if the OS does the
deleting for you...

Would it not make more sense to fail with an error message to say
insufficient privileges - can't perform the requested operation?
 
Reply With Quote
 
Stephan Rose
Guest
Posts: n/a

 
      09-06-2007
On Thu, 06 Sep 2007 06:39:02 -0500, Charlie Tame wrote:

> Rick Rogers wrote:
>> Hi Bill,
>>
>> No bug it is, as a standard or admin user account will not have
>> sufficient privileges to overwrite files in the C:\Program Files
>> directory unless the commands are run from an elevated prompt. It's not
>> UAC but rather permissions that are involved here. Keep in mind that
>> programs in Vista are run from the user's appdata folder, not the
>> program files directory. This is by design to keep malware from
>> extending throughout the system even if one user chooses to run it.
>>

>
>
> So does it sound sensible that this deletes files?
>
> You really don't need to bother downloading hardware if the OS does the
> deleting for you...


Got an address for me where I can download some more 8800 GTXs?
Or how about a DVD-RAM drive that can take cartridges. I am DYING for a
couple of those...

--
Stephan
2003 Yamaha R6

君のこと思い出す日なんてないのは
君のこと忘れたときがないから
 
Reply With Quote
 
Bob Eyster
Guest
Posts: n/a

 
      09-06-2007
I tried what was described: I created three file and copied them to the app1
directory under program files. I created a zip file on my desktop and copied
the three file to the app1 dir. logged in as admin. they copied as they
should have. the only time I need to elevate a process was when coping the
first set of files to the Program files/app1 dir. UAC told me I did not have
permission to do this.

--

Bob Eyster
MS Windows Vista Home Premium



"Rick Rogers" <> wrote in message
news:%23$...
> Hi Bill,
>
> No bug it is, as a standard or admin user account will not have sufficient
> privileges to overwrite files in the C:\Program Files directory unless the
> commands are run from an elevated prompt. It's not UAC but rather
> permissions that are involved here. Keep in mind that programs in Vista
> are run from the user's appdata folder, not the program files directory.
> This is by design to keep malware from extending throughout the system
> even if one user chooses to run it.
>
> --
> Best of Luck,
>
> Rick Rogers, aka "Nutcase" - Microsoft MVP
> http://mvp.support.microsoft.com/
> Windows help - www.rickrogers.org
> My thoughts http://rick-mvp.blogspot.com
>
> "BillD" <> wrote in message
> news:CB3D9326-4817-4B55-86B9-...
>> When you copy a file from a zip (integrated zip function) to any folder
>> in
>> c:\program files\ in order to replace a file, the copy fails and the
>> target
>> folder will be empty! You lose the files!
>>
>> reproduction steps:
>> 1. suppose in c:\program files\app1\ you have these 3 files:
>> file1.exe, file2.dll, file2.txt
>> 2. suppose in your Documents folder you have a zip contains file1.exe,
>> file2.dll, file2.txt
>> 3. explorer the zip and copy the 3 files to c:\program files\app1\
>> 4. give the UAC consent
>> ... but the copy will fail and the whole app1 folder will be empty. COPY
>> IS
>> FAILED AND YOU LOSE OLD FILES.
>>

>


 
Reply With Quote
 
BillD
Guest
Posts: n/a

 
      09-06-2007


"Rick Rogers" wrote:

> No bug it is, as a standard or admin user account will not have sufficient
> privileges to overwrite files in the C:\Program Files directory unless the
> commands are run from an elevated prompt. I


YOU WRONG!!! Because if I copy a file to c:\program files\ I'll get an UAC
prompt and it's copied with success!!! This fails only when I copy a file
from the zip archive in explorer'shell and old files are also deleted!!!
 
Reply With Quote
 
BillD
Guest
Posts: n/a

 
      09-06-2007


"Rick Rogers" wrote:

> No bug it is, as a standard or admin user account will not have sufficient
> privileges to overwrite files in the C:\Program Files directory unless the
> commands are run from an elevated prompt. I


YOU WRONG!!! Because if I copy a file to c:\program files\ I'll get an UAC
prompt and it's copied with success!!! This fails only when I copy a file
from the zip archive in explorer's shell and old files are also deleted!!!
 
Reply With Quote
 
Andrew McLaren
Guest
Posts: n/a

 
      09-06-2007
"BillD" <> wrote ...
> When you copy a file from a zip (integrated zip function) to any folder in
> c:\program files\ in order to replace a file, the copy fails and the
> target
> folder will be empty! You lose the files!
>
> reproduction steps:
> 1. suppose in c:\program files\app1\ you have these 3 files:
> file1.exe, file2.dll, file2.txt
> 2. suppose in your Documents folder you have a zip contains file1.exe,
> file2.dll, file2.txt
> 3. explorer the zip and copy the 3 files to c:\program files\app1\
> 4. give the UAC consent
> ... but the copy will fail and the whole app1 folder will be empty. COPY
> IS
> FAILED AND YOU LOSE OLD FILES.


Not repro.

When I tried these steps on my machine, I got a UAC prompt, then the files
were copied from the ZIP file to the C:\Program Files\apps1 directory, as
expected. I was logged in as a Standard User.

You're undoubtedly seeing a real issue on your machine - but it doesn't seem
to be the universal experience for all users. You might need to delineate
the specific conditions required to reproduce the problem: for example, the
user context in which the files where copied; the specific permissions which
had been applied to the original files; etc. You can use the "icacls"
command to get a precise listing of the file permissions in the
app1\directory, before and after you attempt to copy the ZIP files into it;
eg:

C:\Program Files>icacls .\app1 > C:\TEMP\app1acl.txt

C:\Program Files>icacls .\app1\* >> C:\TEMP\app1acl.txt

You could also use a tool like Process Monitor
(http://www.microsoft.com/technet/sys...ssmonitor.mspx)
to see exactly why the original ZIP files are being deleted.

If you have a consistent repro scenario which can be repro'ed on a random
machine, then ... yeah, it should be reported to Microsoft. Data loss is
always serious, and should be taken seriously. Although it is also true
that the Program Files direcory is "special" on Vista, it has a very
specific set of permissions which prevent random manipulation of files. This
is "by design" and is a security measure to prevent hijacks or other abuses
(what if the zipp'ed file1.exe was a virus?). Applications which need to
update files under the Program Files directory should do so, by calling on
the Windows Installer Services, instead of doing direct file I/O. (Mind you,
I use at least one app, a fine product, which nevertheless distributes
updates as ZIP'ed files to be copied into the program directory. Bugger I've
written to that vendor, suggesting they use a more secure and Vista-friendly
update mechanism).

Regards,
--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
 
Charlie Tame
Guest
Posts: n/a

 
      09-07-2007
Stephan Rose wrote:
> On Thu, 06 Sep 2007 06:39:02 -0500, Charlie Tame wrote:
>
>> Rick Rogers wrote:
>>> Hi Bill,
>>>
>>> No bug it is, as a standard or admin user account will not have
>>> sufficient privileges to overwrite files in the C:\Program Files
>>> directory unless the commands are run from an elevated prompt. It's not
>>> UAC but rather permissions that are involved here. Keep in mind that
>>> programs in Vista are run from the user's appdata folder, not the
>>> program files directory. This is by design to keep malware from
>>> extending throughout the system even if one user chooses to run it.
>>>

>>
>> So does it sound sensible that this deletes files?
>>
>> You really don't need to bother downloading hardware if the OS does the
>> deleting for you...

>
> Got an address for me where I can download some more 8800 GTXs?
> Or how about a DVD-RAM drive that can take cartridges. I am DYING for a
> couple of those...
>



Yeah I meant Malware of course, I have plenty free if you're still
interested
 
Reply With Quote
 
BillD
Guest
Posts: n/a

 
      09-07-2007


"Andrew McLaren" wrote:
> Although it is also true
> that the Program Files direcory is "special" on Vista, it has a very
> specific set of permissions which prevent random manipulation of files. This
> is "by design" and is a security measure to prevent hijacks or other abuses
> (what if the zipp'ed file1.exe was a virus?).


you didn't understand me!!!!
if I copy a file to c:\program files\app1\ I get an UAC prompt, I give the
consent and then it's copied with success!
instead, if I copy a file from a zip archive to c:\program files\app1\ it
fails!!!
And the files in folder \app1 are deleted!!!
There are 2 bugs: wrong elevation with zip + files deleted in \app1

try these steps: Standard user + UAC on
1. create a new folder in c:\program files\sysinternals\processexplorer
(give UAC consent in order to create it in that protected location)
2. with IE7, download this file
http://download.sysinternals.com/Fil...ssExplorer.zip to your Downloads
folder (or Documents folder)
3. extract the zip, select the files and copy them to c:\program
files\sysinternals\processexplorer, give UAC consent, and the files are
copied with success.
4. now, don't extract the zip, but enter into zip using the built-in zip
vista's feature, select the files and copy them to c:\program
files\sysinternals\processexplorer, accept to replace the files, give UAC
consent
..... and the copy will fail: denied access
..... and the c:\program files\sysinternals\processexplorer folder is void
---> old files have been deleted!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vista can't copy large files? another XP file-copy bug? Dave Windows Vista General Discussion 3 01-26-2008 06:47 PM
HUGE PROB: computer wont start up(corrup file i think) liam8mail Windows Vista General Discussion 10 12-26-2007 08:24 PM
HUGE BUG in zip and UAC: copy a file from a zip BillD Windows Vista General Discussion 1 09-06-2007 10:18 AM
vista stops install after file copy before 'file gathering' no err Roger L Windows Vista Installation 2 07-26-2007 10:50 PM
huge file Lampie Windows Vista General Discussion 0 02-20-2007 03:12 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59