mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-14 17:42:03 -04:00
Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.6 to 2.2.7. - [Release notes](https://github.com/gookit/config/releases) - [Commits](https://github.com/gookit/config/compare/v2.2.6...v2.2.7) --- updated-dependencies: - dependency-name: github.com/gookit/config/v2 dependency-version: 2.2.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
28 lines
700 B
Go
28 lines
700 B
Go
//go:build windows
|
|
|
|
package sysutil
|
|
|
|
// ChangeUserByName change work user by new username.
|
|
func ChangeUserByName(newUname string) error {
|
|
return ChangeUserUIDGid(0, 0)
|
|
}
|
|
|
|
// ChangeUserUidGid change work user by new username uid,gid
|
|
//
|
|
// Deprecated: use ChangeUserUIDGid instead
|
|
func ChangeUserUidGid(newUid int, newGid int) error {
|
|
return ChangeUserUIDGid(newUid, newGid)
|
|
}
|
|
|
|
// ChangeUserUIDGid change work user by new username uid,gid
|
|
func ChangeUserUIDGid(newUid int, newGid int) (err error) {
|
|
return nil
|
|
}
|
|
|
|
// IsAdmin Determine whether the current user is an administrator
|
|
func IsAdmin() bool {
|
|
// 执行 net session 判断
|
|
_, err := ExecCmd("net", []string{"session"})
|
|
return err == nil
|
|
}
|