SUNRPC: remove machine_cred field from struct auth_cred

The cred is a machine_cred iff ->principal is set, so there is no
need for the extra flag.

There is one case which deserves some
explanation. nfs4_root_machine_cred() calls rpc_lookup_machine_cred()
with a NULL principal name which results in not getting a machine
credential, but getting a root credential instead.
This appears to be what is expected of the caller, and is
clearly the result provided by both auth_unix and auth_gss
which already ignore the flag.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
NeilBrown
2018-12-03 11:30:30 +11:00
committed by Anna Schumaker
parent 8276c902bb
commit 1a80810fbf
3 changed files with 8 additions and 12 deletions

View File

@@ -46,9 +46,8 @@ enum {
struct auth_cred {
const struct cred *cred;
const char *principal;
const char *principal; /* If present, this is a machine credential */
unsigned long ac_flags;
unsigned char machine_cred : 1;
};
/*