Skip to content

Commit d893886

Browse files
Igor Drozdovlorenz
Igor Drozdov
andcommitted
Merge branch 'fix-static-build' into 'main'
sshd: exclude gssapi when building without cgo See merge request https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/720 Merged-by: Igor Drozdov <[email protected]> Approved-by: Vasilii Iakliushin <[email protected]> Approved-by: Igor Drozdov <[email protected]> Reviewed-by: Vasilii Iakliushin <[email protected]> Co-authored-by: Lorenz Brun <[email protected]>
2 parents 84324a0 + c413f99 commit d893886

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

internal/sshd/gssapi.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build cgo
2+
13
package sshd
24

35
import (

internal/sshd/gssapi_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build cgo
2+
13
package sshd
24

35
import (

internal/sshd/gssapi_unsupported.go

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//go:build !cgo
2+
3+
package sshd
4+
5+
import (
6+
"errors"
7+
8+
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/config"
9+
10+
"gitlab.com/gitlab-org/labkit/log"
11+
)
12+
13+
func LoadGSSAPILib(c *config.GSSAPIConfig) error {
14+
if c.Enabled {
15+
log.New().Error("gssapi-with-mic disabled, built without CGO")
16+
c.Enabled = false
17+
}
18+
return nil
19+
}
20+
21+
type OSGSSAPIServer struct {
22+
ServicePrincipalName string
23+
}
24+
25+
func (*OSGSSAPIServer) AcceptSecContext([]byte) ([]byte, string, bool, error) {
26+
return []byte{}, "", false, errors.New("gssapi is unsupported")
27+
}
28+
29+
func (*OSGSSAPIServer) VerifyMIC([]byte, []byte) error {
30+
return errors.New("gssapi is unsupported")
31+
}
32+
func (*OSGSSAPIServer) DeleteSecContext() error {
33+
return errors.New("gssapi is unsupported")
34+
}

0 commit comments

Comments
 (0)