为什么在管理员模式下运行自己编写的、未经测试的代码是个坏主意? [英] Why is running self-written, untested code in Administrator mode a bad idea?

查看:28
本文介绍了为什么在管理员模式下运行自己编写的、未经测试的代码是个坏主意?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近向 SO 发布了一个关于在 C++ 中写入文件的问题.在其中一条评论中,我提到我正在以管理员模式运行.后来的评论指出:

I recently posted a question to SO regarding an issue with writing to file in C++. In one of the comments, I mentioned that I was running in administrator mode. A later comment stated:

在管理员模式下运行自己编写的、未经测试的软件是一个坏主意.永远不要那样做.

Running self-written, untested software in admin mode is a bad idea. Don't ever do that.

这让我想知道,这是为什么?后果是什么?我遇到过项目无法加载的情况——除非在管理员模式下.这是否适用于不属于您的机器(例如工作机器),或者每次都适用于所有机器?

This got me wondering, why is this? What are the ramifications? I've experienced situations where a project would not load -- unless in Administrator mode. Does this apply to machines that are not yours (such as work machines), or to all machines, every time?

推荐答案

拥有一个必须有意识地启用的单独管理员模式的想法是让软件以最少的权限运行完成工作所必需的.因此,故障或恶意软件(希望)不会损坏/危害您的系统.

The idea of having a seperate administrator mode, which must be consciously enabled, is to have software running with the minimum amount of permissions necessary to do the job. Faulty, or malicious software will therefore (hopefully) not be able to damage / compromise your system.

现在.

未经测试的软件可能包含错误.

Untested software may contain bugs.

不,保护那个.

未经测试的软件包含错误.

Untested software will contain bugs.

这可能会导致文件被覆盖、设置被更改等各种情况.

This could result in files being overwritten, settings being changed, all kinds of things.

丢失文件 "test.txt" 是一回事.有错误的正则表达式会清除一半的注册表,或者系统库(或已完成 90% 的硕士论文...)中的错误输入的文件路径被覆盖是另一回事.

It's one thing to loose a file "test.txt". It's another thing to have a faulty regular expression wipe out half your registry, or a mistyped file path end up in system libraries (or your 90%-finished master thesis...) being overwritten.

运行你的软件——任何软件,实际上——用尽可能少的权限集仍然可以完成它的工作.

Run your software -- any software, actually -- with the minimum set of permissions possible to still do its job.

这篇关于为什么在管理员模式下运行自己编写的、未经测试的代码是个坏主意?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆