data
package-version.txt
core.*
+utils/ctdl3264_structs.h
# config.mk is generated by ./configure
include config.mk
-all := citserver setup ctdlmigrate sendcommand citmail chkpw chkpwd
+all := citserver setup ctdlmigrate sendcommand citmail chkpw chkpwd ctdl3264
all: $(all)
citserver: server/*.c server/modules/*/*.c config.mk server/*.h
chkpwd: utils/chkpwd.c utils/auth.c utils/*.h server/*.h
cc ${CFLAGS} ${LDFLAGS} utils/chkpwd.c utils/auth.c -lcrypt -o chkpwd
+ctdl3264: utils/ctdl3264.c utils/*.h server/*.h utils/ctdl3264_structs.h
+ cc ${CFLAGS} ${LDFLAGS} utils/ctdl3264.c -ldb -o ctdl3264
+
+utils/ctdl3264_structs.h: server/server.h utils/ctdl3264_prep.sh
+ utils/ctdl3264_prep.sh
+
config.mk: configure
./configure
--- /dev/null
+// Attempt to convert your database from 32-bit to 64-bit.
+// Don't run this. It doesn't work and if you try to run it you will immediately die.
+//
+// Copyright (c) 1987-2022 by the citadel.org team
+//
+// This program is open source software. Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <netdb.h>
+#include <string.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <libcitadel.h>
+#include "../server/sysdep.h"
+#include "../server/citadel_defs.h"
+#include "../server/server.h"
+#include "../server/citadel_dirs.h"
+#include "ctdl3264_structs.h"
+
+
+int main(int argc, char **argv) {
+
+ if (sizeof(void *) != 8) {
+ fprintf(stderr, "%s: this is a %ld-bit system.\n", argv[0], sizeof(void *)*8);
+ fprintf(stderr, "%s: you must run this on a 64-bit system, onto which a 32-bit database has been copied.\n", argv[0]);
+ exit(1);
+ }
+
+
+ exit(0);
+}
--- /dev/null
+#!/bin/bash
+
+SERVER_H=server/server.h
+
+convert_struct() {
+ start_line=$(cat ${SERVER_H} | egrep -n "^struct $1 {" | cut -d: -f1)
+ tail +${start_line} ${SERVER_H} | sed '/};/q' \
+ | sed s/"^struct $1 {"/"struct ${1}_32 {"/g \
+ | sed s/"int "/"int32_t "/g \
+ | sed s/"long "/"int32_t "/g \
+ | sed s/"time_t "/"int32_t "/g
+
+}
+
+(
+ convert_struct "ctdluser"
+ convert_struct "ctdlroom"
+ convert_struct "ExpirePolicy"
+ convert_struct "floor"
+
+) >utils/ctdl3264_structs.h