From 03d3a29b70c85f083adf3c12cba60c0374f06d3e Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 27 Nov 2019 11:40:47 -0800 Subject: Rename some variables from 'target' to 'targetUser' Refer to the target User as 'targetUser' rather than simply 'target'. This will help avoid confusion when we add support for the filesystem keyring, since then the Mount will also be a "target". --- cmd/fscrypt/flags.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cmd/fscrypt/flags.go') diff --git a/cmd/fscrypt/flags.go b/cmd/fscrypt/flags.go index a7992d3..16a75dc 100644 --- a/cmd/fscrypt/flags.go +++ b/cmd/fscrypt/flags.go @@ -255,18 +255,18 @@ func matchMetadataFlag(flagValue string) (mountpoint, descriptor string, err err // parseMetadataFlag takes the value of either protectorFlag or policyFlag // formatted as MOUNTPOINT:DESCRIPTOR, and returns a context for the mountpoint // and a string for the descriptor. -func parseMetadataFlag(flagValue string, target *user.User) (*actions.Context, string, error) { +func parseMetadataFlag(flagValue string, targetUser *user.User) (*actions.Context, string, error) { mountpoint, descriptor, err := matchMetadataFlag(flagValue) if err != nil { return nil, "", err } - ctx, err := actions.NewContextFromMountpoint(mountpoint, target) + ctx, err := actions.NewContextFromMountpoint(mountpoint, targetUser) return ctx, descriptor, err } // getProtectorFromFlag gets an existing locked protector from protectorFlag. -func getProtectorFromFlag(flagValue string, target *user.User) (*actions.Protector, error) { - ctx, descriptor, err := parseMetadataFlag(flagValue, target) +func getProtectorFromFlag(flagValue string, targetUser *user.User) (*actions.Protector, error) { + ctx, descriptor, err := parseMetadataFlag(flagValue, targetUser) if err != nil { return nil, err } @@ -274,8 +274,8 @@ func getProtectorFromFlag(flagValue string, target *user.User) (*actions.Protect } // getPolicyFromFlag gets an existing locked policy from policyFlag. -func getPolicyFromFlag(flagValue string, target *user.User) (*actions.Policy, error) { - ctx, descriptor, err := parseMetadataFlag(flagValue, target) +func getPolicyFromFlag(flagValue string, targetUser *user.User) (*actions.Policy, error) { + ctx, descriptor, err := parseMetadataFlag(flagValue, targetUser) if err != nil { return nil, err } -- cgit v1.2.3