void SessionExit(struct display *d, int status, int removeAuth) { #ifdef USE_PAM pam_handle_t *pamh = thepamh(); if (pamh) { /* shutdown PAM session */ if (pam_setcred(pamh, PAM_DELETE_CRED) != PAM_SUCCESS) WDMError("pam_setcred(DELETE_CRED) failed, errno=%d", errno); pam_close_session(pamh, 0); pam_end(pamh, PAM_SUCCESS); pamh = NULL; } #endif /* make sure the server gets reset after the session is over */ if (d->serverPid >= 2 && d->resetSignal) kill(d->serverPid, d->resetSignal); else ResetServer(d); if (removeAuth) { setgid(verify.gid); setuid(verify.uid); RemoveUserAuthorization(d, &verify); } WDMDebug("Display %s exiting with status %d\n", d->name, status); exit(status); }
void SessionExit (struct display *d, int status, int removeAuth) { #ifdef USE_PAM pam_handle_t *pamh = thepamh(); #endif #ifdef USE_PAM if (pamh) { /* shutdown PAM session */ pam_close_session(pamh, 0); pam_end(pamh, PAM_SUCCESS); pamh = NULL; } #endif /* make sure the server gets reset after the session is over */ if (d->serverPid >= 2 && d->resetSignal) kill (d->serverPid, d->resetSignal); else ResetServer (d); if (removeAuth) { setgid (verify.gid); setuid (verify.uid); RemoveUserAuthorization (d, &verify); #ifdef K5AUTH /* do like "kdestroy" program */ { krb5_error_code code; krb5_ccache ccache; code = Krb5DisplayCCache(d->name, &ccache); if (code) LogError("%s while getting Krb5 ccache to destroy\n", error_message(code)); else { code = krb5_cc_destroy(ccache); if (code) { if (code == KRB5_FCC_NOFILE) { Debug ("No Kerberos ccache file found to destroy\n"); } else LogError("%s while destroying Krb5 credentials cache\n", error_message(code)); } else Debug ("Kerberos ccache destroyed\n"); krb5_cc_close(ccache); } } #endif /* K5AUTH */ } Debug ("Display %s exiting with status %d\n", d->name, status); exit (status); }
void CClassView::OnShowWindow(BOOL bShow, UINT nStatus) { CFormView::OnShowWindow(bShow, nStatus); static BOOL IsValid = FALSE; if( bShow && !IsValid ) { IsValid = TRUE; m_client.Load("GacShell.dll"); m_server.Load("GasShell.dll"); m_Image.Create(16,16,ILC_COLOR16|ILC_MASK,0,1); m_Image.Add( ::AfxGetApp()->LoadIcon( IDI_EMPTY ) ); m_Image.Add( ::AfxGetApp()->LoadIcon( IDI_SERVER ) ); m_Image.Add( ::AfxGetApp()->LoadIcon( IDI_CLIENT ) ); m_Image.Add( ::AfxGetApp()->LoadIcon( IDI_SERVERCLASS ) ); m_Image.Add( ::AfxGetApp()->LoadIcon( IDI_CLIENTCLASS ) ); m_Image.Add( ::AfxGetApp()->LoadIcon( IDI_OBJECT ) ); m_classTree.SetImageList(&m_Image, TVSIL_NORMAL); HTREEITEM hItem = m_classTree.GetChildItem( TVI_ROOT ); TVINSERTSTRUCT Item; Item.hParent = TVI_ROOT; Item.hInsertAfter = TVI_LAST; Item.item.mask = TVIF_IMAGE|TVIF_PARAM|TVIF_TEXT|TVIF_SELECTEDIMAGE; Item.item.iImage = 0; Item.item.iSelectedImage = 0; Item.item.lParam = 0; //(LPARAM)m_curSelResSet; Item.item.pszText = "游戏逻辑类"; // (LPSTR)m_curSelResSet->m_resSetName.c_str(); HTREEITEM hSetItem = m_classTree.InsertItem( &Item ); Item.hParent = hSetItem; Item.item.iImage = 1; Item.item.iSelectedImage = 1; Item.item.lParam = 0; // (LPARAM)&(m_curSelResSet->m_2DResSet); Item.item.pszText = "服务器端逻辑类"; ResetServer(m_classTree.InsertItem( &Item )); Item.hParent = hSetItem; Item.item.iImage = 2; Item.item.iSelectedImage = 2; Item.item.lParam = 0; // (LPARAM)&(m_curSelResSet->m_3DResSet); Item.item.pszText = "客户端逻辑类"; ResetClient(m_classTree.InsertItem( &Item )); m_classTree.Expand( hSetItem, TVE_EXPAND ); } }
__dead void SessionExit (struct display *d, int status, int removeAuth) { /* make sure the server gets reset after the session is over */ if (d->serverPid >= 2 && d->resetSignal) kill (d->serverPid, d->resetSignal); else ResetServer (d); if (removeAuth) { if (setgid (verify.gid) == -1) { LogError( "SessionExit: setgid: %s\n", strerror(errno)); exit(status); } if (setuid (verify.uid) == -1) { LogError( "SessionExit: setuid: %s\n", strerror(errno)); exit(status); } RemoveUserAuthorization (d, &verify); } Debug ("Display %s exiting with status %d\n", d->name, status); exit (status); }
void Server::ConfigurationMode() { ResetServer(true); }
void Server::Reset() { ResetServer(false); }