|> |>
|> |>I know a small shell program that change /etc/passwd mode, ownership
|> |>and group ! WITHOUT being Super-User !
|> |>
|> |>while true
|> |>do
|> |> link my_dir /etc/passwd &
|> |> nice -20 mkdir my_dir
|> |> ls -l /etc/passwd &
|> |>done
|> |>
|> |>(Strange ? Yes !)
|> |>
|> |>Where : my_dir is a directory with -rw-rw-rw- .
|> |>
|> |>Results are statistical. On some systems may not function.
|> |
|> |Yes, this is well known. The solution is for the superuser to type the
|> |command 'chmod og-w /etc'.
|>
|> This is well known!? How can it possibly work? The 'link' should fail
|> because normal users aren't allowed to link directories (or because
|> my_dir doesn't exist, the first time around). If mkdir has a race
|> condition in the kernel, it sure looks like a strange one... and if
|> /etc is world or group writable like your fix suggests, you have bigger
|> problems than weird races...
And, if you have a directory with '-rw-rw-rw-', you have worse problems
than a world-writable /etc :-)
More seriously, in English rather than Unix-speak, /etc/password can
also be called a directory. I had assumed a certain amount of
terminological confusion.
Nick Maclaren,
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Tel.: +44 1223 334761 Fax: +44 1223 334679