summaryrefslogtreecommitdiff
path: root/pkg/systemd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-27 04:50:01 -0400
committerGitHub <noreply@github.com>2022-04-27 04:50:01 -0400
commit053b09660ffbe2df2104186c67e39be70764ff63 (patch)
treeb9d8d32e146eb1ca1a3385e61b24d276dabc1cf0 /pkg/systemd
parent5ac00a7287e4a9e6292f4a6ca5dfa9a02e5ca907 (diff)
parent4f8ece76fff31d31570af56e0ec4a4092e015b33 (diff)
downloadpodman-053b09660ffbe2df2104186c67e39be70764ff63.tar.gz
podman-053b09660ffbe2df2104186c67e39be70764ff63.tar.bz2
podman-053b09660ffbe2df2104186c67e39be70764ff63.zip
Merge pull request #13997 from Luap99/gocritic
enable gocritic linter
Diffstat (limited to 'pkg/systemd')
-rw-r--r--pkg/systemd/dbus.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/systemd/dbus.go b/pkg/systemd/dbus.go
index b35f778ab..6887a466e 100644
--- a/pkg/systemd/dbus.go
+++ b/pkg/systemd/dbus.go
@@ -26,39 +26,39 @@ func IsSystemdSessionValid(uid int) bool {
if rootless.IsRootless() {
conn, err = GetLogindConnection(rootless.GetRootlessUID())
if err != nil {
- //unable to fetch systemd object for logind
+ // unable to fetch systemd object for logind
logrus.Debugf("systemd-logind: %s", err)
return false
}
object = conn.Object(dbusDest, godbus.ObjectPath(dbusPath))
if err := object.Call(dbusInterface+".GetSeat", 0, "seat0").Store(&seat0Path); err != nil {
- //unable to get seat0 path.
+ // unable to get seat0 path.
logrus.Debugf("systemd-logind: %s", err)
return false
}
seat0Obj := conn.Object(dbusDest, seat0Path)
activeSession, err := seat0Obj.GetProperty(dbusDest + ".Seat.ActiveSession")
if err != nil {
- //unable to get active sessions.
+ // unable to get active sessions.
logrus.Debugf("systemd-logind: %s", err)
return false
}
activeSessionMap, ok := activeSession.Value().([]interface{})
if !ok || len(activeSessionMap) < 2 {
- //unable to get active session map.
+ // unable to get active session map.
logrus.Debugf("systemd-logind: %s", err)
return false
}
activeSessionPath, ok := activeSessionMap[1].(godbus.ObjectPath)
if !ok {
- //unable to fetch active session path.
+ // unable to fetch active session path.
logrus.Debugf("systemd-logind: %s", err)
return false
}
activeSessionObj := conn.Object(dbusDest, activeSessionPath)
sessionUser, err := activeSessionObj.GetProperty(dbusDest + ".Session.User")
if err != nil {
- //unable to fetch session user from activeSession path.
+ // unable to fetch session user from activeSession path.
logrus.Debugf("systemd-logind: %s", err)
return false
}
@@ -75,7 +75,7 @@ func IsSystemdSessionValid(uid int) bool {
if !ok {
return false
}
- //active session found which belongs to following rootless user
+ // active session found which belongs to following rootless user
if activeUID == uint32(uid) {
return true
}