Skip to content
Snippets Groups Projects
Commit 88675354 authored by Craig Hendricks's avatar Craig Hendricks
Browse files

Merge branch sbbs:master into massive-mrc-update-20250303

parents c1ef853a f08ee496
Branches
No related tags found
No related merge requests found
Pipeline #8645 passed
......@@ -46,7 +46,7 @@ spec:
script:
- cd 3rdp/build
- touch depend
- JS_CONFIGURE_ARGS="--cache-file=../../../../../build/smconfig.cache" $[[ inputs.gnu_make ]] $[[ inputs.build_flags ]] $BUILD_ARGS libmozjs
- $[[ inputs.gnu_make ]] $[[ inputs.build_flags ]] $BUILD_ARGS libmozjs
- mkdir -p "/tmp/gitlab-runner/$[[ inputs.os ]]-$[[ inputs.platform ]]-${CI_PIPELINE_ID}"
- cd ../..
- tar -czf "/tmp/gitlab-runner/$[[ inputs.os ]]-$[[ inputs.platform ]]-${CI_PIPELINE_ID}/spidermonkey.tgz" 3rdp/*.release/mozjs
......@@ -56,10 +56,6 @@ spec:
- if: '"$[[ inputs.no_javascript ]]" == "yes"'
when: never
- !reference [.rules, rules]
cache:
key: $CI_JOB_NAME
paths:
- 3rdp/build/smconfig.cache*
"$[[ inputs.os ]]-$[[ inputs.platform ]] [cryptlib]":
extends:
......
......@@ -355,6 +355,19 @@ By default, DDLightbarMenu ignores the isSelectable attribute of items and consi
selectable (for efficiency). To enable usage of unselectable items, set the allowUnselectableItems
property to true:
lbMenu.allowUnselectableItems = true;
If the user's terminal doesn't support ANSI, DDLightbarMenu will work in a non-lightbar
mode. When not using a lightbar interface, DDLightbarMenu will automatically use numbered
mode, where the menu will output numbers to the left of the menu items and let the user
type a number to choose an item.
You can also tell DDLightbarMenu to not work in lightbar mode if you want a more traditional
user interface (colors will still be supported) by setting the allowANSI property to false:
lbMenu.allowANSI = false;
For the traditional/non-lightbar mode, you can customize the prompt text that is used, by
changing the nonANSIPromptText property. For instance:
lbMenu.nonANSIPromptText = "Type a number to choose an item: ";
*/
"use strict";
......@@ -535,6 +548,9 @@ function DDLightbarMenu(pX, pY, pWidth, pHeight)
// Whether or not to allow ANSI behavior. Mainly for testing (this should be true).
this.allowANSI = true;
// Text to use for the user input prompt for the non-ANSI interface
this.nonANSIPromptText = "\x01n\x01c\x01hY\x01n\x01cour \x01hC\x01n\x01choice\x01h\x01g: \x01c";
// Member functions
this.Add = DDLightbarMenu_Add;
this.Remove = DDLightbarMenu_Remove;
......@@ -2291,10 +2307,42 @@ function DDLightbarMenu_GetVal(pDraw, pSelectedItemIndexes)
{
// The user's terminal doesn't support ANSI
var userAnswerIsValid = false;
var writePromptText = true;
do
{
if (writePromptText)
{
if (typeof(this.nonANSIPromptText) === "string" && console.strlen(this.nonANSIPromptText) > 0)
console.print(this.nonANSIPromptText);
else
console.print("\x01n\x01c\x01hY\x01n\x01cour \x01hC\x01n\x01choice\x01h\x01g: \x01c");
}
writePromptText = true; // Default value
console.attributes = "N";
var inputMode = K_NOECHO|K_NOSPIN|K_NOCRLF;
var userInput = console.getkey(inputMode);
var userInputUpper = userInput.toUpperCase();
// Set this.lastUserInput if it's valid
if (console.aborted || userInputUpper == "Q" || userInput == CTRL_C || userInput == KEY_ESC)
{
if (userInputUpper == "Q")
this.lastUserInput = "Q";
else if (userInput == CTRL_C || userInput == KEY_ESC)
this.lastUserInput = userInput;
else if (console.aborted)
this.lastUserInput = CTRL_C;
userAnswerIsValid = true;
}
else if (this.QuitKeysIncludes(userInput))
{
this.lastUserInput = userInput;
userAnswerIsValid = true;
}
else if (/[0-9]/.test(userInput))
{
// Put the user's input back in the input buffer to
// be used for getting the rest of the message number.
console.ungetstr(userInput);
var userEnteredItemNum = console.getnum(numItems);
this.lastUserInput = userEnteredItemNum.toString();
if (!console.aborted && userEnteredItemNum > 0)
......@@ -2312,6 +2360,9 @@ function DDLightbarMenu_GetVal(pDraw, pSelectedItemIndexes)
this.lastUserInput = "Q"; // To signify quitting
userAnswerIsValid = true;
}
}
else
writePromptText = false; // Invalid user input
} while (!userAnswerIsValid && bbs.online && !js.terminated);
}
......
......@@ -7,7 +7,7 @@
// Mainly used for outgoing connections to URIs without a specified port
// Duplicates port numbers for service name aliases are included
// (e.g. both "nttp" and "news")
// (e.g. both "nntp" and "news")
var standard_service_port = {
"systat": 11, // Active Users
......
var ks = CryptKeyset("tmpkeyset", CryptKeyset.KEYOPT.CREATE);
ks.close();
file_remove("tmpkeyset");
......@@ -4724,7 +4724,7 @@ cterm_reset(struct cterminal *cterm)
struct cterminal* cterm_init(int height, int width, int xpos, int ypos, int backlines, int backcols, struct vmem_cell *scrollback, int emulation)
{
char *revision="$Revision: 1.319 $";
char *revision="$Revision: 1.320 $";
char *in;
char *out;
struct cterminal *cterm;
......
......@@ -310,7 +310,6 @@ static void internal_do_cryptInit(void)
if ((ret = cryptInit()) == CRYPT_OK) {
cryptAddRandom(NULL, CRYPT_RANDOM_SLOWPOLL);
atexit(do_cryptEnd);
cryptlib_initialized = true;
cryptInit_error = CRYPT_OK;
}
else {
......@@ -319,28 +318,24 @@ static void internal_do_cryptInit(void)
ret = cryptGetAttribute(CRYPT_UNUSED, CRYPT_OPTION_INFO_MAJORVERSION, &maj);
if (cryptStatusError(ret)) {
cryptInit_error = ret;
cryptlib_initialized = false;
cryptEnd();
return;
}
ret = cryptGetAttribute(CRYPT_UNUSED, CRYPT_OPTION_INFO_MINORVERSION, &min);
if (cryptStatusError(ret)) {
cryptInit_error = ret;
cryptlib_initialized = false;
cryptEnd();
return;
}
ret = cryptGetAttribute(CRYPT_UNUSED, CRYPT_OPTION_INFO_STEPPING, &stp);
if (cryptStatusError(ret)) {
cryptInit_error = ret;
cryptlib_initialized = false;
cryptEnd();
return;
}
tmp = (maj * 100) + (min * 10) + stp;
if (tmp != CRYPTLIB_VERSION) {
cryptInit_error = CRYPT_ERROR_INVALID;
cryptlib_initialized = false;
cryptEnd();
if (asprintf(&cryptfail, "Incorrect cryptlib version %d (expected %d)", tmp, CRYPTLIB_VERSION) == -1)
cryptfail = NULL;
......@@ -349,12 +344,12 @@ static void internal_do_cryptInit(void)
ret = cryptGetAttributeString(CRYPT_UNUSED, CRYPT_OPTION_INFO_PATCHES, patches, &stp);
if (cryptStatusError(ret) || stp != 32 || memcmp(patches, CRYPTLIB_PATCHES, 32) != 0) {
cryptInit_error = ret;
cryptlib_initialized = false;
cryptEnd();
if (asprintf(&cryptfail, "Incorrect cryptlib patch set %.32s (expected %s)", patches, CRYPTLIB_PATCHES) == -1)
cryptfail = NULL;
return;
}
cryptlib_initialized = true;
return;
}
......@@ -409,7 +404,7 @@ bool ssl_sync(scfg_t *scfg, int (*lprintf)(int level, const char* fmt, ...))
// Paranoia... keep zero as initial value only.
if (cert_epoch == 0)
cert_epoch = 1;
pthread_mutex_lock(&ssl_cert_list_mutex);
assert_pthread_mutex_lock(&ssl_cert_list_mutex);
while (cert_list) {
struct cert_list *old;
old = cert_list;
......@@ -417,7 +412,7 @@ bool ssl_sync(scfg_t *scfg, int (*lprintf)(int level, const char* fmt, ...))
cryptDestroyContext(old->cert);
free(old);
}
pthread_mutex_unlock(&ssl_cert_list_mutex);
assert_pthread_mutex_unlock(&ssl_cert_list_mutex);
if (!rwlock_unlock(&cert_epoch_lock)) {
lprintf(LOG_ERR, "Unable to unlock cert_epoch_lock for write at %d", __LINE__);
}
......@@ -471,11 +466,11 @@ static struct cert_list * get_ssl_cert(scfg_t *cfg, int (*lprintf)(int level, co
}
cert_entry->next = NULL;
pthread_mutex_lock(&get_ssl_cert_mutex);
assert_pthread_mutex_lock(&get_ssl_cert_mutex);
/* Get the certificate... first try loading it from a file... */
if (cryptStatusOK(cryptKeysetOpen(&ssl_keyset, CRYPT_UNUSED, CRYPT_KEYSET_FILE, cert_path, CRYPT_KEYOPT_READONLY))) {
if (!DO("getting private key", ssl_keyset, cryptGetPrivateKey(ssl_keyset, &cert_entry->cert, CRYPT_KEYID_NAME, "ssl_cert", cfg->sys_pass))) {
pthread_mutex_unlock(&get_ssl_cert_mutex);
assert_pthread_mutex_unlock(&get_ssl_cert_mutex);
free(cert_entry);
return NULL;
}
......@@ -483,7 +478,7 @@ static struct cert_list * get_ssl_cert(scfg_t *cfg, int (*lprintf)(int level, co
else {
/* Couldn't do that... create a new context and use the cert from there... */
if (!DO("creating TLS context", CRYPT_UNUSED, cryptCreateContext(&cert_entry->cert, CRYPT_UNUSED, CRYPT_ALGO_RSA))) {
pthread_mutex_unlock(&get_ssl_cert_mutex);
assert_pthread_mutex_unlock(&get_ssl_cert_mutex);
free(cert_entry);
return NULL;
}
......@@ -541,7 +536,7 @@ static struct cert_list * get_ssl_cert(scfg_t *cfg, int (*lprintf)(int level, co
}
cryptKeysetClose(ssl_keyset);
pthread_mutex_unlock(&get_ssl_cert_mutex);
assert_pthread_mutex_unlock(&get_ssl_cert_mutex);
if (cert_entry->cert == -1) {
free(cert_entry);
......@@ -559,7 +554,7 @@ failure_return_2:
cryptKeysetClose(ssl_keyset);
failure_return_1:
cryptDestroyContext(cert_entry->cert);
pthread_mutex_unlock(&get_ssl_cert_mutex);
assert_pthread_mutex_unlock(&get_ssl_cert_mutex);
cert_path[0] = 0;
free(cert_entry);
return NULL;
......@@ -574,10 +569,10 @@ static struct cert_list *get_sess_list_entry(scfg_t *cfg, int (*lprintf)(int lev
lprintf(LOG_ERR, "Failed to lock cert_epoch_lock for read at %d", __LINE__);
return NULL;
}
pthread_mutex_lock(&ssl_cert_list_mutex);
assert_pthread_mutex_lock(&ssl_cert_list_mutex);
while (1) {
if (cert_list == NULL) {
pthread_mutex_unlock(&ssl_cert_list_mutex);
assert_pthread_mutex_unlock(&ssl_cert_list_mutex);
if (!rwlock_rdlock(&cert_epoch_lock)) {
lprintf(LOG_ERR, "Failed to unlock cert_epoch_lock for read at %d", __LINE__);
}
......@@ -590,7 +585,7 @@ static struct cert_list *get_sess_list_entry(scfg_t *cfg, int (*lprintf)(int lev
cryptDestroyContext(ret->cert);
free(ret);
}
pthread_mutex_unlock(&ssl_cert_list_mutex);
assert_pthread_mutex_unlock(&ssl_cert_list_mutex);
if (!rwlock_rdlock(&cert_epoch_lock)) {
lprintf(LOG_ERR, "Failed to unlock cert_epoch_lock for read at %d", __LINE__);
}
......@@ -608,17 +603,17 @@ int add_private_key(scfg_t *cfg, int (*lprintf)(int level, const char* fmt, ...)
}
ret = cryptSetAttribute(csess, CRYPT_SESSINFO_PRIVATEKEY, sess->cert);
if (cryptStatusOK(ret)) {
pthread_mutex_lock(&ssl_sess_list_mutex);
assert_pthread_mutex_lock(&ssl_sess_list_mutex);
sess->next = sess_list;
sess_list = sess;
pthread_mutex_unlock(&ssl_sess_list_mutex);
assert_pthread_mutex_unlock(&ssl_sess_list_mutex);
sess->sess = csess;
}
else {
pthread_mutex_lock(&ssl_cert_list_mutex);
assert_pthread_mutex_lock(&ssl_cert_list_mutex);
sess->next = cert_list;
cert_list = sess;
pthread_mutex_unlock(&ssl_cert_list_mutex);
assert_pthread_mutex_unlock(&ssl_cert_list_mutex);
}
return ret;
}
......@@ -629,7 +624,7 @@ int destroy_session(int (*lprintf)(int level, const char* fmt, ...), CRYPT_SESSI
struct cert_list *psess = NULL;
int ret = CRYPT_ERROR_NOTFOUND;
pthread_mutex_lock(&ssl_sess_list_mutex);
assert_pthread_mutex_lock(&ssl_sess_list_mutex);
sess = sess_list;
while (sess != NULL) {
if (sess->sess == csess) {
......@@ -644,7 +639,7 @@ int destroy_session(int (*lprintf)(int level, const char* fmt, ...), CRYPT_SESSI
psess = sess;
sess = sess->next;
}
pthread_mutex_unlock(&ssl_sess_list_mutex);
assert_pthread_mutex_unlock(&ssl_sess_list_mutex);
if (sess != NULL) {
if (!rwlock_rdlock(&cert_epoch_lock)) {
lprintf(LOG_ERR, "Unable to unlock cert_epoch_lock for write at %d", __LINE__);
......@@ -656,10 +651,10 @@ int destroy_session(int (*lprintf)(int level, const char* fmt, ...), CRYPT_SESSI
return CRYPT_ERROR_INTERNAL;
}
sess->sess = -1;
pthread_mutex_lock(&ssl_cert_list_mutex);
assert_pthread_mutex_lock(&ssl_cert_list_mutex);
sess->next = cert_list;
cert_list = sess;
pthread_mutex_unlock(&ssl_cert_list_mutex);
assert_pthread_mutex_unlock(&ssl_cert_list_mutex);
ret = cryptDestroySession(csess);
}
else {
......
......@@ -5,6 +5,8 @@ Fix blast-through in Mode 7 high ASCII mosaics
Update Prestel/Mode 7 keybindings
Don't disable status line for Atari ST modes
Fix broken vertical (U+00A6) vs. vertical line (U+007C)
Add custom palette support to list file
Pass control key combinations in BBC Micro mode
Version 1.6
------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment