print error messages to stderr; change all in-string quoting to use "
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14021 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -177,7 +177,7 @@ add_one_principal (const char *name,
|
||||
char *princ_name;
|
||||
|
||||
krb5_unparse_name(context, princ_ent, &princ_name);
|
||||
printf ("added %s with password `%s'\n", princ_name, password);
|
||||
printf ("added %s with password \"%s\"\n", princ_name, password);
|
||||
free (princ_name);
|
||||
}
|
||||
out:
|
||||
@@ -212,7 +212,7 @@ add_new_key(struct add_options *opt, int argc, char **argv)
|
||||
krb5_key_data *kdp = NULL;
|
||||
|
||||
if(argc == 0) {
|
||||
printf("usage: add principal\n");
|
||||
fprintf(stderr, "usage: add principal...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ add_new_key(struct add_options *opt, int argc, char **argv)
|
||||
++num;
|
||||
|
||||
if (num > 1) {
|
||||
printf ("give only one of "
|
||||
fprintf (stderr, "give only one of "
|
||||
"--random-key, --random-password, --password, --key\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -236,7 +236,8 @@ add_new_key(struct add_options *opt, int argc, char **argv)
|
||||
const char *error;
|
||||
|
||||
if (parse_des_key (opt->key_string, key_data, &error)) {
|
||||
printf ("failed parsing key `%s': %s\n", opt->key_string, error);
|
||||
fprintf (stderr, "failed parsing key \"%s\": %s\n",
|
||||
opt->key_string, error);
|
||||
return 0;
|
||||
}
|
||||
kdp = key_data;
|
||||
|
@@ -73,7 +73,7 @@ set_random_password (krb5_principal principal)
|
||||
|
||||
krb5_unparse_name(context, principal, &princ_name);
|
||||
|
||||
printf ("%s's password set to `%s'\n", princ_name, pw);
|
||||
printf ("%s's password set to \"%s\"\n", princ_name, pw);
|
||||
free (princ_name);
|
||||
}
|
||||
memset (pw, 0, sizeof(pw));
|
||||
@@ -156,7 +156,7 @@ cpw_entry(struct passwd_options *opt, int argc, char **argv)
|
||||
++num;
|
||||
|
||||
if (num > 1) {
|
||||
printf ("give only one of "
|
||||
fprintf (stderr, "give only one of "
|
||||
"--random-key, --random-password, --password, --key\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -165,7 +165,8 @@ cpw_entry(struct passwd_options *opt, int argc, char **argv)
|
||||
const char *error;
|
||||
|
||||
if (parse_des_key (opt->key_string, key_data, &error)) {
|
||||
printf ("failed parsing key `%s': %s\n", opt->key_string, error);
|
||||
fprintf (stderr, "failed parsing key \"%s\": %s\n",
|
||||
opt->key_string, error);
|
||||
return 0;
|
||||
}
|
||||
data.key_data = key_data;
|
||||
|
@@ -49,7 +49,7 @@ del_entry(void *opt, int argc, char **argv)
|
||||
krb5_error_code ret;
|
||||
|
||||
if(argc == 0) {
|
||||
printf("usage: delete principal ...\n");
|
||||
fprintf(stderr, "usage: delete principal ...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -53,7 +53,7 @@ del_enctype(void *opt, int argc, char **argv)
|
||||
krb5_enctype *etypes;
|
||||
|
||||
if(argc < 2) {
|
||||
printf("usage: del_enctype principal enctypes...\n");
|
||||
fprintf(stderr, "usage: del_enctype principal enctypes...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ del_enctype(void *opt, int argc, char **argv)
|
||||
for (i = 0; i < n_etypes; ++i) {
|
||||
ret = krb5_string_to_enctype (context, argv[i], &etypes[i]);
|
||||
if (ret) {
|
||||
krb5_warnx (context, "bad enctype `%s'", argv[i]);
|
||||
krb5_warnx (context, "bad enctype \"%s\"", argv[i]);
|
||||
goto out2;
|
||||
}
|
||||
}
|
||||
|
@@ -340,7 +340,7 @@ getit(struct get_options *opt, const char *name, int argc, char **argv)
|
||||
struct get_entry_data data;
|
||||
|
||||
if(argc == 0) {
|
||||
printf("usage: %s principal...\n", name);
|
||||
fprintf(stderr, "usage: %s principal...\n", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -123,19 +123,19 @@ init(struct init_options *opt, int argc, char **argv)
|
||||
}
|
||||
|
||||
if(argc == 0) {
|
||||
printf("must have atleast one realm\n");
|
||||
fprintf(stderr, "usage: init realm...\n");
|
||||
return 0;
|
||||
}
|
||||
if (opt->realm_max_ticket_life_string) {
|
||||
if (str2deltat (opt->realm_max_ticket_life_string, &max_life) != 0) {
|
||||
krb5_warnx (context, "unable to parse `%s'",
|
||||
krb5_warnx (context, "unable to parse \"%s\"",
|
||||
opt->realm_max_ticket_life_string);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (opt->realm_max_renewable_life_string) {
|
||||
if (str2deltat (opt->realm_max_renewable_life_string, &max_rlife) != 0) {
|
||||
krb5_warnx (context, "unable to parse `%s'",
|
||||
krb5_warnx (context, "unable to parse \"%s\"",
|
||||
opt->realm_max_renewable_life_string);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -94,9 +94,9 @@ help(void *opt, int argc, char **argv)
|
||||
} else {
|
||||
SL_cmd *c = sl_match (commands, argv[0], 0);
|
||||
if(c == NULL) {
|
||||
printf ("No such command: %s. "
|
||||
"Try \"help\" for a list of commands\n",
|
||||
argv[0]);
|
||||
fprintf (stderr, "No such command: %s. "
|
||||
"Try \"help\" for a list of commands\n",
|
||||
argv[0]);
|
||||
} else {
|
||||
if(c->func) {
|
||||
char *fake[] = { argv[0], "--help", NULL };
|
||||
|
@@ -495,7 +495,7 @@ loadit(int merge, const char *name, int argc, char **argv)
|
||||
}
|
||||
|
||||
if(argc != 1) {
|
||||
printf("%s file", name);
|
||||
fprintf(stderr, "usage: %s file", name);
|
||||
return 0;
|
||||
}
|
||||
doit(argv[0], merge);
|
||||
|
@@ -88,7 +88,7 @@ mod_entry(struct modify_options *opt, int argc, char **argv)
|
||||
int i;
|
||||
|
||||
if (argc < 1) {
|
||||
printf ("Usage: mod [options] principal\n");
|
||||
fprintf (stderr, "usage: mod [options] principal\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@ password_quality(void *opt, int argc, char **argv)
|
||||
const char *s;
|
||||
|
||||
if(argc != 2) {
|
||||
printf ("Usage: password-quality principal password\n");
|
||||
fprintf (stderr, "usage: password-quality principal password\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ rename_entry(void *opt, int argc, char **argv)
|
||||
krb5_principal princ1, princ2;
|
||||
|
||||
if(argc != 2) {
|
||||
printf("rename [options] from to\n");
|
||||
fprintf(stderr, "usage: rename [options] from to\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -111,7 +111,7 @@ stash(struct stash_options *opt, int argc, char **argv)
|
||||
ret = errno;
|
||||
goto out;
|
||||
}
|
||||
krb5_warnx(context, "writing key to `%s'", opt->key_file_string);
|
||||
krb5_warnx(context, "writing key to \"%s\"", opt->key_file_string);
|
||||
ret = hdb_write_master_key(context, new, mkey);
|
||||
if(ret)
|
||||
unlink(new);
|
||||
|
@@ -114,7 +114,7 @@ parse_attributes (const char *resp, krb5_flags *attr, int *mask, int bit)
|
||||
} else if(*resp == '?') {
|
||||
print_flags_table (kdb_attrs, stderr);
|
||||
} else {
|
||||
fprintf (stderr, "Unable to parse '%s'\n", resp);
|
||||
fprintf (stderr, "Unable to parse \"%s\"\n", resp);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -226,11 +226,10 @@ parse_timet (const char *resp, krb5_timestamp *value, int *mask, int bit)
|
||||
if(mask)
|
||||
*mask |= bit;
|
||||
return 0;
|
||||
} else if(*resp == '?') {
|
||||
printf ("Print date on format YYYY-mm-dd [hh:mm:ss]\n");
|
||||
} else {
|
||||
fprintf (stderr, "Unable to parse time '%s'\n", resp);
|
||||
}
|
||||
}
|
||||
if(*resp != '?')
|
||||
fprintf (stderr, "Unable to parse time \"%s\"\n", resp);
|
||||
fprintf (stderr, "Print date on format YYYY-mm-dd [hh:mm:ss]\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -316,7 +315,7 @@ parse_deltat (const char *resp, krb5_deltat *value, int *mask, int bit)
|
||||
} else if(*resp == '?') {
|
||||
print_time_table (stderr);
|
||||
} else {
|
||||
fprintf (stderr, "Unable to parse time '%s'\n", resp);
|
||||
fprintf (stderr, "Unable to parse time \"%s\"\n", resp);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -559,11 +558,11 @@ get_response(const char *prompt, const char *def, char *buf, size_t len)
|
||||
osig = signal(SIGINT, interrupt);
|
||||
if(setjmp(jmpbuf)) {
|
||||
signal(SIGINT, osig);
|
||||
printf("\n");
|
||||
fprintf(stderr, "\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s [%s]:", prompt, def);
|
||||
fprintf(stderr, "%s [%s]:", prompt, def);
|
||||
if(fgets(buf, len, stdin) == NULL) {
|
||||
int save_errno = errno;
|
||||
if(ferror(stdin))
|
||||
|
Reference in New Issue
Block a user