void (*old_hook)();
#endif
int use_menu = 1;
- char buf[BUFSIZ];
+ char buf[BUFSIZ], *motd;
if ((whoami = rindex(argv[0], '/')) == NULL)
whoami = argv[0];
goto punt;
}
+ status = sms_motd(&motd);
+ if (status) {
+ com_err(whoami, status, " unable to check server status");
+ sms_disconnect();
+ exit(2);
+ }
+ if (motd) {
+ fprintf(stderr, "The SMS server is currently unavailable:\n%s\n", motd);
+ sms_disconnect();
+ exit(2);
+ }
status = sms_auth("mailmaint");
if (status) {
(void) sprintf(buf, "\nAuthorization failed.\n");
{
int status;
Menu *menu;
+ char *motd;
if ((user = getlogin()) == NULL)
user = getpwuid((int) getuid())->pw_name;
if ( status = sms_connect(SMS_SERVER) )
ErrorExit("\nConnection to SMS server failed", status);
+ if ( status = sms_motd(&motd) )
+ ErrorExit("\nUnable to check server status", status);
+ if (motd) {
+ fprintf(stderr, "The SMS server is currently unavailable:\n%s\n", motd);
+ sms_disconnect();
+ exit(1);
+ }
+
if ( status = sms_auth(program_name) )
ErrorExit("\nAuthorization failed -- please run kinit", status);
char *argv[];
{
- char *args[6], buf[BUFSIZ], **service, **host;
+ char *args[6], buf[BUFSIZ], **service, **host, *motd;
struct save_queue *services, *hosts;
int count = 0, scream();
goto punt;
}
+ status = sms_motd(&motd);
+ if (status) {
+ com_err(whoami, status, " unable to check server status");
+ exit(2);
+ }
+ if (motd) {
+ fprintf(stderr, "The SMS server is currently unavailable:\n%s\n", motd);
+ sms_disconnect();
+ exit(2);
+ }
status = sms_auth("smscheck");
if (status) {
(void) sprintf(buf, "\nAuthorization failure -- run \"kinit\" \
int status; /* general purpose exit status */
int q_argc; /* argc for sms_query */
char *q_argv[F_END]; /* argv for sms_query */
+ char *motd; /* for SMS server status */
int i;
int get_user_info();
exit(1);
}
+ status = sms_motd(&motd);
+ if (status) {
+ com_err(whoami, status, " unable to check server status");
+ leave(1);
+ }
+ if (motd) {
+ fprintf(stderr, "The SMS server is currently unavailable:\n%s\n", motd);
+ leave(1);
+ }
+
status = sms_auth("chfn"); /* Don't use argv[0] - too easy to fake */
if (status) {
com_err(whoami, status,
struct passwd *pwd;
char *smsarg[3], buf[BUFSIZ];
char *potype(), *index();
- char *address, *uname, *machine;
+ char *address, *uname, *machine, *motd;
uid_t u;
char *canonicalize_hostname();
int get_pobox(), scream();
exit(1);
}
+ status = sms_motd(&motd);
+ if (status) {
+ sms_disconnect();
+ com_err(whoami, status, " unable to check server status");
+ exit(1);
+ }
+ if (motd) {
+ fprintf(stderr, "The SMS server is currently unavailable:\n%s\n", motd);
+ sms_disconnect();
+ exit(1);
+ }
+
status = sms_auth("chpobox");
if (status) {
com_err(whoami, status, " while authenticating -- run \"kinit\" and try again.");
int status; /* general purpose exit status */
int q_argc; /* argc for sms_query */
char *q_argv[U_END]; /* argv for sms_query */
+ char *motd; /* determine SMS server status */
int got_one = 0; /* have we got a new shell yet? */
char shell[BUFSIZ]; /* the new shell */
exit(1);
}
+ status = sms_motd(&motd);
+ if (status) {
+ com_err(whoami, status, " unable to check server status");
+ leave(1);
+ }
+ if (motd) {
+ fprintf(stderr, "The SMS server is currently unavailable:\n%s\n", motd);
+ leave(1);
+ }
+
status = sms_auth("chsh"); /* Don't use argv[0] - too easy to fake */
if (status) {
com_err(whoami, status,