Chinaunix首页 | 论坛 | 博客
  • 博客访问: 676873
  • 博文数量: 108
  • 博客积分: 3236
  • 博客等级: 中校
  • 技术积分: 906
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-04 21:23
文章分类

全部博文(108)

文章存档

2011年(33)

2010年(75)

我的朋友

分类: LINUX

2010-11-03 12:55:52

今天在运行一个软件时,遇到这样一个错误:
cannot restore segment prot after reloc
解决方法:
    运行命令:chcon -t textrel_shlib_t file_name

chcon命令:
修改对象(文件)的安全上下文

命令格式:

   Chcon [OPTIONS…] CONTEXT FILES…..

   Chcon [OPTIONS…] –reference=PEF_FILES FILES…

说明:

    CONTEXT 为要设置的安全上下文

    FILES 对象(文件)

    --reference  参照的对象

    PEF_FILES  参照文件上下文

    FILES      应用参照文件上下文为我的上下文。

    OPTIONS 如下:

        -f          强迫执行

        -R         递归地修改对象的安全上下文

        -r ROLE    修改安全上下文角色的配置

        -t TYPE    修改安全上下文类型的配置

        -u USER   修改安全上下文用户的配置

                  -v         显示冗长的信息



chcon --help
Usage: chcon [OPTION]... CONTEXT FILE...
 
 or:  chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...
 
 or:  chcon [OPTION]... --reference=RFILE FILE...
Change the security context of each FILE to CONTEXT.

  -c, --changes          like verbose but report only when a change is made
 
 -h, --no-dereference   affect symbolic links instead of any referenced file
 
                       (available only on systems with lchown system call)
 
 -f, --silent, --quiet  suppress most error messages
 
    --reference=RFILE  use RFILE's group instead of using a CONTEXT value
 
 -u, --user=USER        set user USER in the target security context
 
 -r, --role=ROLE        set role ROLE in the target security context
 
 -t, --type=TYPE        set type TYPE in the target security context
 
 -l, --range=RANGE      set range RANGE in the target security context
 
 -R, --recursive        change files and directories recursively
 
 -v, --verbose          output a diagnostic for every file processed
 
    --help             display this help and exit
 
    --version          output version information and exit

示例:
    1、chcon -t texrel_shlib_t file_name
    2、chcon -t textrel_shlib_t file_name
阅读(3189) | 评论(0) | 转发(0) |
0

上一篇:POSIX 线程详解(1)

下一篇:H.264标准详解

给主人留下些什么吧!~~