In a PAM configuration file, which of the following is true about the required control flag?
A. If the module returns success, no more modules of the same type will be invoked
B. The success of the module is needed for the module-type facility to succeed. If it returns a failure, control is returned to the calling application
C. The success of the module is needed for the module-type facility to succeed. However, all remaining modules of the same type will be invoked
D. The module is not critical and whether it returns success or failure is not important
E. If the module returns failure, no more modules of the same type will be invoked
题解
PAM 设置档的格式如下:
服务名称 类型 验证后要做的事 模块路径 模块参数
其中,类型有以下几种:
- account:提供帐号检验。像是用户的密码是否过期,用户是否有被允许访问某项服务等。
- auth:提供用户身份验证。像是要求用户输入密码,或是使用视网膜、指纹辨识周边设备来验证身份。
- password:提供用户身分验证的修订功能。像是修改密码。
- session:记录用户登录后到注销前的信息。
验证后要做的事有以下几种:
- requisite:验证失败的话立刻回报。
- required:验证失败的话不立刻回报,会在其它模块都调用完毕后才回报。
- sufficient:验证成功的话立刻回报。
- optional:只有在这个服务和类型仅使用一个模块时,验证有无成功才是重要的。这个通常是拿来显示消息用的。
所以选项「C」是正确答案。
