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

Discussion in 'Windows Vista General Discussion' started by BillD, Sep 6, 2007.

  1. BillD

    BillD Guest

    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.
     
    BillD, Sep 6, 2007
    #1
    1. Advertisements

  2. BillD

    Rick Rogers Guest

    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.
     
    Rick Rogers, Sep 6, 2007
    #2
    1. Advertisements

  3. BillD

    Charlie Tame Guest


    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?
     
    Charlie Tame, Sep 6, 2007
    #3
  4. BillD

    Stephan Rose Guest

    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

    å›ã®ã“ã¨æ€ã„出ã™æ—¥ãªã‚“ã¦ãªã„ã®ã¯
    å›ã®ã“ã¨å¿˜ã‚ŒãŸã¨ããŒãªã„ã‹ã‚‰
     
    Stephan Rose, Sep 6, 2007
    #4
  5. BillD

    Bob Eyster Guest

    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, Sep 6, 2007
    #5
  6. BillD

    BillD Guest

    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!!!
     
    BillD, Sep 6, 2007
    #6
  7. BillD

    BillD Guest

    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!!!
     
    BillD, Sep 6, 2007
    #7
  8. 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/sysinternals/utilities/processmonitor.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, Sep 7, 2007
    #8
  9. BillD

    Charlie Tame Guest


    Yeah I meant Malware of course, I have plenty free if you're still
    interested :)
     
    Charlie Tame, Sep 7, 2007
    #9
  10. BillD

    BillD Guest

    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/Files/ProcessExplorer.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!
     
    BillD, Sep 7, 2007
    #10
  11. BillD

    BillD Guest

    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\ , for example I created
    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/Files/ProcessExplorer.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!
     
    BillD, Sep 7, 2007
    #11
  12. Well, I'm pretty sure I got the general idea.
    I still cannot reproduce the problem. Here's what I did:

    - 32-bit Vista Ultimate, clean install, fully patched via Windows Update;
    - log in as Administrative user;
    - open Command Prompt as Administrator;
    - C:\Program Files>mkdir Test;
    - download ProcessMonitor.zip to Public\Downloads;
    - copy 3 files from ZIP to C:\Program Files\test;
    - there is now C:\Program Files\test dir containing 3 files. So far, so
    good;
    - log out.
    - log in again, this time as a Standard (non-Admin) user;
    - open one Explorer Window with focus on C:\Program Files\test;
    - open second Explorer window with
    C:\Users\Public\Downloads\ProcessMonitor.zip selected, showing 3 archived
    files;
    - select the 3 files in the ZIP file;
    - right-click, drag-n-drop files to C:\Program Files\Test;
    - release right mouse button, choose "Copy" from context menu, to copy the
    files from the ZIP archive to the Test directory;
    - I get a "Copy File: There is already a file with the same name in this
    location. Copy and replace?" dialogue;
    - I select "Copy and replace" for ProcMon.CHM;
    - I repeat for Procmon.EXE and EULA.TXT;
    - I get a "Destination Folder Access Denied" dialogue: "You'll need to
    provide administrator permission to copy to this folder, Continue, Skip,
    Cancel";
    - I press Continue;
    - I get UAC "Windows needs your permission to continue" dialogue. I enter
    Admin user password and click OK;
    - Message box "Copying 3 items" appears, files are copied;
    - I highlight the C:\Program Files\Test directory in Explorer and press F5
    to refresh the view;
    - I see 3 files in the directory. Double-clicking the EXE launches the
    program, double-clicking EULA.TXT opens it in Notepad etc;
    - normal operations were preserved. No errors or data loss can be seen.

    If I have misunderstood the repro scenario, please explain what I need to do
    to repro the bug.

    To be clear, I don't doubt that you are seeing a problem on your machine,
    there. However, the problem you are seeing does not seem to be the universal
    or common experience for other Vista users. Therefore, it may be caused by
    some local condition or circumstance on your machine. In order to delineate
    the parameters of the bug, you will need to isolate what those particular or
    specific conditions might be; and work out whether they are intrinsic to
    Vista, or caused by some custom configuration, conflict with 3rd party
    software, etc. Otherwise your bug report is not useful, and may even be in
    error.
     
    Andrew McLaren, Sep 7, 2007
    #12
  13. BillD

    dennis@home Guest

    I just tried it for you..

    I created a directory c:\program files\test (got UAC prompt)
    I copied from the unzipped directory the three files in processexplorer.zip
    I have. (no UAC prompt)
    I then copied the same files from the zip archive (no UAC prompt but I did
    get do you want to over write these files with... prompt).
    All appeared to work.
    That was using explorer and ^c ^v
    Home premium BTW.
    HTH.
     
    dennis@home, Sep 7, 2007
    #13
  14. BillD

    Bob Eyster Guest

    I followed your directions and it worked as expected for me. The only
    difference, I did not download the file from the link you provided, I used
    my own.
     
    Bob Eyster, Sep 7, 2007
    #14
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.