可以检查ioctl的权限
Is possible to check rights to ioctl
我正在为嵌入式设备编写网络配置系统,它使用ioctl调用。在启动系统时,我需要检查将来调用的权利。是否有可能检查足够或没有足够的特权ioctl(ID)
调用而不调用ioctl?
我不知道这是否回答了你的问题,但是你看了能力吗?
if (!CAP_IS_SUPPORTED(CAP_NET_ADMIN)){
EXIT_FAIL("Capability CAP_NET_ADMIN is not supportedn");
}
摘自man:
...
CAP_NET_ADMIN
Perform various network-related operations:
* interface configuration;
* administration of IP firewall, masquerading, and accounting
* modify routing tables;
* bind to any address for transparent proxying;
* set type-of-service (TOS)
* clear driver statistics;
* set promiscuous mode;
* enabling multicasting;
...
这听起来真是糟糕的设计,你不能检查"right to future calls",因为有些东西可能会改变。毕竟,这是未来,所以很难预测,许多技术解决方案最好不要尝试。
如果您认为调用"应该"成功,但无论如何都失败了,您仍然需要处理它。因此,您也可以处理权限失败,而不必费心尝试提前检查它。
相关文章:
- Termux权限被拒绝
- AWS Lambda C++运行时权限被拒绝
- 为什么 KMS drmModeSetCrtc() 在 X11 会话中运行时会失败并被拒绝权限?
- 编写一个函数来删除单链表中的节点(尾部除外),仅授予对该节点的访问权限
- 在没有管理员权限的情况下连接到同一网络中的命名管道
- 为什么我在空指针错误(链表)中获取成员访问权限
- Q没有管理权限的 exe 无法启动维护工具
- 在没有管理员权限的情况下,在 c++ 中以编程方式将程序添加到启动
- 如何使用Windows API C++更改已创建的文件夹/目录安全权限
- 如何修复无效的API密钥,IP或操作权限错误?
- 在 Linux 中使用 ioctl() 获取隐藏功能报告时,零字节消失
- 使用崇高文本 3 进行C++拒绝授予权限?
- 为什么"delete"操作员给我访问权限冲突
- 从根权限进程创建可访问的文件
- Android因为权限问题而杀死Qt应用程序
- 具有管理员权限的外壳执行不会结束
- 父级的子属性 - 访问权限
- ioctl错误在SPI传输函数中返回-1 EINVAL
- 正在等待在非阻塞文件描述符上长时间运行ioctl
- 可以检查ioctl的权限