Skip to content

Commit 7e92315

Browse files
committed
fixup! pam/main-exec: Exit with failure if the the server connection is gone
1 parent 4358b65 commit 7e92315

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pam/main-exec.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,11 @@ func mainFunc() error {
3939
return fmt.Errorf("%w: no connection provided", pam.ErrSystem)
4040
}
4141

42-
ctx, cancel := context.WithCancel(context.Background())
43-
defer cancel()
44-
45-
mTx, closeFunc, err := dbusmodule.NewTransaction(ctx, serverAddress)
42+
mTx, _, err := dbusmodule.NewTransaction(context.Background(), serverAddress)
4643
if err != nil {
4744
return fmt.Errorf("%w: can't connect to server: %w", pam.ErrSystem, err)
4845
}
49-
defer closeFunc()
46+
// defer closeFunc()
5047

5148
actionDone := make(chan struct{})
5249
defer close(actionDone)

0 commit comments

Comments
 (0)