summaryrefslogtreecommitdiff
path: root/usr/src/lib/krb5/ss
diff options
context:
space:
mode:
authormp153739 <none@none>2006-10-07 13:37:05 -0700
committermp153739 <none@none>2006-10-07 13:37:05 -0700
commit56a424cca6b3f91f31bdab72a4626c48c779fe8b (patch)
tree9a50fae6e9e88996cc646a6b9a53425b2b8539d7 /usr/src/lib/krb5/ss
parent124771bb5f403108fb9ed84bf6083c8d427d55ff (diff)
downloadillumos-joyent-56a424cca6b3f91f31bdab72a4626c48c779fe8b.tar.gz
PSARC 2006/424 Kerberos 1.4 KDC Resync
6406993 kdc and client resync with MIT 1.4
Diffstat (limited to 'usr/src/lib/krb5/ss')
-rw-r--r--usr/src/lib/krb5/ss/copyright.h3
-rw-r--r--usr/src/lib/krb5/ss/error.c34
-rw-r--r--usr/src/lib/krb5/ss/execute_cmd.c9
-rw-r--r--usr/src/lib/krb5/ss/help.c18
-rw-r--r--usr/src/lib/krb5/ss/invocation.c2
-rw-r--r--usr/src/lib/krb5/ss/list_rqs.c25
-rw-r--r--usr/src/lib/krb5/ss/listen.c26
-rw-r--r--usr/src/lib/krb5/ss/mapfile-vers1
-rw-r--r--usr/src/lib/krb5/ss/mit-sipb-copyright.h3
-rw-r--r--usr/src/lib/krb5/ss/mk_cmds.c7
-rw-r--r--usr/src/lib/krb5/ss/pager.c8
-rw-r--r--usr/src/lib/krb5/ss/parse.c25
-rw-r--r--usr/src/lib/krb5/ss/request_tbl.c8
-rw-r--r--usr/src/lib/krb5/ss/requests.c17
-rw-r--r--usr/src/lib/krb5/ss/ss.h27
-rw-r--r--usr/src/lib/krb5/ss/ss_internal.h39
-rw-r--r--usr/src/lib/krb5/ss/utils.c13
17 files changed, 112 insertions, 153 deletions
diff --git a/usr/src/lib/krb5/ss/copyright.h b/usr/src/lib/krb5/ss/copyright.h
index 3a8663ae42..d67bba3992 100644
--- a/usr/src/lib/krb5/ss/copyright.h
+++ b/usr/src/lib/krb5/ss/copyright.h
@@ -13,6 +13,9 @@ this permission notice appear in supporting documentation,
and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
+Furthermore if you modify this software you must label
+your software as modified software and not distribute it in such a
+fashion that it might be confused with the original M.I.T. software.
M.I.T. and the M.I.T. S.I.P.B. make no representations about
the suitability of this software for any purpose. It is
provided "as is" without express or implied warranty.
diff --git a/usr/src/lib/krb5/ss/error.c b/usr/src/lib/krb5/ss/error.c
index a15a04378e..31c62ffa00 100644
--- a/usr/src/lib/krb5/ss/error.c
+++ b/usr/src/lib/krb5/ss/error.c
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -14,25 +14,10 @@
#include <stdio.h>
-/*
- * I'm assuming that com_err.h includes varargs.h, which it does
- * (right now). There really ought to be a way for me to include the
- * file without worrying about whether com_err.h includes it or not,
- * but varargs.h doesn't define anything that I can use as a flag, and
- * gcc will lose if I try to include it twice and redefine stuff.
- */
-#if !defined(__STDC__) || !defined(ibm032) || !defined(NeXT)
-#define ss_error ss_error_external
-#endif
-
#include "copyright.h"
#include "com_err.h"
#include "ss_internal.h"
-extern void com_err_va ();
-
-#undef ss_error
-
char * ss_name(sci_idx)
int sci_idx;
{
@@ -71,26 +56,11 @@ char * ss_name(sci_idx)
}
}
-#ifdef HAVE_STDARG_H
void ss_error (int sci_idx, long code, const char * fmt, ...)
-#else
-void ss_error (va_alist)
- va_dcl
-#endif
{
register char *whoami;
va_list pvar;
-#ifndef HAVE_STDARG_H
- int sci_idx;
- long code;
- char * fmt;
- va_start (pvar);
- sci_idx = va_arg (pvar, int);
- code = va_arg (pvar, long);
- fmt = va_arg (pvar, char *);
-#else
va_start (pvar, fmt);
-#endif
whoami = ss_name (sci_idx);
com_err_va (whoami, code, fmt, pvar);
free (whoami);
diff --git a/usr/src/lib/krb5/ss/execute_cmd.c b/usr/src/lib/krb5/ss/execute_cmd.c
index ca6108cb49..6a0030cdaf 100644
--- a/usr/src/lib/krb5/ss/execute_cmd.c
+++ b/usr/src/lib/krb5/ss/execute_cmd.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -196,8 +196,7 @@ int ss_execute_line (sci_idx, line_ptr)
char *line_ptr;
{
char **argv;
- int argc;
- int rc;
+ int argc, ret;
/* flush leading whitespace */
while (line_ptr[0] == ' ' || line_ptr[0] == '\t')
@@ -220,9 +219,9 @@ int ss_execute_line (sci_idx, line_ptr)
return 0;
/* look it up in the request tables, execute if found */
- rc = really_execute_command (sci_idx, argc, &argv);
+ ret = really_execute_command (sci_idx, argc, &argv);
free(argv);
- return (rc);
+ return(ret);
}
diff --git a/usr/src/lib/krb5/ss/help.c b/usr/src/lib/krb5/ss/help.c
index 5979e45463..b5e4ef15f5 100644
--- a/usr/src/lib/krb5/ss/help.c
+++ b/usr/src/lib/krb5/ss/help.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -13,13 +13,13 @@
#include <sys/param.h>
#include <sys/types.h>
+#include <errno.h>
#include <sys/file.h>
#include <fcntl.h> /* just for O_* */
#include <sys/wait.h>
#include "ss_internal.h"
#include "copyright.h"
#include <libintl.h>
-#include <errno.h>
extern void ss_list_requests();
@@ -63,16 +63,18 @@ void ss_help (argc, argv, sci_idx, info_ptr)
return;
}
for (idx = 0; info->info_dirs[idx] != (char *)NULL; idx++) {
- (void) strcpy(buffer, info->info_dirs[idx]);
- (void) strcat(buffer, "/");
- (void) strcat(buffer, argv[1]);
- (void) strcat(buffer, ".info");
+ (void) strncpy(buffer, info->info_dirs[idx], sizeof(buffer) - 1);
+ buffer[sizeof(buffer) - 1] = '\0';
+ (void) strncat(buffer, "/", sizeof(buffer) - 1 - strlen(buffer));
+ (void) strncat(buffer, argv[1], sizeof(buffer) - 1 - strlen(buffer));
+ (void) strncat(buffer, ".info", sizeof(buffer) - 1 - strlen(buffer));
if ((fd = open(&buffer[0], O_RDONLY)) >= 0) goto got_it;
}
if ((fd = open(&buffer[0], O_RDONLY)) < 0) {
char buf[MAXPATHLEN];
- strcpy(buf, "No info found for ");
- strcat(buf, argv[1]);
+ strncpy(buf, "No info found for ", sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
+ strncat(buf, argv[1], sizeof(buf) - 1 - strlen(buf));
ss_perror(sci_idx, 0, buf);
return;
}
diff --git a/usr/src/lib/krb5/ss/invocation.c b/usr/src/lib/krb5/ss/invocation.c
index 94b3de637f..87e6bb9fae 100644
--- a/usr/src/lib/krb5/ss/invocation.c
+++ b/usr/src/lib/krb5/ss/invocation.c
@@ -71,7 +71,7 @@ ss_delete_invocation(sci_idx)
t = ss_info(sci_idx);
free(t->prompt);
- free((char *)t->rqt_tables);
+ free(t->rqt_tables);
while(t->info_dirs[0] != (char *)NULL)
ss_delete_info_dir(sci_idx, t->info_dirs[0], &ignored_code);
free((char *)t->info_dirs);
diff --git a/usr/src/lib/krb5/ss/list_rqs.c b/usr/src/lib/krb5/ss/list_rqs.c
index 53dc909d13..4bb4e95499 100644
--- a/usr/src/lib/krb5/ss/list_rqs.c
+++ b/usr/src/lib/krb5/ss/list_rqs.c
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -32,9 +32,13 @@ static char const NL[2] = "\n";
void
ss_list_requests(argc, argv, sci_idx, info_ptr)
int argc;
- char **argv;
+ const char * const *argv;
int sci_idx;
- pointer info_ptr;
+#ifdef __STDC__
+ void *info_ptr;
+#else
+ char *info_ptr;
+#endif
{
register ss_request_entry *entry;
register char const * const *name;
@@ -93,21 +97,22 @@ ss_list_requests(argc, argv, sci_idx, info_ptr)
buffer[0] = '\0';
if (entry->flags & SS_OPT_DONT_LIST)
continue;
+ buffer[sizeof(buffer) - 1] = '\0';
for (name = entry->command_names; *name; name++) {
register int len = strlen(*name);
- strncat(buffer, *name, len);
+ strncat(buffer, *name, sizeof(buffer) - 1 - strlen(buffer));
spacing += len + 2;
if (name[1]) {
- strcat(buffer, ", ");
+ strncat(buffer, ", ", sizeof(buffer) - 1 - strlen(buffer));
}
}
if (spacing > 23) {
- strcat(buffer, NL);
+ strncat(buffer, NL, sizeof(buffer) - 1 - strlen(buffer));
fputs(buffer, output);
spacing = 0;
buffer[0] = '\0';
}
- strncat(buffer, twentyfive_spaces, 25-spacing);
+ strncat(buffer, twentyfive_spaces, strlen(twentyfive_spaces) - spacing);
/*
* Due to libss not knowing what TEXT_DOMAIN
@@ -115,8 +120,8 @@ ss_list_requests(argc, argv, sci_idx, info_ptr)
* messages, we know require the callers (ktutil,kadmin)
* to L10N the messages before calling libss.
*/
- strcat(buffer, entry->info_string);
- strcat(buffer, NL);
+ strncat(buffer, entry->info_string, sizeof(buffer) -1 - strlen(buffer));
+ strncat(buffer, NL, sizeof(buffer) - 1 - strlen(buffer));
fputs(buffer, output);
}
}
diff --git a/usr/src/lib/krb5/ss/listen.c b/usr/src/lib/krb5/ss/listen.c
index 5d4d88f2bd..a1035e9fde 100644
--- a/usr/src/lib/krb5/ss/listen.c
+++ b/usr/src/lib/krb5/ss/listen.c
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -20,27 +20,21 @@
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
+#include <termios.h>
#include <libintl.h>
#include <sys/param.h>
-#ifdef BSD
-#include <sgtty.h>
-#endif
static ss_data *current_info;
static jmp_buf listen_jmpb;
static RETSIGTYPE print_prompt()
{
-#ifdef BSD
- /* put input into a reasonable mode */
- struct sgttyb ttyb;
- if (ioctl(fileno(stdin), TIOCGETP, &ttyb) != -1) {
- if (ttyb.sg_flags & (CBREAK|RAW)) {
- ttyb.sg_flags &= ~(CBREAK|RAW);
- (void) ioctl(0, TIOCSETP, &ttyb);
- }
+ struct termios termbuf;
+
+ if (tcgetattr(STDIN_FILENO, &termbuf) == 0) {
+ termbuf.c_lflag |= ICANON|ISIG|ECHO;
+ tcsetattr(STDIN_FILENO, TCSANOW, &termbuf);
}
-#endif
(void) fputs(current_info->prompt, stdout);
(void) fflush(stdout);
}
@@ -59,7 +53,7 @@ int ss_listen (sci_idx)
register ss_data *info;
char input[BUFSIZ];
char buffer[BUFSIZ];
- char *end = buffer;
+ char *volatile end = buffer;
int code;
jmp_buf old_jmpb;
ss_data *old_info = current_info;
@@ -175,7 +169,7 @@ void ss_abort_subsystem(sci_idx, code)
void ss_quit(argc, argv, sci_idx, infop)
int argc;
- char **argv;
+ char const * const *argv;
int sci_idx;
pointer infop;
{
diff --git a/usr/src/lib/krb5/ss/mapfile-vers b/usr/src/lib/krb5/ss/mapfile-vers
index 932cc36186..ac2ff358a0 100644
--- a/usr/src/lib/krb5/ss/mapfile-vers
+++ b/usr/src/lib/krb5/ss/mapfile-vers
@@ -27,7 +27,6 @@
SUNWprivate_1.1 {
global:
- debugDisplaySS;
ss_abort_subsystem;
ss_add_info_dir;
ss_add_request_table;
diff --git a/usr/src/lib/krb5/ss/mit-sipb-copyright.h b/usr/src/lib/krb5/ss/mit-sipb-copyright.h
index d9444d9bd6..cdcbe576e6 100644
--- a/usr/src/lib/krb5/ss/mit-sipb-copyright.h
+++ b/usr/src/lib/krb5/ss/mit-sipb-copyright.h
@@ -12,6 +12,9 @@ this permission notice appear in supporting documentation,
and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
+Furthermore if you modify this software you must label
+your software as modified software and not distribute it in such a
+fashion that it might be confused with the original M.I.T. software.
M.I.T. and the M.I.T. S.I.P.B. make no representations about
the suitability of this software for any purpose. It is
provided "as is" without express or implied warranty.
diff --git a/usr/src/lib/krb5/ss/mk_cmds.c b/usr/src/lib/krb5/ss/mk_cmds.c
index 858ebc4e6c..b47e5c62db 100644
--- a/usr/src/lib/krb5/ss/mk_cmds.c
+++ b/usr/src/lib/krb5/ss/mk_cmds.c
@@ -25,7 +25,7 @@
static const char copyright[] =
"Copyright 1987 by MIT Student Information Processing Board";
-extern pointer malloc PROTOTYPE((unsigned));
+extern pointer malloc (unsigned);
extern char *last_token;
extern FILE *output_file;
@@ -68,8 +68,9 @@ int main(argc, argv)
p = strrchr(path, '.');
*p = '\0';
q = rindex(path, '/');
- strcpy(c_file, (q) ? q + 1 : path);
- strcat(c_file, ".c");
+ strncpy(c_file, (q) ? q + 1 : path, sizeof(c_file) - 1);
+ c_file[sizeof(c_file) - 1] = '\0';
+ strncat(c_file, ".c", sizeof(c_file) - 1 - strlen(c_file));
*p = '.';
output_file = fopen(c_file, "w+F");
diff --git a/usr/src/lib/krb5/ss/pager.c b/usr/src/lib/krb5/ss/pager.c
index 3972f2fd9f..24c8f7e819 100644
--- a/usr/src/lib/krb5/ss/pager.c
+++ b/usr/src/lib/krb5/ss/pager.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -16,11 +16,11 @@
#include "ss_internal.h"
#include "copyright.h"
+#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/file.h>
#include <signal.h>
-#include <errno.h>
static char MORE[] = "more";
extern char *_ss_pager_name;
@@ -43,7 +43,7 @@ int ss_pager_create()
if (pipe(filedes) != 0)
return(-1);
- switch(fork()) {
+ switch((int) fork()) {
case -1:
return(-1);
case 0:
@@ -112,7 +112,7 @@ void ss_page_stdin()
char buf[80];
register int n;
while ((n = read(0, buf, 80)) > 0)
- write(1, buf, n);
+ write(1, buf, (unsigned) n);
}
exit(errno);
}
diff --git a/usr/src/lib/krb5/ss/parse.c b/usr/src/lib/krb5/ss/parse.c
index 0bc97db28d..9edb3ffe37 100644
--- a/usr/src/lib/krb5/ss/parse.c
+++ b/usr/src/lib/krb5/ss/parse.c
@@ -8,10 +8,7 @@
#include "ss_internal.h"
#include "copyright.h"
-
-/* global indicating if we should be printing debug messages */
-extern int g_displayDebugSS;
-
+#include <errno.h>
enum parse_mode { WHITESPACE, TOKEN, QUOTED_STRING };
@@ -58,9 +55,7 @@ char **ss_parse (sci_idx, line_ptr, argc_ptr)
while (1) {
#ifdef DEBUG
{
- if (g_displayDebugSS)
- printf ("character `%c', mode %d\n",
- *line_ptr, parse_mode);
+ printf ("character `%c', mode %d\n", *line_ptr, parse_mode);
}
#endif
while (parse_mode == WHITESPACE) {
@@ -130,15 +125,13 @@ char **ss_parse (sci_idx, line_ptr, argc_ptr)
end_of_line:
*argc_ptr = argc;
#ifdef DEBUG
-
- if (g_displayDebugSS)
- {
- int i;
- printf ("argc = %d\n", argc);
- for (i = 0; i <= argc; i++)
- printf ("\targv[%2d] = `%s'\n", i,
- argv[i] ? argv[i] : "<NULL>");
- }
+ {
+ int i;
+ printf ("argc = %d\n", argc);
+ for (i = 0; i <= argc; i++)
+ printf ("\targv[%2d] = `%s'\n", i,
+ argv[i] ? argv[i] : "<NULL>");
+ }
#endif
return(argv);
}
diff --git a/usr/src/lib/krb5/ss/request_tbl.c b/usr/src/lib/krb5/ss/request_tbl.c
index 56df137f22..18004d2bd3 100644
--- a/usr/src/lib/krb5/ss/request_tbl.c
+++ b/usr/src/lib/krb5/ss/request_tbl.c
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -31,8 +31,8 @@ ss_add_request_table(sci_idx, rqtbl_ptr, position, code_ptr)
;
/* size == C subscript of NULL == #elements */
size += 2; /* new element, and NULL */
- info->rqt_tables = (ssrt **)realloc((char *)info->rqt_tables,
- (unsigned)size*sizeof(ssrt));
+ info->rqt_tables = (ssrt **)realloc(info->rqt_tables,
+ size*sizeof(ssrt));
if (info->rqt_tables == (ssrt **)NULL) {
*code_ptr = errno;
return;
diff --git a/usr/src/lib/krb5/ss/requests.c b/usr/src/lib/krb5/ss/requests.c
index 479a716b33..5c3a710d93 100644
--- a/usr/src/lib/krb5/ss/requests.c
+++ b/usr/src/lib/krb5/ss/requests.c
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -13,12 +13,11 @@
* For copyright information, see mit-sipb-copyright.h.
*/
-#include <ss/mit-sipb-copyright.h>
#include <stdio.h>
#include "ss_internal.h"
#include <libintl.h>
-#define DECLARE(name) void name(argc,argv,sci_idx)int argc,sci_idx;char **argv;
+#define DECLARE(name) void name(argc,argv,sci_idx,info_ptr)int argc,sci_idx;const char * const *argv; pointer info_ptr;
/*
* ss_self_identify -- assigned by default to the "." request
@@ -55,13 +54,3 @@ DECLARE(ss_unimplemented)
{
ss_perror(sci_idx, SS_ET_UNIMPLEMENTED, "");
}
-
-int g_displayDebugSS = 0;
-/*
- * debug message display toggle
- */
-void
-debugDisplaySS(int onOff) {
-
- g_displayDebugSS = onOff;
-}
diff --git a/usr/src/lib/krb5/ss/ss.h b/usr/src/lib/krb5/ss/ss.h
index 0fdad1d880..7ce5b6bb70 100644
--- a/usr/src/lib/krb5/ss/ss.h
+++ b/usr/src/lib/krb5/ss/ss.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -13,9 +13,8 @@
#ifndef _ss_h
#define _ss_h __FILE__
-#include <ss/mit-sipb-copyright.h>
-#include <ss/ss_err.h>
#include <errno.h>
+#include <ss/ss_err.h>
#ifdef __STDC__
#define __SS_CONST const
@@ -52,16 +51,24 @@ typedef struct _ss_rp_options { /* DEFAULT VALUES */
#define SS_OPT_DONT_SUMMARIZE 0x0002
void ss_help __SS_PROTO;
+void ss_list_requests __SS_PROTO;
+void ss_quit __SS_PROTO;
char *ss_current_request();
-char *ss_name();
-#ifdef __STDC__
+char *ss_name(int);
void ss_error (int, long, char const *, ...);
void ss_perror (int, long, char const *);
-#else
-void ss_error ();
-void ss_perror ();
-#endif
-void ss_abort_subsystem();
+int ss_listen (int);
+int ss_create_invocation(char *, char *, char *, ss_request_table *, int *);
+void ss_delete_invocation(int);
+void ss_add_info_dir(int , char *, int *);
+void ss_delete_info_dir(int , char *, int *);
+int ss_execute_command(int sci_idx, char **);
+void ss_abort_subsystem(int, int);
+void ss_set_prompt(int, char *);
+char *ss_get_prompt(int);
+void ss_add_request_table(int, ss_request_table *, int, int *);
+void ss_delete_request_table(int, ss_request_table *, int *);
+int ss_execute_line (int, char*);
extern ss_request_table ss_std_requests;
/* toggles the display of debugging messages */
diff --git a/usr/src/lib/krb5/ss/ss_internal.h b/usr/src/lib/krb5/ss/ss_internal.h
index d82f050b28..43431797a3 100644
--- a/usr/src/lib/krb5/ss/ss_internal.h
+++ b/usr/src/lib/krb5/ss/ss_internal.h
@@ -15,20 +15,8 @@
#include <stdlib.h>
#endif
-#ifdef __STDC__
-
-#define PROTOTYPE(p) p
typedef void * pointer;
-#else
-
-#define const
-#define volatile
-#define PROTOTYPE(p) ()
-typedef char * pointer;
-
-#endif /* not __STDC__ */
-
#include <ss/ss.h>
#if defined(__GNUC__)
@@ -38,13 +26,13 @@ typedef char * pointer;
#if defined(vax)
#define LOCAL_ALLOC(x) alloca(x)
#define LOCAL_FREE(x)
-extern pointer alloca PROTOTYPE((unsigned));
+extern pointer alloca (unsigned);
#else
#if defined(__HIGHC__) /* Barf! */
pragma on(alloca);
#define LOCAL_ALLOC(x) alloca(x)
#define LOCAL_FREE(x)
-extern pointer alloca PROTOTYPE((unsigned));
+extern pointer alloca (unsigned);
#else
/* no alloca? */
#define LOCAL_ALLOC(x) malloc(x)
@@ -103,23 +91,30 @@ typedef struct _ss_data { /* init values */
(*code_ptr=0,ss_info(sci_idx)->current_request)
void ss_unknown_function();
void ss_delete_info_dir();
-int ss_execute_line();
-char **ss_parse();
-ss_abbrev_info *ss_abbrev_initialize PROTOTYPE((char *, int *));
-void ss_page_stdin();
+char **ss_parse (int, char *, int *);
+ss_abbrev_info *ss_abbrev_initialize (char *, int *);
+void ss_page_stdin (void);
+int ss_pager_create (void);
+void ss_self_identify __SS_PROTO;
+void ss_subsystem_name __SS_PROTO;
+void ss_subsystem_version __SS_PROTO;
+void ss_unimplemented __SS_PROTO;
extern ss_data **_ss_table;
extern char *ss_et_msgs[];
#ifndef HAVE_STDLIB_H
-extern pointer malloc PROTOTYPE((unsigned));
-extern pointer realloc PROTOTYPE((pointer, unsigned));
-extern pointer calloc PROTOTYPE((unsigned, unsigned));
+extern pointer malloc (unsigned);
+extern pointer realloc (pointer, unsigned);
+extern pointer calloc (unsigned, unsigned);
#endif
-#ifdef USE_SIGPROCMASK
+#if defined(USE_SIGPROCMASK) && !defined(POSIX_SIGNALS)
/* fake sigmask, sigblock, sigsetmask */
#include <signal.h>
+#ifdef sigmask
+#undef sigmask
+#endif
#define sigmask(x) (1L<<(x)-1)
#define sigsetmask(x) sigprocmask(SIG_SETMASK,&x,NULL)
static int _fake_sigstore;
diff --git a/usr/src/lib/krb5/ss/utils.c b/usr/src/lib/krb5/ss/utils.c
index 0084cec202..64a35a0b39 100644
--- a/usr/src/lib/krb5/ss/utils.c
+++ b/usr/src/lib/krb5/ss/utils.c
@@ -63,13 +63,12 @@ char * generate_rqte(func_name, info_string, cmds, options)
var_name = generate_cmds_string(cmds);
generate_function_definition(func_name);
size = 6; /* " { " */
- size += strlen(var_name)+7; /* "quux, " */
- size += strlen(func_name)+7; /* "foo, " */
- size += strlen(info_string)+9; /* "\"Info!\", " */
+ size += strlen(var_name)+8; /* "quux, " */
+ size += strlen(func_name)+8; /* "foo, " */
+ size += strlen(info_string)+8; /* "\"Info!\", " */
sprintf(numbuf, "%d", options);
- size += strlen(numbuf);
- size += 4; /* " }," + NL */
- string = malloc(size * sizeof(char *));
+ size += strlen(numbuf)+5; /* " }," + NL + NUL */
+ string = malloc(size);
strcpy(string, " { ");
strcat(string, var_name);
strcat(string, ",\n ");
@@ -125,7 +124,7 @@ char *quote(string)
return(result);
}
-#ifndef HAS_STRDUP
+#ifndef HAVE_STRDUP
/* make duplicate of string and return pointer */
char *strdup(s)
register char *s;