Re: how auth "local" works and is documented

Chapman Flack <[email protected]>
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
On 04/13/2017 08:12 AM, Jean-Louis Martineau wrote:

> amanda do a validation to be sure the hostname written in the disklist
> is the same server.
> We don't want amanda to backup localhost when the user is expecting to
> backup a remote host.

Understood. And it is a good idea to do that validation. But that is
not what the current code is doing.

The current code is just trying to match exact spelling against
gethostname() or a couple of hardcoded alternatives.

If the server's gethostname() returns foo.example.com and the disklist
refers to foo, auth "local" will say "foo: is not local".

https://github.com/zmanda/amanda/blame/d78f4b1/common-src/local-security.c#L128

The admin will certainly know the machine is local and the message
is bogus, but will not know the reason for the bogus message without
reading the code, because amanda-auth(7) is silent on what is being
validated and how.

If the admin, like my predecessor, doesn't have time to figure out
why auth "local" is giving a bogus error, and just changes it to
connect with "bsdtcp" to itself instead because that works, then
later on there is no possible correction without changing the spelling
of the host in the disklist, which then makes years of prior backups
hard to recover because of the old spelling retained in headers on
tapes.

So, if the purpose of the validation is "to be sure the hostname
written in the disklist is the same server", then that is what
should be checked, which is what the pseudocode in my earlier message
will do.

-Chap
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.