Skip to content

Commit e4a3f0b

Browse files
authored
Merge pull request #10 from coder/cj/revert-default-userid-groupid
Revert "Set default UserId and GroupId to 0:0"
2 parents ba712f2 + 224e9a0 commit e4a3f0b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/util/command_util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ Loop:
355355

356356
func GetUserGroup(chownStr string, env []string) (int64, int64, error) {
357357
if chownStr == "" {
358-
return 0, 0, nil
358+
return DoNotChangeUID, DoNotChangeGID, nil
359359
}
360360

361361
chown, err := ResolveEnvironmentReplacement(chownStr, env, false)

pkg/util/command_util_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ func TestGetUserGroup(t *testing.T) {
571571
mockIDGetter: func(string, string) (uint32, uint32, error) {
572572
return 0, 0, fmt.Errorf("should not be called")
573573
},
574-
expectedU: 0,
575-
expectedG: 0,
574+
expectedU: -1,
575+
expectedG: -1,
576576
},
577577
}
578578
for _, tc := range tests {

0 commit comments

Comments
 (0)