Skip to content

Commit

Permalink
eosbinary: streamline sss and unix modes (cs3org#3713)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode authored and gmgigi96 committed Jun 28, 2023
1 parent 01d924d commit bfb1401
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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

0 comments on commit bfb1401

Please sign in to comment.