aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2022-06-21 17:58:57 -0700
committerBart Schaefer <schaefer@zsh.org>2022-06-21 17:58:57 -0700
commitf7441b46456c3acee4a2bd500b8f6409c70f33a8 (patch)
treed2f517643aafeb32e775df079c9cc5dd3a447365
parent123497b78e850b845d2054303612c25bccb887e3 (diff)
downloadzsh-f7441b46456c3acee4a2bd500b8f6409c70f33a8.tar.gz
zsh-f7441b46456c3acee4a2bd500b8f6409c70f33a8.tar.xz
zsh-f7441b46456c3acee4a2bd500b8f6409c70f33a8.zip
50368: adjust ztie'd bitflags so local variables cannot mess with database
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/db_gdbm.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d8a057fcd..0cdd632f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-06-21 Bart Schaefer <schaefer@zsh.org>
+
+ * 50368: Src/Modules/db_gdbm.c: adjust bitflags so local copies of
+ variables cannot mess with database file contents
+
2022-06-16 Peter Stephenson <p.stephenson@samsung.com>
* 50372: Etc/FAQ.yo: remove redundant references from days of
diff --git a/Src/Modules/db_gdbm.c b/Src/Modules/db_gdbm.c
index 7e11ec939..3fefd412b 100644
--- a/Src/Modules/db_gdbm.c
+++ b/Src/Modules/db_gdbm.c
@@ -34,8 +34,8 @@
#include "db_gdbm.mdh"
#include "db_gdbm.pro"
-#ifndef PM_UPTODATE
-#define PM_UPTODATE (1<<19) /* Parameter has up-to-date data (e.g. loaded from DB) */
+#ifndef PM_UPTODATE /* Parameter has up-to-date data (e.g. loaded from DB) */
+#define PM_UPTODATE PM_DONTIMPORT_SUID /* Safe PM_ bit to re-use */
#endif
static Param createhash( char *name, int flags );
@@ -111,7 +111,7 @@ bin_ztie(char *nam, char **args, Options ops, UNUSED(int func))
struct gsu_scalar_ext *dbf_carrier;
char *resource_name, *pmname;
GDBM_FILE dbf = NULL;
- int read_write = GDBM_SYNC, pmflags = PM_REMOVABLE;
+ int read_write = GDBM_SYNC, pmflags = PM_REMOVABLE|PM_SINGLE;
Param tied_param;
if(!OPT_ISSET(ops,'d')) {