nix file perms

$

$_

here is the statement

dbmopen(my %HASH, "file", 0640)

now what it is.. id like to use a more secure file permission.
something like 'others cannot read / write / execute'

its my understanding that this '0640' permission nearly does that
with the exception of allowing others in the same group read access.

i would like to continue to use this octal method.
does anyone know what number could be used for this?
 
W

Walter Roberson

:dbmopen(my %HASH, "file", 0640)

:now what it is.. id like to use a more secure file permission.
:something like 'others cannot read / write / execute'

:its my understanding that this '0640' permission nearly does that
:with the exception of allowing others in the same group read access.

:i would like to continue to use this octal method.
:does anyone know what number could be used for this?

Sounds like a Unix question, not a perl question.
In any case, you want 0600, which means that the owner is allowed
to read it (4) plus write it (2) [4+2=6] and no-one else can do
anything with it.
 
P

Paul Lalli

here is the statement

dbmopen(my %HASH, "file", 0640)

now what it is.. id like to use a more secure file permission.
something like 'others cannot read / write / execute'

its my understanding that this '0640' permission nearly does that
with the exception of allowing others in the same group read access.

i would like to continue to use this octal method.
does anyone know what number could be used for this?

This is really not Perl-related, but...
The octal number is created by three groups of three permissions. Each
group is one digit. The permissions are read (represented by the digit
in the 4s place), write (the 2s place), and execute (the 1s place). 640
octal therefore corresponds in binary to:

110 100 000

which translates to the permissions
rw- r-- ---

You want to remove the group read permissions:

rw- --- ---

This corresponds to
110 000 000

which becomes 600 octal.

Therefore, your statement should be
dbmopen(my %HASH, "file", 0600);


Paul Lalli
 
$

$_

Walter Wrote....
Sounds like a Unix question, not a perl question.
In any case, you want 0600, which means that the owner is allowed
to read it (4) plus write it (2) [4+2=6] and no-one else can do
anything with it.
Thank you sir,

This is very much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top