projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b1c6514
)
Repurposed an old upgrade module for upcoming index pass for uids
author
Art Cancro
<ajc@citadel.org>
Mon, 30 Oct 2017 23:42:45 +0000
(19:42 -0400)
committer
Art Cancro
<ajc@citadel.org>
Mon, 30 Oct 2017 23:42:45 +0000
(19:42 -0400)
citadel/modules/upgrade/serv_upgrade.c
patch
|
blob
|
history
diff --git
a/citadel/modules/upgrade/serv_upgrade.c
b/citadel/modules/upgrade/serv_upgrade.c
index e07de5b9fb1a86a916e99ed451fa8b36f03781a0..9ab953a235c5e86c115afe361d0dd1b81535dffe 100644
(file)
--- a/
citadel/modules/upgrade/serv_upgrade.c
+++ b/
citadel/modules/upgrade/serv_upgrade.c
@@
-100,13
+100,13
@@
void fix_sys_user_name(void)
/*
/*
- * Back end processing function for
convert_ctdluid_to_minusone
()
+ * Back end processing function for
reindex_uids
()
* Call this function as a ForEachUser backend in order to queue up
* user names, or call it with a null user to make it do the processing.
* This allows us to maintain the list as a static instead of passing
* pointers around.
*/
* Call this function as a ForEachUser backend in order to queue up
* user names, or call it with a null user to make it do the processing.
* This allows us to maintain the list as a static instead of passing
* pointers around.
*/
-void
cbtm
_backend(struct ctdluser *usbuf, void *data) {
+void
reindex_uids
_backend(struct ctdluser *usbuf, void *data) {
static struct UserProcList *uplist = NULL;
struct UserProcList *ptr;
struct ctdluser us;
static struct UserProcList *uplist = NULL;
struct UserProcList *ptr;
struct ctdluser us;
@@
-114,9
+114,10
@@
void cbtm_backend(struct ctdluser *usbuf, void *data) {
/* this is the calling mode where we add a user */
if (usbuf != NULL) {
/* this is the calling mode where we add a user */
if (usbuf != NULL) {
- ptr = (struct UserProcList *)
- malloc(sizeof (struct UserProcList));
- if (ptr == NULL) return;
+ ptr = (struct UserProcList *) malloc(sizeof (struct UserProcList));
+ if (ptr == NULL) {
+ return;
+ }
safestrncpy(ptr->user, usbuf->fullname, sizeof ptr->user);
ptr->next = uplist;
safestrncpy(ptr->user, usbuf->fullname, sizeof ptr->user);
ptr->next = uplist;
@@
-129,9
+130,9
@@
void cbtm_backend(struct ctdluser *usbuf, void *data) {
while (uplist != NULL) {
if (CtdlGetUserLock(&us, uplist->user) == 0) {
while (uplist != NULL) {
if (CtdlGetUserLock(&us, uplist->user) == 0) {
- syslog(LOG_DEBUG, "Processing <%s>
...", uplist->user
);
+ syslog(LOG_DEBUG, "Processing <%s>
(%d)", uplist->user, us.uid
);
if (us.uid == CTDLUID) {
if (us.uid == CTDLUID) {
- us.uid =
(-1)
;
+ us.uid =
NATIVE_AUTH_UID
;
}
CtdlPutUserLock(&us);
}
}
CtdlPutUserLock(&us);
}
@@
-143,12
+144,13
@@
void cbtm_backend(struct ctdluser *usbuf, void *data) {
}
/*
}
/*
- * quick fix to change all CTDLUID users to (-1)
+ * Build extauth index of all users with uid-based join (system auth, LDAP auth)
+ * Also changes all users with a uid of CTDLUID to NATIVE_AUTH_UID (-1)
*/
*/
-void
convert_ctdluid_to_minusone
(void) {
- syslog(LOG_WARNING, "
A
pplying uid changes");
- ForEachUser(
cbtm
_backend, NULL);
-
cbtm
_backend(NULL, NULL);
+void
reindex_uids
(void) {
+ syslog(LOG_WARNING, "
upgrade: reindexing and a
pplying uid changes");
+ ForEachUser(
reindex_uids
_backend, NULL);
+
reindex_uids
_backend(NULL, NULL);
return;
}
return;
}
@@
-531,8
+533,8
@@
void check_server_upgrades(void) {
syslog(LOG_EMERG, "This database is too old to be upgraded. Citadel server will exit.");
exit(EXIT_FAILURE);
}
syslog(LOG_EMERG, "This database is too old to be upgraded. Citadel server will exit.");
exit(EXIT_FAILURE);
}
- if ((CtdlGetConfigInt("MM_hosted_upgrade_level") > 000) && (CtdlGetConfigInt("MM_hosted_upgrade_level") <
608
)) {
-
convert_ctdluid_to_minusone
();
+ if ((CtdlGetConfigInt("MM_hosted_upgrade_level") > 000) && (CtdlGetConfigInt("MM_hosted_upgrade_level") <
913
)) {
+
reindex_uids
();
}
if ((CtdlGetConfigInt("MM_hosted_upgrade_level") > 000) && (CtdlGetConfigInt("MM_hosted_upgrade_level") < 659)) {
rebuild_euid_index();
}
if ((CtdlGetConfigInt("MM_hosted_upgrade_level") > 000) && (CtdlGetConfigInt("MM_hosted_upgrade_level") < 659)) {
rebuild_euid_index();