摘要: 在linux中每个进程有三个[实际上有第4个]用户标识符. real uid : 真实用户ID. saved uid : 已保存用户ID effective uid : 有效用户ID 真实用户ID(real uid)是login时的用户.而在运行过程中,用于所有的安全检查的是有效用户ID(effective uid).一般情况下: real uid = saved uid = effective uid 在某些场合下,使用用setuid,setruid函数可以改变effective uid,从而使得程序运行时具有特殊... 阅读全文
posted @ 2013-01-10 16:15 _yma 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 今天看到一段关于capset()的代码, struct __user_cap_header_struct header; struct __user_cap_data_struct cap; header.version = _LINUX_CAPABILITY_VERSION; header.pid = 0; cap.effective = cap.permitted = (1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW); cap.inheritable = 0; capset(&header, &cap); 找了下对c 阅读全文
posted @ 2013-01-10 15:45 _yma 阅读(1480) 评论(0) 推荐(0) 编辑