RCSID("$Header$");
void usage(void);
-int chsh(char *uname);
-int get_shell(int argc, char **argv, void *uname);
-int get_winshell(int argc, char **argv, void *uname);
-int get_fmodtime(int argc, char **argv, void *uname);
+int get_shell(int argc, char **argv, void *username);
+int get_winshell(int argc, char **argv, void *username);
+int get_fmodtime(int argc, char **argv, void *username);
void check_shell(char *shell);
#ifndef HAVE_GETUSERSHELL
char *getusershell(void);
#endif
char *whoami;
-char *uname;
+char *username;
int main(int argc, char *argv[])
{
usage();
}
}
- else if (uname == NULL)
- uname = *arg;
+ else if (username == NULL)
+ username = *arg;
else
usage();
}
- if (!uname)
+ if (!username)
{
- uname = mrcl_krb_user();
- if (!uname)
+ username = mrcl_krb_user();
+ if (!username)
exit(1);
}
/* First, do an access check */
- q_argv[USH_NAME] = uname;
+ q_argv[USH_NAME] = username;
q_argv[USH_SHELL] = "junk";
q_argc = USH_END;
exit(2);
}
- printf("Changing login shell for %s.\n", uname);
+ printf("Changing login shell for %s.\n", username);
/* Display current information */
- q_argv[NAME] = uname;
+ q_argv[NAME] = username;
q_argc = NAME + 1;
if ((status = mr_query("get_finger_by_login", q_argc, q_argv,
- get_fmodtime, uname)))
+ get_fmodtime, username)))
{
com_err(whoami, status, "while getting user information.");
exit(2);
if (unixflg)
{
if ((status = mr_query("get_user_account_by_login", q_argc, q_argv,
- get_shell, uname)))
+ get_shell, username)))
{
com_err(whoami, status, "while getting user information.");
exit(2);
printf("Changing shell to %s...\n", shell);
- q_argv[USH_NAME] = uname;
+ q_argv[USH_NAME] = username;
q_argv[USH_SHELL] = shell;
q_argc = USH_END;
if ((status = mr_query("update_user_shell", q_argc, q_argv, NULL, NULL)))
else if (windowsflg)
{
if ((status = mr_query("get_user_account_by_login", q_argc, q_argv,
- get_winshell, uname)))
+ get_winshell, username)))
{
com_err(whoami, status, "while getting user information.");
exit(2);
printf("Changing Windows shell to %s...\n", shell);
- q_argv[USH_NAME] = uname;
+ q_argv[USH_NAME] = username;
q_argv[USH_SHELL] = shell;
q_argc = USH_END;
if ((status = mr_query("update_user_windows_shell", q_argc, q_argv,
return 0;
}
-int get_shell(int argc, char **argv, void *uname)
+int get_shell(int argc, char **argv, void *username)
{
/* We'll just take the first information we get since login names
cannot be duplicated in the database. */
- if (argc < U_END || strcmp(argv[U_NAME], uname))
+ if (argc < U_END || strcmp(argv[U_NAME], username))
{
fprintf(stderr, "Some internal error has occurred. Try again.\n");
exit(3);
}
- printf("Current shell for %s is %s.\n", (char *)uname, argv[U_SHELL]);
+ printf("Current shell for %s is %s.\n", (char *)username, argv[U_SHELL]);
return MR_ABORT; /* Don't pay attention to other matches. */
}
-int get_winshell(int argc, char **argv, void *uname)
+int get_winshell(int argc, char **argv, void *username)
{
/* We'll just take the first information we get since login names
cannot be duplicated in the database. */
- if (argc < U_END || strcmp(argv[U_NAME], uname))
+ if (argc < U_END || strcmp(argv[U_NAME], username))
{
fprintf(stderr, "Some internal error has occurred. Try again.\n");
exit(3);
}
- printf("Current Windows shell for %s is %s.\n", (char *)uname,
+ printf("Current Windows shell for %s is %s.\n", (char *)username,
argv[U_WINCONSOLESHELL]);
return MR_ABORT; /* Don't pay attention to other matches. */
}
-int get_fmodtime(int argc, char **argv, void *uname)
+int get_fmodtime(int argc, char **argv, void *username)
{
/* We'll just take the first information we get since login names
cannot be duplicated in the database. */
- if (argc < F_END || strcmp(argv[F_NAME], uname))
+ if (argc < F_END || strcmp(argv[F_NAME], username))
{
fprintf(stderr, "Some internal error has occurred. Try again.\n");
exit(3);