[svn-upgrade] Integrating new upstream version, shadow (4.0.15)

This commit is contained in:
nekral-guest
2007-10-07 11:47:22 +00:00
parent 24178ad677
commit 591830e43b
236 changed files with 9504 additions and 3729 deletions

View File

@ -162,6 +162,8 @@ SHELL = @SHELL@
STRIP = @STRIP@
U = @U@
USE_NLS = @USE_NLS@
USE_NLS_FALSE = @USE_NLS_FALSE@
USE_NLS_TRUE = @USE_NLS_TRUE@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XMLCATALOG = @XMLCATALOG@

View File

@ -9,7 +9,7 @@
#include <grp.h>
#include <errno.h>
#ident "$Id: addgrps.c,v 1.8 2005/08/31 17:24:57 kloczek Exp $"
#ident "$Id: addgrps.c,v 1.9 2006/01/23 09:46:30 kloczek Exp $"
#define SEP ",:"
/*
@ -33,7 +33,7 @@ int add_groups (const char *list)
i = 16;
for (;;) {
grouplist = malloc (i * sizeof (GETGROUPS_T));
grouplist = (gid_t *) malloc (i * sizeof (GETGROUPS_T));
if (!grouplist)
return -1;
ngroups = getgroups (i, grouplist);
@ -67,7 +67,7 @@ int add_groups (const char *list)
fprintf (stderr, _("Warning: too many groups\n"));
break;
}
tmp = realloc (grouplist, (ngroups + 1) * sizeof (GETGROUPS_T));
tmp = (gid_t *) realloc (grouplist, (ngroups + 1) * sizeof (GETGROUPS_T));
if (!tmp) {
free (grouplist);
return -1;

View File

@ -35,10 +35,11 @@
#include <errno.h>
#include "prototypes.h"
#include "defines.h"
#include "exitcodes.h"
#include <pwd.h>
#include <grp.h>
#ident "$Id: age.c,v 1.12 2005/08/31 17:24:57 kloczek Exp $"
#ident "$Id: age.c,v 1.13 2006/01/18 19:38:27 kloczek Exp $"
#ifndef PASSWD_PROGRAM
#define PASSWD_PROGRAM "/bin/passwd"
@ -125,7 +126,7 @@ int expire (const struct passwd *pw, const struct spwd *sp)
execl (PASSWD_PROGRAM, PASSWD_PROGRAM, pw->pw_name, (char *) 0);
err = errno;
perror ("Can't execute " PASSWD_PROGRAM);
_exit ((err == ENOENT) ? 127 : 126);
_exit (err == ENOENT ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
} else if (pid == -1) {
perror ("fork");
exit (1);

View File

@ -1,7 +1,7 @@
/* A Bison parser, made by GNU Bison 2.0. */
/* A Bison parser, made by GNU Bison 2.1. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
@ -36,6 +36,9 @@
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@ -71,6 +74,7 @@
tZONE = 273
};
#endif
/* Tokens. */
#define tAGO 258
#define tDAY 259
#define tDAY_UNIT 260
@ -208,7 +212,7 @@
#define yycheck gd_yycheck
static int yylex ();
static int yyerror ();
static int yyerror (char *s);
#define EPOCH 1970
#define HOUR(x) ((x) * 60)
@ -277,14 +281,19 @@ static int yyRelYear;
# define YYERROR_VERBOSE 0
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 172 "getdate.y"
typedef union YYSTYPE {
int Number;
enum _MERIDIAN Meridian;
} YYSTYPE;
/* Line 190 of yacc.c. */
#line 288 "getdate.c"
/* Line 196 of yacc.c. */
#line 297 "getdate.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
@ -295,18 +304,37 @@ typedef union YYSTYPE {
/* Copy the second part of user declarations. */
/* Line 213 of yacc.c. */
#line 300 "getdate.c"
/* Line 219 of yacc.c. */
#line 309 "getdate.c"
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif
#ifndef YY_
# if YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# endif
#endif
#if ! defined (yyoverflow) || YYERROR_VERBOSE
# ifndef YYFREE
# define YYFREE free
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# endif
/* The parser invokes alloca or malloc; define the necessary symbols. */
# ifdef YYSTACK_USE_ALLOCA
@ -315,6 +343,10 @@ typedef union YYSTYPE {
# define YYSTACK_ALLOC __builtin_alloca
# else
# define YYSTACK_ALLOC alloca
# if defined (__STDC__) || defined (__cplusplus)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYINCLUDED_STDLIB_H
# endif
# endif
# endif
# endif
@ -322,13 +354,39 @@ typedef union YYSTYPE {
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
# if defined (__STDC__) || defined (__cplusplus)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
to allow for a few compiler-allocated temporary stack slots. */
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
# endif
# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
# endif
# ifdef __cplusplus
extern "C" {
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
&& (defined (__STDC__) || defined (__cplusplus)))
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
&& (defined (__STDC__) || defined (__cplusplus)))
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifdef __cplusplus
}
# endif
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
@ -363,7 +421,7 @@ union yyalloc
# define YYCOPY(To, From, Count) \
do \
{ \
register YYSIZE_T yyi; \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
@ -413,7 +471,7 @@ union yyalloc
#define YYUNDEFTOK 2
#define YYMAXUTOK 273
#define YYTRANSLATE(YYX) \
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
@ -495,8 +553,8 @@ static const unsigned short int yyrline[] =
};
#endif
#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
@ -621,22 +679,6 @@ static const unsigned char yystos[] =
32
};
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
@ -666,8 +708,8 @@ do \
goto yybackup; \
} \
else \
{ \
yyerror ("syntax error: cannot back up");\
{ \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (0)
@ -746,7 +788,7 @@ do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yysymprint (stderr, \
yysymprint (stderr, \
Type, Value); \
YYFPRINTF (stderr, "\n"); \
} \
@ -794,13 +836,13 @@ yy_reduce_print (yyrule)
#endif
{
int yyi;
unsigned int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
yyrule - 1, yylno);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
}
# define YY_REDUCE_PRINT(Rule) \
@ -829,7 +871,7 @@ int yydebug;
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
#ifndef YYMAXDEPTH
@ -853,7 +895,7 @@ yystrlen (yystr)
const char *yystr;
# endif
{
register const char *yys = yystr;
const char *yys = yystr;
while (*yys++ != '\0')
continue;
@ -878,8 +920,8 @@ yystpcpy (yydest, yysrc)
const char *yysrc;
# endif
{
register char *yyd = yydest;
register const char *yys = yysrc;
char *yyd = yydest;
const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
@ -889,7 +931,55 @@ yystpcpy (yydest, yysrc)
# endif
# endif
#endif /* !YYERROR_VERBOSE */
# ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
quotes and backslashes, so that it's suitable for yyerror. The
heuristic is that double-quoting is unnecessary unless the string
contains an apostrophe, a comma, or backslash (other than
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
size_t yyn = 0;
char const *yyp = yystr;
for (;;)
switch (*++yyp)
{
case '\'':
case ',':
goto do_not_strip_quotes;
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
/* Fall through. */
default:
if (yyres)
yyres[yyn] = *yyp;
yyn++;
break;
case '"':
if (yyres)
yyres[yyn] = '\0';
return yyn;
}
do_not_strip_quotes: ;
}
if (! yyres)
return yystrlen (yystr);
return yystpcpy (yyres, yystr) - yyres;
}
# endif
#endif /* YYERROR_VERBOSE */
@ -1009,13 +1099,13 @@ yyparse (void)
#else
int
yyparse ()
;
#endif
#endif
{
register int yystate;
register int yyn;
int yystate;
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
@ -1033,12 +1123,12 @@ yyparse ()
/* The state stack. */
short int yyssa[YYINITDEPTH];
short int *yyss = yyssa;
register short int *yyssp;
short int *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
register YYSTYPE *yyvsp;
YYSTYPE *yyvsp;
@ -1070,9 +1160,6 @@ yyparse ()
yyssp = yyss;
yyvsp = yyvs;
yyvsp[0] = yylval;
goto yysetstate;
/*------------------------------------------------------------.
@ -1105,7 +1192,7 @@ yyparse ()
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow ("parser stack overflow",
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
@ -1116,11 +1203,11 @@ yyparse ()
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyoverflowlab;
goto yyexhaustedlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyoverflowlab;
goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
@ -1130,7 +1217,7 @@ yyparse ()
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyoverflowlab;
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
@ -1666,10 +1753,11 @@ yyreduce:
break;
default: break;
}
/* Line 1037 of yacc.c. */
#line 1673 "getdate.c"
/* Line 1126 of yacc.c. */
#line 1761 "getdate.c"
yyvsp -= yylen;
yyssp -= yylen;
@ -1708,12 +1796,36 @@ yyerrlab:
if (YYPACT_NINF < yyn && yyn < YYLAST)
{
YYSIZE_T yysize = 0;
int yytype = YYTRANSLATE (yychar);
const char* yyprefix;
char *yymsg;
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1;
int yysize_overflow = 0;
char *yymsg = 0;
# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
int yyx;
#if 0
/* This is so xgettext sees the translatable formats that are
constructed on the fly. */
YY_("syntax error, unexpected %s");
YY_("syntax error, unexpected %s, expecting %s");
YY_("syntax error, unexpected %s, expecting %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
#endif
char *yyfmt;
char const *yyf;
static char const yyunexpected[] = "syntax error, unexpected %s";
static char const yyexpecting[] = ", expecting %s";
static char const yyor[] = " or %s";
char yyformat[sizeof yyunexpected
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
char const *yyprefix = yyexpecting;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
@ -1721,48 +1833,68 @@ yyerrlab:
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 0;
int yycount = 1;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
yyprefix = ", expecting ";
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
yycount += 1;
if (yycount == 5)
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yysize = 0;
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= yysize1 < yysize;
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
yysize += (sizeof ("syntax error, unexpected ")
+ yystrlen (yytname[yytype]));
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
yyp = yystpcpy (yyp, yytname[yytype]);
if (yycount < 5)
yyf = YY_(yyformat);
yysize1 = yysize + yystrlen (yyf);
yysize_overflow |= yysize1 < yysize;
yysize = yysize1;
if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg)
{
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
char *yyp = yymsg;
int yyi = 0;
while ((*yyp = *yyf))
{
yyprefix = ", expecting ";
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
yyp = yystpcpy (yyp, yyprefix);
yyp = yystpcpy (yyp, yytname[yyx]);
yyprefix = " or ";
}
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
yyerror (yymsg);
YYSTACK_FREE (yymsg);
}
else
yyerror ("syntax error; also virtual memory exhausted");
{
yyerror (YY_("syntax error"));
goto yyexhaustedlab;
}
}
else
#endif /* YYERROR_VERBOSE */
yyerror ("syntax error");
yyerror (YY_("syntax error"));
}
@ -1774,18 +1906,9 @@ yyerrlab:
if (yychar <= YYEOF)
{
/* If at end of input, pop the error token,
then the rest of the stack, then return failure. */
/* Return failure if at end of input. */
if (yychar == YYEOF)
for (;;)
{
YYPOPSTACK;
if (yyssp == yyss)
YYABORT;
yydestruct ("Error: popping",
yystos[*yyssp], yyvsp);
}
YYABORT;
}
else
{
@ -1804,12 +1927,11 @@ yyerrlab:
`---------------------------------------------------*/
yyerrorlab:
#ifdef __GNUC__
/* Pacify GCC when the user code never invokes YYERROR and the label
yyerrorlab therefore never appears in user code. */
/* Pacify compilers like GCC when the user code never invokes
YYERROR and the label yyerrorlab therefore never appears in user
code. */
if (0)
goto yyerrorlab;
#endif
yyvsp -= yylen;
yyssp -= yylen;
@ -1872,23 +1994,29 @@ yyacceptlab:
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yydestruct ("Error: discarding lookahead",
yytoken, &yylval);
yychar = YYEMPTY;
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here. |
`----------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp);
YYPOPSTACK;
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
@ -2058,17 +2186,12 @@ static TABLE const MilitaryTable[] = {
/* ARGSUSED */
static int
yyerror (s)
char *s;
static int yyerror (char *s)
{
return 0;
}
static int
ToHour (Hours, Meridian)
int Hours;
MERIDIAN Meridian;
static int ToHour (int Hours, MERIDIAN Meridian)
{
switch (Meridian)
{
@ -2094,9 +2217,7 @@ ToHour (Hours, Meridian)
/* NOTREACHED */
}
static int
ToYear (Year)
int Year;
static int ToYear (int Year)
{
if (Year < 0)
Year = -Year;
@ -2111,9 +2232,7 @@ ToYear (Year)
return Year;
}
static int
LookupWord (buff)
char *buff;
static int LookupWord (char *buff)
{
register char *p;
register char *q;
@ -2293,9 +2412,7 @@ yylex ()
#define TM_YEAR_ORIGIN 1900
/* Yield A - B, measured in seconds. */
static long
difftm (a, b)
struct tm *a, *b;
static long difftm (struct tm *a, struct tm *b)
{
int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
@ -2314,10 +2431,7 @@ difftm (a, b)
+ (a->tm_sec - b->tm_sec));
}
time_t
get_date (p, now)
const char *p;
const time_t *now;
time_t get_date (const char *p, const time_t *now)
{
struct tm tm, tm0, *tmp;
time_t Start;

View File

@ -113,7 +113,7 @@
#define yycheck gd_yycheck
static int yylex ();
static int yyerror ();
static int yyerror (char *s);
#define EPOCH 1970
#define HOUR(x) ((x) * 60)
@ -596,17 +596,12 @@ static TABLE const MilitaryTable[] = {
/* ARGSUSED */
static int
yyerror (s)
char *s;
static int yyerror (char *s)
{
return 0;
}
static int
ToHour (Hours, Meridian)
int Hours;
MERIDIAN Meridian;
static int ToHour (int Hours, MERIDIAN Meridian)
{
switch (Meridian)
{
@ -632,9 +627,7 @@ ToHour (Hours, Meridian)
/* NOTREACHED */
}
static int
ToYear (Year)
int Year;
static int ToYear (int Year)
{
if (Year < 0)
Year = -Year;
@ -649,9 +642,7 @@ ToYear (Year)
return Year;
}
static int
LookupWord (buff)
char *buff;
static int LookupWord (char *buff)
{
register char *p;
register char *q;
@ -831,9 +822,7 @@ yylex ()
#define TM_YEAR_ORIGIN 1900
/* Yield A - B, measured in seconds. */
static long
difftm (a, b)
struct tm *a, *b;
static long difftm (struct tm *a, struct tm *b)
{
int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
@ -852,10 +841,7 @@ difftm (a, b)
+ (a->tm_sec - b->tm_sec));
}
time_t
get_date (p, now)
const char *p;
const time_t *now;
time_t get_date (const char *p, const time_t *now)
{
struct tm tm, tm0, *tmp;
time_t Start;

View File

@ -33,7 +33,7 @@
#include <config.h>
#ident "$Id: setupenv.c,v 1.20 2005/09/30 14:29:11 kloczek Exp $"
#ident "$Id: setupenv.c,v 1.21 2006/01/18 19:55:15 kloczek Exp $"
#include <sys/types.h>
#include <sys/stat.h>
@ -43,6 +43,8 @@
#include "defines.h"
#include <pwd.h>
#include "getdef.h"
#ifndef USE_PAM
static void
addenv_path (const char *varname, const char *dirname, const char *filename)
{
@ -54,8 +56,6 @@ addenv_path (const char *varname, const char *dirname, const char *filename)
free (buf);
}
#ifndef USE_PAM
static void read_env_file (const char *filename)
{
FILE *fp;

View File

@ -29,7 +29,7 @@
#include <config.h>
#ident "$Id: shell.c,v 1.11 2005/08/31 17:24:58 kloczek Exp $"
#ident "$Id: shell.c,v 1.13 2006/01/18 19:38:27 kloczek Exp $"
#include <stdio.h>
#include <errno.h>
@ -51,13 +51,15 @@ extern size_t newenvc;
* the file. If all that fails, give up in disgust ...
*/
void shell (const char *file, const char *arg)
int shell (const char *file, const char *arg, char *const envp[])
{
char arg0[1024];
int err;
if (file == (char *) 0)
exit (1);
if (file == (char *) 0) {
errno = EINVAL;
return errno;
}
/*
* The argv[0]'th entry is usually the path name, but
@ -65,22 +67,17 @@ void shell (const char *file, const char *arg)
* that. So, we determine the 0'th entry only if they
* don't want to tell us what it is themselves.
*/
if (arg == (char *) 0) {
snprintf (arg0, sizeof arg0, "-%s", Basename ((char *) file));
arg = arg0;
}
#ifdef DEBUG
printf ("Executing shell %s\n", file);
#endif
/*
* First we try the direct approach. The system should be
* able to figure out what we are up to without too much
* grief.
*/
execle (file, arg, (char *) 0, newenvp);
execle (file, arg, (char *) 0, envp);
err = errno;
/* Linux handles #! in the kernel, and bash doesn't make
@ -92,7 +89,6 @@ void shell (const char *file, const char *arg)
* relies on the standard shell being able to make sense
* of the "#!" magic number.
*/
if (err == ENOEXEC) {
FILE *fp;
@ -100,7 +96,7 @@ void shell (const char *file, const char *arg)
if (getc (fp) == '#' && getc (fp) == '!') {
fclose (fp);
execle ("/bin/sh", "sh",
file, (char *) 0, newenvp);
file, (char *) 0, envp);
err = errno;
} else {
fclose (fp);
@ -114,9 +110,8 @@ void shell (const char *file, const char *arg)
* how to execute this stupid shell, so I might as well give
* up in disgust ...
*/
snprintf (arg0, sizeof arg0, _("Cannot execute %s"), file);
errno = err;
perror (arg0);
exit (1);
return err;
}

View File

@ -9,7 +9,7 @@
#include <config.h>
#ident "$Id: xmalloc.c,v 1.7 2005/08/31 17:24:58 kloczek Exp $"
#ident "$Id: xmalloc.c,v 1.8 2006/01/23 09:46:30 kloczek Exp $"
#include <stdio.h>
#include "defines.h"
@ -17,7 +17,7 @@ char *xmalloc (size_t size)
{
char *ptr;
ptr = malloc (size);
ptr = (char *) malloc (size);
if (!ptr && size) {
fprintf (stderr, _("malloc(%d) failed\n"), (int) size);
exit (13);