Skip to content

Commit 7c354f5

Browse files
committed
CLOUD-57217 disable shell for saltuser
1 parent b9d711c commit 7c354f5

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BINARY=salt-bootstrap
22

3-
VERSION=0.2.0
3+
VERSION=0.2.1
44
BUILD_TIME=$(shell date +%FT%T)
55
LDFLAGS=-ldflags "-X github.com/sequenceiq/salt-bootstrap/saltboot.Version=${VERSION} -X github.com/sequenceiq/salt-bootstrap/saltboot.BuildTime=${BUILD_TIME}"
66

saltboot/salt_test.go

-15
This file was deleted.

saltboot/user.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,11 @@ func CreateUser(saltMaster SaltMaster) (resp model.Response, err error) {
4444
if err != nil {
4545
return model.Response{ErrorText: err.Error(), StatusCode: http.StatusInternalServerError}, err
4646
}
47-
result, err = ExecCmd("adduser", "--password", hash, SALT_USER)
47+
result, err = ExecCmd("adduser", "-G", "wheel", "-s", "/bin/false", "--password", hash, SALT_USER)
4848

4949
if err != nil {
5050
return model.Response{ErrorText: err.Error(), StatusCode: http.StatusInternalServerError}, err
5151
}
52-
result, err = ExecCmd("usermod", "-G", "wheel", SALT_USER)
53-
if err != nil {
54-
return model.Response{ErrorText: err.Error(), StatusCode: http.StatusInternalServerError}, err
55-
}
5652
} else {
5753
log.Printf("[CreateUser] user: %s exsist", SALT_USER)
5854
}

0 commit comments

Comments
 (0)