[1515] in Moira
"is an nfs group" implementation
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Mon Apr 10 15:17:30 2000
Message-Id: <200004101917.PAA05878@sweet-transvestite.mit.edu>
To: moiradev@MIT.EDU
Date: Mon, 10 Apr 2000 15:17:20 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
These changes add a new column to the list table, nfsgroup,
which is used to determine if a group should be output into a user's
hesiod grplist and into the credentials file used by the nfs dcm.
Present here are changes to blanche and moira, schema changes to create
the column and an index on it, and server side changes that implement
new versions of glin, alis, and ulis. Enjoy.
Garry
Index: clients/blanche/blanche.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/blanche/blanche.c,v
retrieving revision 1.45
diff -c -r1.45 blanche.c
*** blanche.c 2000/03/15 22:43:56 1.45
--- blanche.c 2000/04/10 18:54:19
***************
*** 41,46 ****
--- 41,47 ----
int infoflg, verbose, syncflg, memberflg, recursflg, noauth;
int showusers, showstrings, showkerberos, showlists, showtags;
int createflag, setinfo, active, public, hidden, maillist, grouplist;
+ int nfsgroup;
struct member *owner;
char *desc, *newname;
***************
*** 251,256 ****
--- 252,267 ----
setinfo++;
grouplist = 0;
}
+ else if (argis("N", "nfs"))
+ {
+ setinfo++;
+ nfsgroup = 1;
+ }
+ else if (argis("NN", "notnfs"))
+ {
+ setinfo++;
+ nfsgroup = 0;
+ }
else if (argis("D", "desc"))
{
if (arg - argv < argc - 1)
***************
*** 306,312 ****
showusers = showstrings = showlists = showkerberos = 1;
/* fire up Moira */
! status = mrcl_connect(server, "blanche", 2, !noauth);
if (status == MRCL_AUTH_ERROR)
{
com_err(whoami, 0, "Try the -noauth flag if you don't "
--- 317,323 ----
showusers = showstrings = showlists = showkerberos = 1;
/* fire up Moira */
! status = mrcl_connect(server, "blanche", 3, !noauth);
if (status == MRCL_AUTH_ERROR)
{
com_err(whoami, 0, "Try the -noauth flag if you don't "
***************
*** 328,373 ****
/* create if needed */
if (createflag)
{
! char *argv[10];
! argv[0] = listname;
! argv[1] = (active == 0) ? "0" : "1";
! argv[2] = (public == 1) ? "1" : "0";
! argv[3] = (hidden == 1) ? "1" : "0";
! argv[4] = (maillist == 0) ? "0" : "1";
! argv[5] = (grouplist == 1) ? "1" : "0";
! argv[6] = UNIQUE_GID;
! argv[9] = desc ? desc : "none";
if (owner)
{
! argv[8] = owner->name;
switch (owner->type)
{
case M_ANY:
case M_USER:
! argv[7] = "USER";
! status = mr_query("add_list", 10, argv, NULL, NULL);
if (owner->type != M_ANY || status != MR_USER)
break;
case M_LIST:
! argv[7] = "LIST";
! status = mr_query("add_list", 10, argv, NULL, NULL);
break;
case M_KERBEROS:
! argv[7] = "KERBEROS";
! status = mr_query("add_list", 10, argv, NULL, NULL);
break;
}
}
else
{
! argv[7] = "USER";
! argv[8] = getenv("USER");
! status = mr_query("add_list", 10, argv, NULL, NULL);
}
if (status)
--- 339,385 ----
/* create if needed */
if (createflag)
{
! char *argv[11];
! argv[L_NAME] = listname;
! argv[L_ACTIVE] = (active == 0) ? "0" : "1";
! argv[L_PUBLIC] = (public == 1) ? "1" : "0";
! argv[L_HIDDEN] = (hidden == 1) ? "1" : "0";
! argv[L_MAILLIST] = (maillist == 0) ? "0" : "1";
! argv[L_GROUP] = (grouplist == 1) ? "1" : "0";
! argv[L_GID] = UNIQUE_GID;
! argv[L_NFSGROUP] = (nfsgroup == 1) ? "1" : "0";
! argv[L_DESC] = desc ? desc : "none";
if (owner)
{
! argv[L_ACE_NAME] = owner->name;
switch (owner->type)
{
case M_ANY:
case M_USER:
! argv[L_ACE_TYPE] = "USER";
! status = mr_query("add_list", 11, argv, NULL, NULL);
if (owner->type != M_ANY || status != MR_USER)
break;
case M_LIST:
! argv[L_ACE_TYPE] = "LIST";
! status = mr_query("add_list", 11, argv, NULL, NULL);
break;
case M_KERBEROS:
! argv[L_ACE_TYPE] = "KERBEROS";
! status = mr_query("add_list", 11, argv, NULL, NULL);
break;
}
}
else
{
! argv[L_ACE_TYPE] = "USER";
! argv[L_ACE_NAME] = getenv("USER");
! status = mr_query("add_list", 11, argv, NULL, NULL);
}
if (status)
***************
*** 378,384 ****
}
else if (setinfo)
{
! char *argv[11];
status = mr_query("get_list_info", 1, &listname,
save_list_info, argv);
--- 390,396 ----
}
else if (setinfo)
{
! char *argv[12];
status = mr_query("get_list_info", 1, &listname,
save_list_info, argv);
***************
*** 390,434 ****
argv[0] = listname;
if (newname)
! argv[1] = newname;
if (active != -1)
! argv[2] = active ? "1" : "0";
if (public != -1)
! argv[3] = public ? "1" : "0";
if (hidden != -1)
! argv[4] = hidden ? "1" : "0";
if (maillist != -1)
! argv[5] = maillist ? "1" : "0";
if (grouplist != -1)
! argv[6] = grouplist ? "1" : "0";
if (desc)
! argv[10] = desc;
if (owner)
{
! argv[9] = owner->name;
switch (owner->type)
{
case M_ANY:
case M_USER:
! argv[8] = "USER";
! status = mr_query("update_list", 11, argv, NULL, NULL);
if (owner->type != M_ANY || status != MR_USER)
break;
case M_LIST:
! argv[8] = "LIST";
! status = mr_query("update_list", 11, argv, NULL, NULL);
break;
case M_KERBEROS:
! argv[8] = "KERBEROS";
! status = mr_query("update_list", 11, argv, NULL, NULL);
break;
}
}
else
! status = mr_query("update_list", 11, argv, NULL, NULL);
if (status)
{
--- 402,448 ----
argv[0] = listname;
if (newname)
! argv[L_NAME + 1] = newname;
if (active != -1)
! argv[L_ACTIVE + 1] = active ? "1" : "0";
if (public != -1)
! argv[L_PUBLIC + 1] = public ? "1" : "0";
if (hidden != -1)
! argv[L_HIDDEN + 1] = hidden ? "1" : "0";
if (maillist != -1)
! argv[L_MAILLIST + 1] = maillist ? "1" : "0";
if (grouplist != -1)
! argv[L_GROUP + 1] = grouplist ? "1" : "0";
! if (nfsgroup != -1)
! argv[L_NFSGROUP + 1] = nfsgroup ? "1" : "0";
if (desc)
! argv[L_DESC + 1] = desc;
if (owner)
{
! argv[L_ACE_NAME + 1] = owner->name;
switch (owner->type)
{
case M_ANY:
case M_USER:
! argv[L_ACE_TYPE + 1] = "USER";
! status = mr_query("update_list", 12, argv, NULL, NULL);
if (owner->type != M_ANY || status != MR_USER)
break;
case M_LIST:
! argv[L_ACE_TYPE + 1] = "LIST";
! status = mr_query("update_list", 12, argv, NULL, NULL);
break;
case M_KERBEROS:
! argv[L_ACE_TYPE + 1] = "KERBEROS";
! status = mr_query("update_list", 12, argv, NULL, NULL);
break;
}
}
else
! status = mr_query("update_list", 12, argv, NULL, NULL);
if (status)
{
***************
*** 854,864 ****
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-dl | -deletelist filename",
"-NG | -notgroup");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-f | -file filename",
! "-D | -desc description");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-at | -addtagged member tag",
! "-O | -owner owner");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-ct | -changetag member tag",
! "-t | -tags");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-n | -noauth",
"-db | -database host[:port]");
exit(1);
--- 868,880 ----
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-dl | -deletelist filename",
"-NG | -notgroup");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-f | -file filename",
! "-N | -nfs");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-at | -addtagged member tag",
! "-NN | -notnfs");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-ct | -changetag member tag",
! "-D | -desc description");
! fprintf(stderr, USAGE_OPTIONS_FORMAT, "-t | -tags",
! "-O | -owner owner");
fprintf(stderr, USAGE_OPTIONS_FORMAT, "-n | -noauth",
"-db | -database host[:port]");
exit(1);
***************
*** 923,943 ****
int show_list_info(int argc, char **argv, void *hint)
{
! printf("List: %s\n", argv[0]);
! printf("Description: %s\n", argv[9]);
printf("Flags: %s, %s, and %s\n",
! atoi(argv[1]) ? "active" : "inactive",
! atoi(argv[2]) ? "public" : "private",
! atoi(argv[3]) ? "hidden" : "visible");
! printf("%s is %sa maillist and is %sa group", argv[0],
! atoi(argv[4]) ? "" : "not ",
! atoi(argv[5]) ? "" : "not ");
! if (atoi(argv[5]))
! printf(" with GID %d\n", atoi(argv[6]));
else
printf("\n");
! printf("Owner: %s %s\n", argv[7], argv[8]);
! printf("Last modified by %s with %s on %s\n", argv[11], argv[12], argv[10]);
return MR_CONT;
}
--- 939,964 ----
int show_list_info(int argc, char **argv, void *hint)
{
! printf("List: %s\n", argv[L_NAME]);
! printf("Description: %s\n", argv[L_DESC]);
printf("Flags: %s, %s, and %s\n",
! atoi(argv[L_ACTIVE]) ? "active" : "inactive",
! atoi(argv[L_PUBLIC]) ? "public" : "private",
! atoi(argv[L_HIDDEN]) ? "hidden" : "visible");
! printf("%s is %sa maillist and is %sa group", argv[L_NAME],
! atoi(argv[L_MAILLIST]) ? "" : "not ",
! atoi(argv[L_GROUP]) ? "" : "not ");
! if (atoi(argv[L_GROUP]))
! {
! if (atoi(argv[L_NFSGROUP]))
! printf(" (and an NFS group)");
! printf(" with GID %d\n", atoi(argv[L_GID]));
! }
else
printf("\n");
! printf("Owner: %s %s\n", argv[L_ACE_TYPE], argv[L_ACE_NAME]);
! printf("Last modified by %s with %s on %s\n",
! argv[L_MODBY], argv[L_MODWITH], argv[L_MODTIME]);
return MR_CONT;
}
***************
*** 948,954 ****
{
char **nargv = hint;
! for (argc = 0; argc < 10; argc++)
nargv[argc + 1] = strdup(argv[argc]);
return MR_CONT;
}
--- 969,975 ----
{
char **nargv = hint;
! for (argc = 0; argc < 11; argc++)
nargv[argc + 1] = strdup(argv[argc]);
return MR_CONT;
}
Index: clients/moira/lists.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/lists.c,v
retrieving revision 1.39
diff -c -r1.39 lists.c
*** lists.c 2000/03/15 22:44:03 1.39
--- lists.c 2000/04/10 05:29:59
***************
*** 42,47 ****
--- 42,48 ----
#define DEFAULT_MAILLIST DEFAULT_YES
#define DEFAULT_GROUP DEFAULT_NO
#define DEFAULT_GID UNIQUE_GID
+ #define DEFAULT_NFSGROUP DEFAULT_NO
#define DEFAULT_ACE_TYPE "user"
#define DEFAULT_ACE_NAME (user)
#define DEFAULT_DESCRIPTION DEFAULT_COMMENT
***************
*** 86,92 ****
Put_message("This list is NOT a mailing list.");
if (atoi(info[L_GROUP]))
{
! sprintf(buf, "This list is a Group and its ID number is %s",
info[L_GID]);
Put_message(buf);
}
--- 87,94 ----
Put_message("This list is NOT a mailing list.");
if (atoi(info[L_GROUP]))
{
! sprintf(buf, "This list is a Group%s and its ID number is %s",
! atoi(info[L_NFSGROUP]) ? " and an NFS Group," : "",
info[L_GID]);
Put_message(buf);
}
***************
*** 212,217 ****
--- 214,222 ----
return NULL;
if (atoi(info[L_GROUP]))
{
+ if (GetYesNoValueFromUser("Is this an NFS group", &info[L_NFSGROUP]) ==
+ SUB_ERROR)
+ return NULL;
if (GetValueFromUser("What is the GID for this group.", &info[L_GID]) ==
SUB_ERROR)
return NULL;
***************
*** 352,357 ****
--- 357,363 ----
info[L_MAILLIST] = strdup(DEFAULT_MAILLIST);
info[L_GROUP] = strdup(DEFAULT_GROUP);
info[L_GID] = strdup(DEFAULT_GID);
+ info[L_NFSGROUP] = strdup(DEFAULT_NFSGROUP);
info[L_ACE_TYPE] = strdup(DEFAULT_ACE_TYPE);
info[L_ACE_NAME] = strdup(DEFAULT_ACE_NAME);
info[L_DESC] = strdup(DEFAULT_DESCRIPTION);
Index: clients/moira/main.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/main.c,v
retrieving revision 1.38
diff -c -r1.38 main.c
*** main.c 2000/03/15 22:44:03 1.38
--- main.c 2000/04/10 05:28:39
***************
*** 106,112 ****
}
}
! if (mrcl_connect(moira_server, program_name, 2, 0) != MRCL_SUCCESS)
exit(1);
if ((status = mr_auth(program_name)))
--- 106,112 ----
}
}
! if (mrcl_connect(moira_server, program_name, 3, 0) != MRCL_SUCCESS)
exit(1);
if ((status = mr_auth(program_name)))
Index: db/dbopt.sql
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/db/dbopt.sql,v
retrieving revision 1.10
diff -c -r1.10 dbopt.sql
*** dbopt.sql 2000/03/30 22:00:42 1.10
--- dbopt.sql 2000/04/10 06:38:19
***************
*** 43,48 ****
--- 43,49 ----
create index i_lis_mail on list (maillist);
create index i_lis_group on list (grouplist);
create index i_lis_gid on list (gid);
+ create index i_lis_nfsgroup on list (nfsgroup);
create index i_lis_acl on list (acl_id);
create index i_imem_mid on imembers (member_id, member_type);
Index: db/schema.sql
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/db/schema.sql,v
retrieving revision 1.14
diff -c -r1.14 schema.sql
*** schema.sql 2000/02/05 00:43:37 1.14
--- schema.sql 2000/04/10 01:29:41
***************
*** 137,142 ****
--- 137,143 ----
maillist INTEGER DEFAULT 0 NOT NULL,
grouplist INTEGER DEFAULT 0 NOT NULL,
gid SMALLINT DEFAULT 0 NOT NULL,
+ nfsgroup INTEGER DEFAULT 0 NOT NULL,
description VARCHAR(255) DEFAULT CHR(0) NOT NULL,
acl_type VARCHAR(8) DEFAULT CHR(0) NOT NULL,
acl_id INTEGER DEFAULT 0 NOT NULL,
Index: gen/hesiod.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/hesiod.pc,v
retrieving revision 1.16
diff -c -r1.16 hesiod.pc
*** hesiod.pc 1999/11/16 04:47:29 1.16
--- hesiod.pc 2000/04/10 05:02:45
***************
*** 418,425 ****
EXEC SQL DECLARE u_cursor2 CURSOR FOR
SELECT users_id, login
FROM users
! WHERE status = 1 OR status = 2
! ORDER BY users_id;
EXEC SQL OPEN u_cursor2;
while (1)
{
--- 418,424 ----
EXEC SQL DECLARE u_cursor2 CURSOR FOR
SELECT users_id, login
FROM users
! WHERE status = 1 OR status = 2;
EXEC SQL OPEN u_cursor2;
while (1)
{
***************
*** 435,444 ****
}
EXEC SQL DECLARE i_cursor CURSOR FOR
! SELECT list_id, member_id
! FROM imembers
! WHERE member_type = 'USER'
! ORDER BY list_id;
EXEC SQL OPEN i_cursor;
while (1)
{
--- 434,443 ----
}
EXEC SQL DECLARE i_cursor CURSOR FOR
! SELECT m.list_id, m.member_id
! FROM imembers m, list l
! WHERE m.member_type = 'USER'
! AND m.list_id = l.list_id AND l.grouplist = 1 AND l.nfsgroup = 1;
EXEC SQL OPEN i_cursor;
while (1)
{
Index: gen/nfs.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/nfs.pc,v
retrieving revision 1.9
diff -c -r1.9 nfs.pc
*** nfs.pc 1999/09/01 16:47:55 1.9
--- nfs.pc 2000/04/10 05:02:06
***************
*** 245,251 ****
EXEC SQL DECLARE l_cursor CURSOR FOR
SELECT gid, list_id
FROM list
! WHERE grouplist != 0 AND active != 0
ORDER BY list_id;
EXEC SQL OPEN l_cursor;
while (1)
--- 245,251 ----
EXEC SQL DECLARE l_cursor CURSOR FOR
SELECT gid, list_id
FROM list
! WHERE nfsgroup != 0 AND grouplist != 0 AND active != 0
ORDER BY list_id;
EXEC SQL OPEN l_cursor;
while (1)
Index: include/moira_site.h
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/include/moira_site.h,v
retrieving revision 1.33
diff -c -r1.33 moira_site.h
*** moira_site.h 2000/01/06 21:09:37 1.33
--- moira_site.h 2000/04/10 05:20:44
***************
*** 125,131 ****
#define KMAP_PRINCIPAL 1
#define KMAP_END 2
! /* General List information Queries. */
#define L_NAME 0
#define L_ACTIVE 1
--- 125,131 ----
#define KMAP_PRINCIPAL 1
#define KMAP_END 2
! /* General List information Queries, v3. */
#define L_NAME 0
#define L_ACTIVE 1
***************
*** 134,146 ****
#define L_MAILLIST 4
#define L_GROUP 5
#define L_GID 6
! #define L_ACE_TYPE 7
! #define L_ACE_NAME 8
! #define L_DESC 9
! #define L_MODTIME 10
! #define L_MODBY 11
! #define L_MODWITH 12
! #define L_END 13
/* List Member information queries. */
--- 134,147 ----
#define L_MAILLIST 4
#define L_GROUP 5
#define L_GID 6
! #define L_NFSGROUP 7
! #define L_ACE_TYPE 8
! #define L_ACE_NAME 9
! #define L_DESC 10
! #define L_MODTIME 11
! #define L_MODBY 12
! #define L_MODWITH 13
! #define L_END 14
/* List Member information queries. */
Index: server/qfollow.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qfollow.pc,v
retrieving revision 2.14
diff -c -r2.14 qfollow.pc
*** qfollow.pc 2000/01/28 00:31:57 2.14
--- qfollow.pc 2000/04/10 18:50:55
***************
*** 566,571 ****
--- 566,573 ----
int id, i, idx, status;
idx = 7;
+ if (!strcmp(q->shortname, "glin") && q->version > 2)
+ idx = 8;
if (!strcmp(q->shortname, "gsin"))
idx = 11;
Index: server/queries2.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/queries2.c,v
retrieving revision 2.69
diff -c -r2.69 queries2.c
*** queries2.c 2000/03/30 22:01:56 2.69
--- queries2.c 2000/04/10 01:27:43
***************
*** 1000,1011 ****
set_cluster_modtime_by_id,
};
! static char *glin_fields[] = {
"name",
"name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
"ace_type", "ace_name", "description", "modtime", "modby", "modwith",
};
static struct validate glin_validate = {
0,
0,
--- 1000,1018 ----
set_cluster_modtime_by_id,
};
! static char *glin2_fields[] = {
"name",
"name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
"ace_type", "ace_name", "description", "modtime", "modby", "modwith",
};
+ static char *glin_fields[] = {
+ "name",
+ "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+ "nfsgroup", "ace_type", "ace_name", "description", "modtime", "modby",
+ "modwith",
+ };
+
static struct validate glin_validate = {
0,
0,
***************
*** 1018,1029 ****
followup_glin,
};
! static char *alis_fields[] = {
"name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
"ace_type", "ace_name", "description",
};
! static struct valobj alis_valobj[] = {
{V_CHAR, 0, LIST_TABLE, "name"},
{V_NUM, 1},
{V_NUM, 2},
--- 1025,1036 ----
followup_glin,
};
! static char *alis2_fields[] = {
"name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
"ace_type", "ace_name", "description",
};
! static struct valobj alis2_valobj[] = {
{V_CHAR, 0, LIST_TABLE, "name"},
{V_NUM, 1},
{V_NUM, 2},
***************
*** 1036,1044 ****
{V_LEN, 9, LIST_TABLE, "description"},
};
static struct validate alis_validate = {
alis_valobj,
! 10,
"name",
"name = '%s'",
1,
--- 1043,1082 ----
{V_LEN, 9, LIST_TABLE, "description"},
};
+ static struct validate alis2_validate = {
+ alis2_valobj,
+ 10,
+ "name",
+ "name = '%s'",
+ 1,
+ "list_id",
+ 0,
+ setup_alis,
+ set_modtime,
+ };
+
+ static char *alis_fields[] = {
+ "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+ "nfsgroup", "ace_type", "ace_name", "description",
+ };
+
+ static struct valobj alis_valobj[] = {
+ {V_CHAR, 0, LIST_TABLE, "name"},
+ {V_NUM, 1},
+ {V_NUM, 2},
+ {V_NUM, 3},
+ {V_NUM, 4},
+ {V_NUM, 5},
+ {V_NUM, 6},
+ {V_NUM, 7},
+ {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
+ {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
+ {V_LEN, 10, LIST_TABLE, "description"},
+ };
+
static struct validate alis_validate = {
alis_valobj,
! 11,
"name",
"name = '%s'",
1,
***************
*** 1048,1060 ****
set_modtime,
};
! static char *ulis_fields[] = {
"name",
"newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
"ace_type", "ace_name", "description",
};
! static struct valobj ulis_valobj[] = {
{V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
{V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
{V_NUM, 2},
--- 1086,1098 ----
set_modtime,
};
! static char *ulis2_fields[] = {
"name",
"newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
"ace_type", "ace_name", "description",
};
! static struct valobj ulis2_valobj[] = {
{V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
{V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
{V_NUM, 2},
***************
*** 1068,1075 ****
{V_LEN, 10, LIST_TABLE, "description"},
};
! static struct validate ulis_validate = {
! ulis_valobj,
11,
"name",
"list_id = %d",
--- 1106,1113 ----
{V_LEN, 10, LIST_TABLE, "description"},
};
! static struct validate ulis2_validate = {
! ulis2_valobj,
11,
"name",
"list_id = %d",
***************
*** 1080,1085 ****
--- 1118,1156 ----
set_modtime_by_id,
};
+ static char *ulis_fields[] = {
+ "name",
+ "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+ "nfsgroup", "ace_type", "ace_name", "description",
+ };
+
+ static struct valobj ulis_valobj[] = {
+ {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
+ {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
+ {V_NUM, 2},
+ {V_NUM, 3},
+ {V_NUM, 4},
+ {V_NUM, 5},
+ {V_NUM, 6},
+ {V_NUM, 7},
+ {V_NUM, 8},
+ {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
+ {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
+ {V_LEN, 11, LIST_TABLE, "description"},
+ };
+
+ static struct validate ulis_validate = {
+ ulis_valobj,
+ 12,
+ "name",
+ "list_id = %d",
+ 1,
+ "list_id",
+ access_list,
+ setup_alis,
+ set_modtime_by_id,
+ };
+
static char *dlis_fields[] = {
"name",
};
***************
*** 3593,3599 ****
},
{
! /* Q_GLIN - GET_LIST_INFO */
"get_list_info",
"glin",
2,
--- 3664,3670 ----
},
{
! /* Q_GLIN - GET_LIST_INFO, v2 */
"get_list_info",
"glin",
2,
***************
*** 3601,3607 ****
"l",
LIST_TABLE,
"name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
! glin_fields,
13,
"name LIKE '%s'",
1,
--- 3672,3678 ----
"l",
LIST_TABLE,
"name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
! glin2_fields,
13,
"name LIKE '%s'",
1,
***************
*** 3610,3615 ****
--- 3681,3703 ----
},
{
+ /* Q_GLIN - GET_LIST_INFO, v3 */
+ "get_list_info",
+ "glin",
+ 3,
+ RETRIEVE,
+ "l",
+ LIST_TABLE,
+ "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
+ glin_fields,
+ 14,
+ "name LIKE '%s'",
+ 1,
+ "name",
+ &glin_validate,
+ },
+
+ {
/* Q_EXLN - EXPAND_LIST_NAMES */
"expand_list_names",
"exln",
***************
*** 3627,3633 ****
},
{
! /* Q_ALIS - ADD_LIST */ /* uses prefetch_value() for list_id */
"add_list",
"alis",
2,
--- 3715,3721 ----
},
{
! /* Q_ALIS - ADD_LIST, v2 */ /* uses prefetch_value() for list_id */
"add_list",
"alis",
2,
***************
*** 3635,3650 ****
"l",
LIST_TABLE,
"INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
! alis_fields,
10,
0,
0,
NULL,
&alis_validate,
},
{
! /* Q_ULIS - UPDATE_LIST */
"update_list",
"ulis",
2,
--- 3723,3755 ----
"l",
LIST_TABLE,
"INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
! alis2_fields,
10,
0,
0,
NULL,
+ &alis2_validate,
+ },
+
+ {
+ /* Q_ALIS - ADD_LIST, v3 */ /* uses prefetch_value() for list_id */
+ "add_list",
+ "alis",
+ 3,
+ APPEND,
+ "l",
+ LIST_TABLE,
+ "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
+ alis_fields,
+ 11,
+ 0,
+ 0,
+ NULL,
&alis_validate,
},
{
! /* Q_ULIS - UPDATE_LIST, v2 */
"update_list",
"ulis",
2,
***************
*** 3652,3659 ****
"l",
LIST_TABLE,
"list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
! ulis_fields,
10,
"list_id = %d",
1,
NULL,
--- 3757,3781 ----
"l",
LIST_TABLE,
"list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
! ulis2_fields,
10,
+ "list_id = %d",
+ 1,
+ NULL,
+ &ulis2_validate,
+ },
+
+ {
+ /* Q_ULIS - UPDATE_LIST, v3 */
+ "update_list",
+ "ulis",
+ 3,
+ UPDATE,
+ "l",
+ LIST_TABLE,
+ "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
+ ulis_fields,
+ 11,
"list_id = %d",
1,
NULL,