[1426] in Moira
register_user client patch
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Sun Mar 12 18:33:02 2000
Message-Id: <200003122332.SAA08239@mary-kay-commandos.mit.edu>
To: moiradev@MIT.EDU
Date: Sun, 12 Mar 2000 18:32:59 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>
This is sort of vaguely the companion patch to the moirad patch
I submitted earlier. Rather than asking people questions "is this a
student filesystem?", etc. and then throwing away the result except to
compare it to the string "IMAP", let's ask what kind of PO box we want
for the user, since the third argument to register_user is potype.
Setting an IMAP pobox this way will still fail right now because
the logic for assigning space to imap po servers in moirad assumes that
the partitions will never be overallocated, which turns out not to be
the case.
Garry
Index: user.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository//moira/clients/moira/user.c,v
retrieving revision 1.56
diff -c -r1.56 user.c
*** user.c 2000/03/09 19:59:54 1.56
--- user.c 2000/03/09 22:46:43
***************
*** 556,562 ****
int RegisterUser(int argc, char **argv)
{
char *args[MAX_ARGS_SIZE];
! char *login, *fstype = NULL;
char temp_buf[BUFSIZ];
int status;
--- 556,562 ----
int RegisterUser(int argc, char **argv)
{
char *args[MAX_ARGS_SIZE];
! char *login, *potype = NULL;
char temp_buf[BUFSIZ];
int status;
***************
*** 579,586 ****
sprintf(temp_buf, "u%s", args[0]);
login = strdup(temp_buf);
! if ((GetValueFromUser("Login name for this user? ", &login) == SUB_ERROR) ||
! (GetFSTypes(&fstype, FALSE) == SUB_ERROR))
{
args[1] = login;
FreeInfo(args); /* This work because the NULL temination is ok. */
--- 579,585 ----
sprintf(temp_buf, "u%s", args[0]);
login = strdup(temp_buf);
! if (GetValueFromUser("Login name for this user? ", &login) == SUB_ERROR)
{
args[1] = login;
FreeInfo(args); /* This work because the NULL temination is ok. */
***************
*** 588,594 ****
}
Put_message("KERBEROS code not added, did not reserve name with kerberos.");
args[1] = login;
! args[2] = fstype;
args[3] = NULL;
switch ((status = do_mr_query("register_user", CountArgs(args),
--- 587,602 ----
}
Put_message("KERBEROS code not added, did not reserve name with kerberos.");
args[1] = login;
!
! Prompt_input("What type of P.O. Box for this user? ", temp_buf, BUFSIZ);
! potype = strdup(temp_buf);
! if (strcmp(potype, "POP") && strcmp(potype, "IMAP"))
! {
! sprintf(temp_buf, "Unknown P.O. type. Assuming POP.");
! Put_message(temp_buf);
! potype = strdup("POP");
! }
! args[2] = potype;
args[3] = NULL;
switch ((status = do_mr_query("register_user", CountArgs(args),