The impact of Windows 7 and Vista security mechanisms on applications reading configuration files

Source: Internet
Author: User

Today, we have constructed a new version of XXXX software and conducted a comprehensive test under the pure system.
Some problems are also found in the test. This includes creating folders and configuration files in another directory during the Win7 test and reading the files,
But not in the specified path (the installation directory of the program. Therefore, this problem was detected through multiple tests,
This Win7 or Vista security mechanism is related.

 

Generally, C: \ Users *** \ AppData \ Local \ VirtualStore \ Program Files folders are available in windows. This ensures compatibility when the permissions are insufficient.

For example, if you want to write something to program files or some system directories, the configuration file will be saved. If you do not have sufficient permissions, the configuration file will be redirected here. For example, if you install software on program files, generally the installer will trigger UAC to escalate permissions. Of course, there will be no problems. However, it is unrealistic to trigger UAC every time you run the program installed in program files. It is too annoying. Most programs do not trigger UAC when running the program. In restricted mode, however, many software may save and write configurations and temporary files in their directories after they run, so they certainly do not have the permission to write. So they are all written to the VirtualStore directory. Most of the files saved here are some configurations or temporary files after the program runs.

UAC can force development to be more standardized and avoid writing something to the system directory. It is best to put your own appdata directory in the configuration to avoid running common applications as administrators, authorization is required unless the program installs and modifies some system configurations, In order to fundamentally solve many security problems

If you run our software (xxxxxxxx) in the normal way for the first few times, the configuration information of the software is written to VirtualStore, however, if the user runs as an administrator, then the program will read the configuration file information in the user's installation directory, resulting in Information inconsistency.
[This virtual redirection technology will also cause exceptions in QQ's work, as if QQ is started with full administrator permissions for the first time and QQ is not started with standard user permissions for 2nd times, therefore, 1st chat records cannot be viewed after 2nd logins. This is because if a standard user tries to write Files to the Program Files directory by default, the system will automatically redirect to the virtual folder C: \ Users \ [user name] \ AppData \ Local \ VirtualStore \ Program Files \ Tencent \ QQ number. However
The process will have the permission to write Files to Program Files. At this time, all the configuration information will be written to the C: \ Program Files \ Tencent \ QQ directory. Due to this problem, local QQ information may not be synchronized .]
How to better solve this file is still to be solved because the user's configuration information is not lost.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.