这篇教程C++ syslog_action_restricted函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中syslog_action_restricted函数的典型用法代码示例。如果您正苦于以下问题:C++ syslog_action_restricted函数的具体用法?C++ syslog_action_restricted怎么用?C++ syslog_action_restricted使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了syslog_action_restricted函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: check_syslog_permissionsstatic int check_syslog_permissions(int type, bool from_file){ if (from_file && type != SYSLOG_ACTION_OPEN) return 0; if (syslog_action_restricted(type)) { if (capable(CAP_SYSLOG)) return 0; if (capable(CAP_SYS_ADMIN)) { printk_once(KERN_WARNING "%s (%d): " "Attempt to access syslog with CAP_SYS_ADMIN " "but no CAP_SYSLOG (deprecated)./n", current->comm, task_pid_nr(current)); return 0; } return -EPERM; } return 0;}
开发者ID:JmzTaylor,项目名称:Evita-Jellybean,代码行数:20,
示例2: check_syslog_permissionsstatic int check_syslog_permissions(int type, bool from_file){ /* * If this is from /proc/kmsg and we've already opened it, then we've * already done the capabilities checks at open time. */ if (from_file && type != SYSLOG_ACTION_OPEN) return 0; if (syslog_action_restricted(type)) { if (capable(CAP_SYSLOG)) return 0; /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */ if (capable(CAP_SYS_ADMIN)) { WARN_ONCE(1, "Attempt to access syslog with CAP_SYS_ADMIN " "but no CAP_SYSLOG (deprecated)./n"); return 0; } return -EPERM; } return 0;}
开发者ID:jeehong,项目名称:kernel,代码行数:22,
注:本文中的syslog_action_restricted函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ sysmem_freeptr函数代码示例 C++ syslog函数代码示例 |