Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eosbinary: streamline sss and unix modes #3713

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/unreleased/enhancement-eos-krb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Streamline EOS SSS and UNIX modes

https://github.com/cs3org/reva/pull/3713
13 changes: 11 additions & 2 deletions pkg/eosclient/eosbinary/eosbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ type Options struct {

// SecProtocol is the comma separated list of security protocols used by xrootd.
// For example: "sss, unix"
// DEPRECATED
// This variable is no longer used. Only sss and unix protocols are possible.
// If UseKeytab is set to true the protocol will be set to "sss", else to "unix"
SecProtocol string

// TokenExpiry stores in seconds the time after which generated tokens will expire
Expand Down Expand Up @@ -168,8 +171,11 @@ func (c *Client) executeXRDCopy(ctx context.Context, cmdArgs []string) (string,
}

if c.opt.UseKeytab {
cmd.Env = append(cmd.Env, "XrdSecPROTOCOL="+c.opt.SecProtocol)
cmd.Env = append(cmd.Env, "XrdSecPROTOCOL=sss")
cmd.Env = append(cmd.Env, "XrdSecSSSKT="+c.opt.Keytab)
} else { // we are a trusted gateway
cmd.Env = append(cmd.Env, "XrdSecPROTOCOL=unix")
cmd.Env = append(cmd.Env, "KRB5CCNAME=FILE:/dev/null") // do not try to use krb
}

err := cmd.Run()
Expand Down Expand Up @@ -225,8 +231,11 @@ func (c *Client) executeEOS(ctx context.Context, cmdArgs []string, auth eosclien
}

if c.opt.UseKeytab {
cmd.Env = append(cmd.Env, "XrdSecPROTOCOL="+c.opt.SecProtocol)
cmd.Env = append(cmd.Env, "XrdSecPROTOCOL=sss")
cmd.Env = append(cmd.Env, "XrdSecSSSKT="+c.opt.Keytab)
} else { // we are a trusted gateway
cmd.Env = append(cmd.Env, "XrdSecPROTOCOL=unix")
cmd.Env = append(cmd.Env, "KRB5CCNAME=FILE:/dev/null") // do not try to use krb
}

cmd.Args = append(cmd.Args, cmdArgs...)
Expand Down