简体   繁体   English

为什么Redline RPM设置超级奇怪的权限?

[英]Why is Redline RPM setting super weird permissions?

Background: I'm using the Redline Java library to build an rpm. 背景:我正在使用Redline Java库来构建rpm。

I'm trying to set a basic 774 permission for my file like so: 我正在尝试为文件设置基本的774权限,如下所示:

builder.addFile(rpmFileName,new File(sourceName), 774, -1, defaultUser, defaultGroup)

but this results in creating files with super weird permissions like d--x------T where even the default user can't so much as read the file. 但这会导致创建具有诸如d--x ------ T之类的超级奇怪权限的文件,在该文件中,即使默认用户也无法读取文件。

Why isn't this working? 为什么这不起作用?

The documentation for Builder says 生成器的文档

mode - the mode of the target file in standard three octet notation mode-目标文件的模式,采用标准的三个八位字节表示法

but this doesn't mean you should enter the mode as you'd expect to read it with an 'll' command in Unix. 但这并不意味着您应该进入模式,就像您希望在Unix中使用“ ll”命令读取它一样。 Instead, you must give the input in decimal format or explicitly indicate that the entry is octal by putting a '0' in front. 取而代之的是,您必须以十进制格式提供输入,或者通过在前面加一个“ 0”来明确表明该输入是八进制的。 So to enter 774, you'll need to put 508 or 0774. To set permissions of 664, you'll need to put 436 or 0664. 因此,要输入774,您需要输入508或0774。要设置权限664,您需要输入436或0664。

Using a calculator in Programmer mode should make the conversion easy (enter desired value (774) as OCT and then read the DEC value (508)) 在程序员模式下使用计算器应该使转换变得容易(将所需值(774)作为OCT输入,然后读取DEC值(508))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM