MCPcopy Create free account
hub / github.com/gogs/gogs / CheckRunUser

Function CheckRunUser

internal/conf/utils.go:42–49  ·  view source on GitHub ↗

CheckRunUser returns false if configured run user does not match actual user that runs the app. The first return value is the actual user name. This check is ignored under Windows since SSH remote login is not the main method to login on Windows.

(runUser string)

Source from the content-addressed store, hash-verified

40// runs the app. The first return value is the actual user name. This check is ignored
41// under Windows since SSH remote login is not the main method to login on Windows.
42func CheckRunUser(runUser string) (string, bool) {
43 if IsWindowsRuntime() {
44 return "", true
45 }
46
47 currentUser := osutil.CurrentUsername()
48 return currentUser, runUser == currentUser
49}

Callers 2

InstallPostFunction · 0.92
InitFunction · 0.85

Calls 2

CurrentUsernameFunction · 0.92
IsWindowsRuntimeFunction · 0.85

Tested by

no test coverage detected