changeuid.hh

来自「COPE the first practical network coding 」· HH 代码 · 共 56 行

HH
56
字号
// -*- mode: c++; c-basic-offset: 4 -*-#ifndef CLICK_CHANGEUID_HH#define CLICK_CHANGEUID_HH#include <click/element.hh>#include <click/timer.hh>CLICK_DECLS/*=cChangeUID()=s userlevelrelinquish root privilege=ioNone=dSets the current process's effective user and group IDs to its real user andgroup IDs, respectively.  This relinquishes any set-uid-root privilege.=nChangeUID's configure phase is set so that it runs immediately after the"privileged" elements FromDevice.u and ToDevice.u, but before most otherelements.  Thus, this configuration:   f1 :: FromDevice(eth0) -> ...   f2 :: FromDump(/tmp/x) -> ...   ChangeUID()should fail to initialize if the user cannot read file F</tmp/x>.  However,your mileage may vary.  Set-uid-root programs are a bad idea, and Click is noexception.*/class ChangeUID : public Element { public:    ChangeUID();    ~ChangeUID();    const char *class_name() const	{ return "ChangeUID"; }    int configure_phase() const		{ return CONFIGURE_PHASE_PRIVILEGED+1; }    int initialize(ErrorHandler *);};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?