[GRASSGUI] Re: [grass-addons] r343 - trunk/grassaddons/gui

Glynn Clements glynn at gclements.plus.com
Tue Mar 27 18:34:45 EDT 2007


Michael Barton wrote:

> Aha! A further clarification. Is octal base 8? (Pardon my novicity, but I
> don't use this much).

Yes. Octal is base 8, so one octal digit equals 3 bits. In the case of
file permissions, those 3 bits map directly to the "rwx" bits, so each
of u(ser), g(roup) and o(ther) get one octal digit each. This is why
octal has remained in common use (e.g. the "chmod" command
automatically reads numeric permissions as octal) for permissions
while hexadecimal has replaced it almost everywhere else.

	digit	permissions

	0	---
	1	--x	[*]
	2	-w-	[*]
	3	-wx	[*]
	4	r--
	5	r-x
	6	rw-
	7	rwx

[*] 1 (--x) is often used for directories, so that normal users can
access files and subdirectories if they know the name but can't list
the directory. It may also be used for setuid/setgid executables, to
prevent users from analysing the binary in search of potential
security holes.

[*] 2 (-w-, i.e. write-only) is uncommon, although may be used (via
"mesg y") for tty devices to allow other users to send messages using
the "write" command.

[*] 3 (-wx, write and execute but not read) is essentially unheard of.

Uses for the other possibilites should be relatively obvious.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-gui mailing list