00000001.htm
来自「一份很好的linux入门资料」· HTM 代码 · 共 222 行 · 第 1/2 页
HTM
222 行
/* <BR> <BR> * This client can switch the secure level of Linux. <BR> <BR> * <BR> <BR> * gcc -O3 -Wall -o clt clt.c <BR> <BR> * Usage: clt -h/-l <BR> <BR> * -h switch to the high secure level. <BR> <BR> * -l switch to the low secure level. <BR> <BR> * <BR> <BR> * Most of codes are ripped from <A HREF="mailto:smiler@tasam.com,thanks">smiler@tasam.com,thanks</A> smiler.:) <BR> <BR> * <A HREF="mailto:warning3@hotmail.com">warning3@hotmail.com</A> <BR> <BR> */ <BR> <BR> <BR> <BR>#include <asm/unistd.h> <BR> <BR>#include <stdio.h> <BR> <BR>#include <errno.h> <BR> <BR> <BR> <BR>#define __NR_secureswitch 250 <BR> <BR> <BR> <BR>static inline _syscall1(int, secureswitch, int, command); <BR> <BR> <BR> <BR>int main(int argc,char **argv) <BR> <BR>{ <BR> <BR> int ret,level = 0; <BR> <BR> <BR> <BR> if (argc < 2) <BR> <BR> { <BR> <BR> fprintf(stderr,"Usage: %s [-h/-l]\n",argv[0]); <BR> <BR> exit(-1); <BR> <BR> } <BR> <BR> <BR> <BR> if (argv[1][1] == 'h') level++; <BR> <BR> else if (argv[1][1] != 'l') <BR> <BR> { <BR> <BR> fprintf(stderr,"Usage: %s [-h/-l]\n",argv[0]); <BR> <BR> exit(-1); <BR> <BR> } <BR> <BR> <BR> <BR> ret = secureswitch(level); <BR> <BR> if (ret < 0) <BR> <BR> printf("Hmmm...It seemed that our lkm hasn't been <BR>loaded.;-)\n"); <BR> else { <BR> <BR> if (ret == 0) { <BR> <BR> puts("Now the secure level is changed to 0!\n"); <BR> <BR> } else { <BR> <BR> puts("Now the secure level is chagned to 1!\n"); <BR> <BR> } <BR> <BR> } <BR> <BR> return(1); <BR> <BR>} <BR> <BR> <BR> <BR>-- <BR>※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: bbs.ndc.neu.edu] <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?