and it requires special handling.
A few sanity fixes to queries2.c
if (!strcmp(argv[1], "POP")) {
status = name_to_id(box, MACHINE_TABLE, &id);
if (!strcmp(argv[1], "POP")) {
status = name_to_id(box, MACHINE_TABLE, &id);
- if (status == MR_NO_MATCH)
- return(MR_MACHINE);
- else if (status)
return(status);
EXEC SQL UPDATE users SET potype = 'POP', pop_id = :id
WHERE users_id = :user;
return(status);
EXEC SQL UPDATE users SET potype = 'POP', pop_id = :id
WHERE users_id = :user;
};
static struct valobj VOsnet0[] = {
};
static struct valobj VOsnet0[] = {
- {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_CLUSTER},
+ {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
};
static struct valobj VOlist0[] = {
};
static struct valobj VOlist0[] = {
{V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
};
{V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
};
-static struct valobj VOchar0[] = {
- {V_CHAR, 0},
-};
-
/* Validations
* Commonly used validation records defined here so that they may
/* Validations
* Commonly used validation records defined here so that they may
static struct valobj rusr_valobj[] = {
{V_NUM, 0},
static struct valobj rusr_valobj[] = {
{V_NUM, 0},
+ {V_CHAR, 1, USERS_TABLE, "login"},
-static char *dubu_fields[] = {
- "uid",
-};
-
-static struct valobj dubu_valobj[] = {
- {V_ID, 0, USERS_TABLE, "uid", "users_id", MR_USER}
-};
-
-static struct validate dubu_validate = {
- dubu_valobj,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- setup_dusr,
- 0,
-};
-
static char *gkum_fields[] = { "login", "kerberos",
"login", "kerberos" };
static char *gkum_fields[] = { "login", "kerberos",
"login", "kerberos" };
- {
- /* Q_DUBU - DELETE_USER_BY_UID */
- "delete_user_by_uid",
- "dubu",
- DELETE,
- "u",
- USERS_TABLE,
- (char *)0,
- dubu_fields,
- 0,
- "users_id = %d",
- 1,
- 0,
- &dubu_validate,
- },
-
{
/* Q_GKUM - GET_KERBEROS_USER_MAP */
"get_kerberos_user_map",
{
/* Q_GKUM - GET_KERBEROS_USER_MAP */
"get_kerberos_user_map",
register struct valobj *vo;
{
EXEC SQL BEGIN DECLARE SECTION;
register struct valobj *vo;
{
EXEC SQL BEGIN DECLARE SECTION;
- char *name, *namefield, *idfield;
int id, rowcount, tbl;
EXEC SQL END DECLARE SECTION;
int status;
int id, rowcount, tbl;
EXEC SQL END DECLARE SECTION;
int status;
name = argv[vo->index];
tbl = vo->table;
name = argv[vo->index];
tbl = vo->table;
- namefield = vo->namefield;
- idfield = vo->idfield;
- if ((tbl==USERS_TABLE && !strcmp(namefield, "login")) ||
- tbl==MACHINE_TABLE || tbl==SUBNET_TABLE || tbl==FILESYS_TABLE ||
- tbl==LIST_TABLE || tbl==CLUSTER_TABLE || tbl==STRINGS_TABLE) {
- if (tbl==MACHINE_TABLE || tbl==SUBNET_TABLE)
+ if (tbl==MACHINE_TABLE || tbl==SUBNET_TABLE)
for (c = name; *c; c++) if (islower(*c)) *c = toupper(*c);
for (c = name; *c; c++) if (islower(*c)) *c = toupper(*c);
- status = name_to_id(name, tbl, &id);
- if (status == 0) {
+ status = name_to_id(name, tbl, &id);
+ if (status == 0) {
*(int *)argv[vo->index] = id;
return(MR_EXISTS);
*(int *)argv[vo->index] = id;
return(MR_EXISTS);
- } else if (status == MR_NO_MATCH && tbl==STRINGS_TABLE &&
- (q->type == APPEND || q->type == UPDATE)) {
+ } else if (status == MR_NO_MATCH && tbl==STRINGS_TABLE &&
+ (q->type == APPEND || q->type == UPDATE)) {
id=add_string(name);
cache_entry(name, STRINGS_TABLE, id);
*(int *)argv[vo->index] = id;
return(MR_EXISTS);
id=add_string(name);
cache_entry(name, STRINGS_TABLE, id);
*(int *)argv[vo->index] = id;
return(MR_EXISTS);
- } else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)
+ } else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)
- } else {
- /* else, it's `dubu', which uses unix_uid from users */
- EXEC SQL SELECT COUNT(*) INTO :rowcount FROM users
- WHERE unix_uid = :name;
- if (dbms_errno) return(mr_errcode);
- if (rowcount != 1) return(vo->error);
- EXEC SQL SELECT users_id INTO :id FROM users
- WHERE unix_uid = :name;
- *(int *)argv[vo->index] = id;
- return(MR_EXISTS);
- }
}
int validate_name(argv, vo)
}
int validate_name(argv, vo)