Removed my tags buffer patch as it has been fixed upstream #f7d2b24d

This commit is contained in:
Deon George 2023-05-17 09:39:44 +10:00
parent 1f612dd027
commit f6f89f6086
2 changed files with 3 additions and 56 deletions

View File

@ -1,52 +0,0 @@
From 8687974a09430df54a9424775ddd131cc270794b Mon Sep 17 00:00:00 2001
From: Deon George <deon@leenooks.net>
Date: Sat, 28 May 2022 11:42:25 +1000
Subject: [PATCH] Feature main/sbbs#404 - Reserve space (up to tagsBuffer) so
that headers can be modified, and tags can be added up to tagsBuffer in size
---
src/smblib/smblib.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/smblib/smblib.c b/src/smblib/smblib.c
index 53b886392..29624a79a 100644
--- a/src/smblib/smblib.c
+++ b/src/smblib/smblib.c
@@ -1603,6 +1603,7 @@ int smb_addmsghdr(smb_t* smb, smbmsg_t* msg, int storage)
uint hdrlen;
off_t idxlen;
size_t idxreclen = smb_idxreclen(smb);
+ int tagsBuffer = 4; /* @todo this should be determined from a system configuration item */
if(smb->shd_fp==NULL) {
safe_snprintf(smb->last_error,sizeof(smb->last_error),"%s msgbase not open", __FUNCTION__);
@@ -1612,6 +1613,26 @@ int smb_addmsghdr(smb_t* smb, smbmsg_t* msg, int storage)
if(!smb->locked && smb_locksmbhdr(smb)!=SMB_SUCCESS)
return(SMB_ERR_LOCK);
+ /* Add a tags buffer if a tag doesnt exist. */
+ if (tagsBuffer) {
+ int hasTags = 0;
+
+ for(i=0;i<msg->total_hfields;i++) {
+ if (msg->hfield[i].type == SMB_TAGS) {
+ hasTags = 1;
+ break;
+ }
+ }
+ if (! hasTags) {
+ if (i=smb_hfield_add(msg,SMB_TAGS,tagsBuffer,"",TRUE) != SMB_SUCCESS) {
+ safe_snprintf(smb->last_error,sizeof(smb->last_error)
+ ,"%s error adding padding for TAG field", __FUNCTION__);
+ smb_unlocksmbhdr(smb);
+ return(i);
+ }
+ }
+ }
+
hdrlen=smb_getmsghdrlen(msg);
if(hdrlen>SMB_MAX_HDR_LEN) { /* headers are limited to 64k in size */
smb_unlocksmbhdr(smb);
--
2.31.1

View File

@ -46,13 +46,12 @@ RUN apt-get -o Acquire::ForceIPv4=true update \
# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Build SBBS
COPY 0001-Feature-main-sbbs-404-Reserve-space-up-to-tagsBuffer.patch /tmp/
RUN apt-get -o Acquire::ForceIPv4=true update \
&& apt-get install -yqq git build-essential autoconf2.13 libnspr4-dev libncurses5-dev libncursesw5-dev libarchive-dev wget python2.7 pkgconf libcap2-bin sudo libarchive13 libnspr4 \
&& apt-get -o Acquire::ForceIPv4=true install -yqq git build-essential autoconf2.13 libnspr4-dev libncurses5-dev libncursesw5-dev libarchive-dev wget python2.7 pkgconf libcap2-bin sudo libarchive13 libnspr4 \
&& mkdir /opt/sbbs && cd /tmp \
&& wget https://gitlab.synchro.net/sbbs/sbbs/-/raw/master/install/GNUmakefile \
&& git clone https://gitlab.com/SynchronetBBS/sbbs.git /opt/sbbs/repo \
&& cd /opt/sbbs/repo && git checkout -b custom && git apply /tmp/0001-Feature-main-sbbs-404-Reserve-space-up-to-tagsBuffer.patch && cd /tmp \
&& cd /tmp \
&& make RELEASE=1 NO_X=1 SBBSDIR=/opt/sbbs install \
&& rm -rf /opt/sbbs/3rdp /opt/sbbs/src \
&& mv /opt/sbbs/ctrl /opt/sbbs/ctrl.orig \
@ -68,7 +67,7 @@ RUN apt-get -o Acquire::ForceIPv4=true update \
# Add PHP
RUN apt-get -o Acquire::ForceIPv4=true update \
&& apt-get install -yqq composer php-cgi php-fpm php-gd php-sqlite3 php-xml \
&& apt-get -o Acquire::ForceIPv4=true install -yqq composer php-cgi php-fpm php-gd php-sqlite3 php-xml \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*