摘要: User namespaces – available toplay!Posted onMay 10, 2012bys3hhOver the past few months, Eric Biederman has been working on completing the user namespace. Briefly, unprivileged users can create a user namespace, where he can pretend to be root and start new namespaces (i.e. network and pid) which he 阅读全文
posted @ 2013-08-15 21:04 jeremyatchina 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 其中setresuid()具有最清晰的语法:setresuid()被执行的条件有:①当前进程的euid是root②三个参数,每一个等于原来某个id中的一个如果满足以上条件的任意一个,setresuid()都可以正常调用,并执行,将进程的ID设置成对应的ID。例子:如果ruid=100,euid=0,suid=300则setresuid(200,300,100)可以执行,因为原来的euid=0.如果ruid=100,euid=300,suid=200则setresuid(200,300,100)也可以执行,因为这三个新的id都是原来id中的某一个。但是setresuid(100,200,400) 阅读全文
posted @ 2013-08-15 18:51 jeremyatchina 阅读(845) 评论(1) 推荐(0) 编辑
摘要: 通常在PC上寫程式時,很少會去管struct會佔掉多少記憶體。當要使用到時,也不會想去用手算到底佔掉多少,大多是直接使用sizeof來做計算。然而sizeof計算出來的值往往不會如我們想的一樣。因為compiler為了效能考量,會自動地為我們做最佳化,也就是資料對齊。為了這個目的,compiler會為struct多準備一些記憶體。我們可以看以下的code:struct ABC {int index;char name[6];int score;};struct DEF{int att;char name[3];};int main(void){printf("sizeof(ABC) 阅读全文
posted @ 2013-08-15 09:14 jeremyatchina 阅读(737) 评论(0) 推荐(0) 编辑