Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

View-Only Password same as Full Control Fix

Any features you would like to see in UltraVNC? Propose it here
Post Reply
User avatar
pgmoney
100
100
Posts: 285
Joined: 2004-06-26 22:29
Contact:

View-Only Password same as Full Control Fix

Post by pgmoney »

Since there seems to be a lot of people having problems due to setting the same password for view-only as for full-control here is a patch:

vncProperties.cpp

Code: Select all

				// Save the password
				char passwd[MAXPWLEN+1];
				// TightVNC method
				int len = GetDlgItemText(hwnd, IDC_PASSWORD, (LPSTR) &passwd, MAXPWLEN+1);
				if (strcmp(passwd, "~~~~~~~~") != 0) {
					if (len == 0)
					{
						vncPasswd::FromClear crypt;
						_this->m_server->SetPassword(crypt);
					}
					else
					{
						vncPasswd::FromText crypt(passwd);
						_this->m_server->SetPassword(crypt);
					}
				}

//PGM				memset(passwd, '\0', MAXPWLEN+1); //PGM
//PGM				len = 0; //PGM
//PGM				len = GetDlgItemText(hwnd, IDC_PASSWORD2, (LPSTR) &passwd, MAXPWLEN+1); //PGM
//PGM				if (strcmp(passwd, "~~~~~~~~") != 0) { //PGM
//PGM					if (len == 0) //PGM
//PGM					{ //PGM
//PGM						vncPasswd::FromClear crypt2; //PGM
//PGM						_this->m_server->SetPassword2(crypt2); //PGM
//PGM					} //PGM
//PGM					else //PGM
//PGM					{ //PGM
//PGM						vncPasswd::FromText crypt2(passwd); //PGM
//PGM						_this->m_server->SetPassword2(crypt2); //PGM
//PGM					} //PGM
//PGM				} //PGM

				char passwd2[MAXPWLEN+1]; //PGM
				len = 0; //PGM
				len = GetDlgItemText(hwnd, IDC_PASSWORD2, (LPSTR) &passwd2, MAXPWLEN+1); //PGM
				if (strcmp(passwd2, "~~~~~~~~") != 0) { //PGM
					if (len == 0) //PGM
					{ //PGM
						vncPasswd::FromClear crypt2; //PGM
						_this->m_server->SetPassword2(crypt2); //PGM
					} //PGM
					else //PGM
					{ //PGM
						if (strcmp(passwd2, passwd) != 0) { //PGM
							vncPasswd::FromText crypt2(passwd2); //PGM
							_this->m_server->SetPassword2(crypt2); //PGM
						} //PGM
						else //PGM
						{ //PGM
							MessageBoxSecure(NULL, "The View-Only password cannot be the same as the full-control passsword", "View-Only Password Error", MB_ICONERROR); //PGM
				            break; //PGM
						} //PGM
					} //PGM
				} //PGM

				// Save the new settings to the server
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: View-Only Password same as Full Control Fix

Post by B »

Great! We've need this for a long time.
Post Reply