different things. Fixes warnings on AIX and others.
--HG--
branch : 1.7
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 1999-2005, 2007
+ * Copyright (c) 1999-2005, 2007, 2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
/*
- * Copyright (c) 1999, 2001-2005, 2007
+ * Copyright (c) 1999, 2001-2005, 2007, 2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 1999-2005, 2007-2009 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2007-2010 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 2000-2005, 2007-2008 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2000-2005, 2007-2008, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 1996, 1998-2005 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1996, 1998-2005, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 1999-2005, 2008 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2008, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 1999-2005, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2007, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 1999-2005, 2007-2008 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2007-2008, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/*
- * Copyright (c) 1999-2005, 2007-2009 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2007-2010 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
-# if defined(HAVE_MEMORY_H) && !defined(STDC_HEADERS)
-# include <memory.h>
-# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1999-2005 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1994-1996, 1998-2005
+ * Copyright (c) 1994-1996, 1998-2005, 2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1998-2005 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998-2005, 2010 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1999-2005, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2007, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1999-2005, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2007, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 2002 Michael Stroucken <michael@stroucken.org>
*
* Permission to use, copy, modify, and distribute this software for any
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1999-2005, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2007, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1999-2005, 2008-2009 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2008-2010 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
-# if defined(HAVE_MEMORY_H) && !defined(STDC_HEADERS)
-# include <memory.h>
-# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
+# if defined(HAVE_MEMORY_H) && !defined(STDC_HEADERS)
+# include <memory.h>
# endif
+# include <string.h>
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#include <limits.h>
#ifdef HAVE_SYSCTL
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
-# if defined(HAVE_MEMORY_H) && !defined(STDC_HEADERS)
-# include <memory.h>
-# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <stdio.h>
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#include <ctype.h>
#include <limits.h>
#ifdef HAVE_UNISTD_H
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 2008 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2008, 2010 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 1989, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
#include <ctype.h>
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#include <compat.h>
#include "emul/fnmatch.h"
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#if TIME_WITH_SYS_TIME
# include <time.h>
#endif
static int yylex __P((void));
static int yyparse __P((void));
-#line 108 "getdate.y"
+#line 107 "getdate.y"
#ifndef YYSTYPE_DEFINED
#define YYSTYPE_DEFINED
typedef union {
enum _MERIDIAN Meridian;
} YYSTYPE;
#endif /* YYSTYPE_DEFINED */
-#line 126 "y.tab.c"
+#line 125 "y.tab.c"
#define tAGO 257
#define tDAY 258
#define tDAYZONE 259
short *yysslim;
YYSTYPE *yyvs;
int yystacksize;
-#line 327 "getdate.y"
+#line 326 "getdate.y"
/* Month and day table. */
static TABLE const MonthDayTable[] = {
/* NOTREACHED */
}
#endif /* defined(TEST) */
-#line 980 "y.tab.c"
+#line 979 "y.tab.c"
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
#if defined(__cplusplus) || defined(__STDC__)
static int yygrowstack(void)
switch (yyn)
{
case 3:
-#line 126 "getdate.y"
+#line 125 "getdate.y"
{
yyHaveTime++;
}
break;
case 4:
-#line 129 "getdate.y"
+#line 128 "getdate.y"
{
yyHaveZone++;
}
break;
case 5:
-#line 132 "getdate.y"
+#line 131 "getdate.y"
{
yyHaveDate++;
}
break;
case 6:
-#line 135 "getdate.y"
+#line 134 "getdate.y"
{
yyHaveDay++;
}
break;
case 7:
-#line 138 "getdate.y"
+#line 137 "getdate.y"
{
yyHaveRel++;
}
break;
case 9:
-#line 144 "getdate.y"
+#line 143 "getdate.y"
{
yyHour = yyvsp[-1].Number;
yyMinutes = 0;
}
break;
case 10:
-#line 150 "getdate.y"
+#line 149 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
}
break;
case 11:
-#line 156 "getdate.y"
+#line 155 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
}
break;
case 12:
-#line 163 "getdate.y"
+#line 162 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
}
break;
case 13:
-#line 169 "getdate.y"
+#line 168 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
}
break;
case 14:
-#line 179 "getdate.y"
+#line 178 "getdate.y"
{
yyTimezone = yyvsp[0].Number;
yyDSTmode = DSToff;
}
break;
case 15:
-#line 183 "getdate.y"
+#line 182 "getdate.y"
{
yyTimezone = yyvsp[0].Number;
yyDSTmode = DSTon;
}
break;
case 16:
-#line 188 "getdate.y"
+#line 187 "getdate.y"
{
yyTimezone = yyvsp[-1].Number;
yyDSTmode = DSTon;
}
break;
case 17:
-#line 194 "getdate.y"
+#line 193 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[0].Number;
}
break;
case 18:
-#line 198 "getdate.y"
+#line 197 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[-1].Number;
}
break;
case 19:
-#line 202 "getdate.y"
+#line 201 "getdate.y"
{
yyDayOrdinal = yyvsp[-1].Number;
yyDayNumber = yyvsp[0].Number;
}
break;
case 20:
-#line 208 "getdate.y"
+#line 207 "getdate.y"
{
yyMonth = yyvsp[-2].Number;
yyDay = yyvsp[0].Number;
}
break;
case 21:
-#line 212 "getdate.y"
+#line 211 "getdate.y"
{
if (yyvsp[-4].Number >= 100) {
yyYear = yyvsp[-4].Number;
}
break;
case 22:
-#line 223 "getdate.y"
+#line 222 "getdate.y"
{
/* ISO 8601 format. yyyy-mm-dd. */
yyYear = yyvsp[-2].Number;
}
break;
case 23:
-#line 229 "getdate.y"
+#line 228 "getdate.y"
{
/* e.g. 17-JUN-1992. */
yyDay = yyvsp[-2].Number;
}
break;
case 24:
-#line 235 "getdate.y"
+#line 234 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[0].Number;
}
break;
case 25:
-#line 239 "getdate.y"
+#line 238 "getdate.y"
{
yyMonth = yyvsp[-3].Number;
yyDay = yyvsp[-2].Number;
}
break;
case 26:
-#line 244 "getdate.y"
+#line 243 "getdate.y"
{
yyMonth = yyvsp[0].Number;
yyDay = yyvsp[-1].Number;
}
break;
case 27:
-#line 248 "getdate.y"
+#line 247 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[-2].Number;
}
break;
case 28:
-#line 255 "getdate.y"
+#line 254 "getdate.y"
{
yyRelSeconds = -yyRelSeconds;
yyRelMonth = -yyRelMonth;
}
break;
case 30:
-#line 262 "getdate.y"
+#line 261 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number * 60L;
}
break;
case 31:
-#line 265 "getdate.y"
+#line 264 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number * 60L;
}
break;
case 32:
-#line 268 "getdate.y"
+#line 267 "getdate.y"
{
yyRelSeconds += yyvsp[0].Number * 60L;
}
break;
case 33:
-#line 271 "getdate.y"
+#line 270 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number;
}
break;
case 34:
-#line 274 "getdate.y"
+#line 273 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number;
}
break;
case 35:
-#line 277 "getdate.y"
+#line 276 "getdate.y"
{
yyRelSeconds++;
}
break;
case 36:
-#line 280 "getdate.y"
+#line 279 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
}
break;
case 37:
-#line 283 "getdate.y"
+#line 282 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
}
break;
case 38:
-#line 286 "getdate.y"
+#line 285 "getdate.y"
{
yyRelMonth += yyvsp[0].Number;
}
break;
case 39:
-#line 291 "getdate.y"
+#line 290 "getdate.y"
{
if (yyHaveTime && yyHaveDate && !yyHaveRel)
yyYear = yyvsp[0].Number;
}
break;
case 40:
-#line 318 "getdate.y"
+#line 317 "getdate.y"
{
yyval.Meridian = MER24;
}
break;
case 41:
-#line 321 "getdate.y"
+#line 320 "getdate.y"
{
yyval.Meridian = yyvsp[0].Meridian;
}
break;
-#line 1475 "y.tab.c"
+#line 1474 "y.tab.c"
}
yyssp -= yym;
yystate = *yyssp;
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#if TIME_WITH_SYS_TIME
# include <time.h>
#endif
/*
- * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2009-2010 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#include <limits.h>
#include "compat.h"
/*
- * Copyright (c) 1996, 1998-2005 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1996, 1998-2005, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
-# if defined(HAVE_MEMORY_H) && !defined(STDC_HEADERS)
-# include <memory.h>
-# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 2008-2009 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2008-2010 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1996, 1998-2005 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1996, 1998-2005, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#include <stdio.h>
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#define YYPREFIX "yy"
#line 2 "gram.y"
/*
- * Copyright (c) 1996, 1998-2005, 2007-2009
+ * Copyright (c) 1996, 1998-2005, 2007-2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
}
parse_error = TRUE;
}
-#line 113 "gram.y"
+#line 112 "gram.y"
#ifndef YYSTYPE_DEFINED
#define YYSTYPE_DEFINED
typedef union {
int tok;
} YYSTYPE;
#endif /* YYSTYPE_DEFINED */
-#line 139 "y.tab.c"
+#line 138 "y.tab.c"
#define COMMAND 257
#define ALIAS 258
#define DEFVAR 259
short *yysslim;
YYSTYPE *yyvs;
int yystacksize;
-#line 607 "gram.y"
+#line 606 "gram.y"
static struct defaults *
new_default(var, val, op)
char *var;
sudolineno = 1;
verbose = !quiet;
}
-#line 776 "y.tab.c"
+#line 775 "y.tab.c"
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
#if defined(__cplusplus) || defined(__STDC__)
static int yygrowstack(void)
switch (yyn)
{
case 1:
-#line 188 "gram.y"
+#line 187 "gram.y"
{ ; }
break;
case 5:
-#line 196 "gram.y"
+#line 195 "gram.y"
{
;
}
break;
case 6:
-#line 199 "gram.y"
+#line 198 "gram.y"
{
yyerrok;
}
break;
case 7:
-#line 202 "gram.y"
+#line 201 "gram.y"
{
add_userspec(yyvsp[-1].member, yyvsp[0].privilege);
}
break;
case 8:
-#line 205 "gram.y"
+#line 204 "gram.y"
{
;
}
break;
case 9:
-#line 208 "gram.y"
+#line 207 "gram.y"
{
;
}
break;
case 10:
-#line 211 "gram.y"
+#line 210 "gram.y"
{
;
}
break;
case 11:
-#line 214 "gram.y"
+#line 213 "gram.y"
{
;
}
break;
case 12:
-#line 217 "gram.y"
+#line 216 "gram.y"
{
add_defaults(DEFAULTS, NULL, yyvsp[0].defaults);
}
break;
case 13:
-#line 220 "gram.y"
+#line 219 "gram.y"
{
add_defaults(DEFAULTS_USER, yyvsp[-1].member, yyvsp[0].defaults);
}
break;
case 14:
-#line 223 "gram.y"
+#line 222 "gram.y"
{
add_defaults(DEFAULTS_RUNAS, yyvsp[-1].member, yyvsp[0].defaults);
}
break;
case 15:
-#line 226 "gram.y"
+#line 225 "gram.y"
{
add_defaults(DEFAULTS_HOST, yyvsp[-1].member, yyvsp[0].defaults);
}
break;
case 16:
-#line 229 "gram.y"
+#line 228 "gram.y"
{
add_defaults(DEFAULTS_CMND, yyvsp[-1].member, yyvsp[0].defaults);
}
break;
case 18:
-#line 235 "gram.y"
+#line 234 "gram.y"
{
list_append(yyvsp[-2].defaults, yyvsp[0].defaults);
yyval.defaults = yyvsp[-2].defaults;
}
break;
case 19:
-#line 241 "gram.y"
+#line 240 "gram.y"
{
yyval.defaults = new_default(yyvsp[0].string, NULL, TRUE);
}
break;
case 20:
-#line 244 "gram.y"
+#line 243 "gram.y"
{
yyval.defaults = new_default(yyvsp[0].string, NULL, FALSE);
}
break;
case 21:
-#line 247 "gram.y"
+#line 246 "gram.y"
{
yyval.defaults = new_default(yyvsp[-2].string, yyvsp[0].string, TRUE);
}
break;
case 22:
-#line 250 "gram.y"
+#line 249 "gram.y"
{
yyval.defaults = new_default(yyvsp[-2].string, yyvsp[0].string, '+');
}
break;
case 23:
-#line 253 "gram.y"
+#line 252 "gram.y"
{
yyval.defaults = new_default(yyvsp[-2].string, yyvsp[0].string, '-');
}
break;
case 25:
-#line 259 "gram.y"
+#line 258 "gram.y"
{
list_append(yyvsp[-2].privilege, yyvsp[0].privilege);
yyval.privilege = yyvsp[-2].privilege;
}
break;
case 26:
-#line 265 "gram.y"
+#line 264 "gram.y"
{
struct privilege *p = emalloc(sizeof(*p));
list2tq(&p->hostlist, yyvsp[-2].member);
}
break;
case 27:
-#line 275 "gram.y"
+#line 274 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = FALSE;
}
break;
case 28:
-#line 279 "gram.y"
+#line 278 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = TRUE;
}
break;
case 29:
-#line 285 "gram.y"
+#line 284 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, ALIAS);
}
break;
case 30:
-#line 288 "gram.y"
+#line 287 "gram.y"
{
yyval.member = new_member(NULL, ALL);
}
break;
case 31:
-#line 291 "gram.y"
+#line 290 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, NETGROUP);
}
break;
case 32:
-#line 294 "gram.y"
+#line 293 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, NTWKADDR);
}
break;
case 33:
-#line 297 "gram.y"
+#line 296 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, WORD);
}
break;
case 35:
-#line 303 "gram.y"
+#line 302 "gram.y"
{
list_append(yyvsp[-2].cmndspec, yyvsp[0].cmndspec);
#ifdef HAVE_SELINUX
}
break;
case 36:
-#line 335 "gram.y"
+#line 334 "gram.y"
{
struct cmndspec *cs = emalloc(sizeof(*cs));
if (yyvsp[-3].runas != NULL) {
}
break;
case 37:
-#line 361 "gram.y"
+#line 360 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = FALSE;
}
break;
case 38:
-#line 365 "gram.y"
+#line 364 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = TRUE;
}
break;
case 39:
-#line 371 "gram.y"
+#line 370 "gram.y"
{
yyval.string = yyvsp[0].string;
}
break;
case 40:
-#line 376 "gram.y"
+#line 375 "gram.y"
{
yyval.string = yyvsp[0].string;
}
break;
case 41:
-#line 381 "gram.y"
+#line 380 "gram.y"
{
yyval.seinfo.role = NULL;
yyval.seinfo.type = NULL;
}
break;
case 42:
-#line 385 "gram.y"
+#line 384 "gram.y"
{
yyval.seinfo.role = yyvsp[0].string;
yyval.seinfo.type = NULL;
}
break;
case 43:
-#line 389 "gram.y"
+#line 388 "gram.y"
{
yyval.seinfo.type = yyvsp[0].string;
yyval.seinfo.role = NULL;
}
break;
case 44:
-#line 393 "gram.y"
+#line 392 "gram.y"
{
yyval.seinfo.role = yyvsp[-1].string;
yyval.seinfo.type = yyvsp[0].string;
}
break;
case 45:
-#line 397 "gram.y"
+#line 396 "gram.y"
{
yyval.seinfo.type = yyvsp[-1].string;
yyval.seinfo.role = yyvsp[0].string;
}
break;
case 46:
-#line 403 "gram.y"
+#line 402 "gram.y"
{
yyval.runas = NULL;
}
break;
case 47:
-#line 406 "gram.y"
+#line 405 "gram.y"
{
yyval.runas = yyvsp[-1].runas;
}
break;
case 48:
-#line 411 "gram.y"
+#line 410 "gram.y"
{
yyval.runas = emalloc(sizeof(struct runascontainer));
yyval.runas->runasusers = yyvsp[0].member;
}
break;
case 49:
-#line 416 "gram.y"
+#line 415 "gram.y"
{
yyval.runas = emalloc(sizeof(struct runascontainer));
yyval.runas->runasusers = yyvsp[-2].member;
}
break;
case 50:
-#line 421 "gram.y"
+#line 420 "gram.y"
{
yyval.runas = emalloc(sizeof(struct runascontainer));
yyval.runas->runasusers = NULL;
}
break;
case 51:
-#line 428 "gram.y"
+#line 427 "gram.y"
{
yyval.tag.nopasswd = yyval.tag.noexec = yyval.tag.setenv =
yyval.tag.log_input = yyval.tag.log_output = UNSPEC;
}
break;
case 52:
-#line 432 "gram.y"
+#line 431 "gram.y"
{
yyval.tag.nopasswd = TRUE;
}
break;
case 53:
-#line 435 "gram.y"
+#line 434 "gram.y"
{
yyval.tag.nopasswd = FALSE;
}
break;
case 54:
-#line 438 "gram.y"
+#line 437 "gram.y"
{
yyval.tag.noexec = TRUE;
}
break;
case 55:
-#line 441 "gram.y"
+#line 440 "gram.y"
{
yyval.tag.noexec = FALSE;
}
break;
case 56:
-#line 444 "gram.y"
+#line 443 "gram.y"
{
yyval.tag.setenv = TRUE;
}
break;
case 57:
-#line 447 "gram.y"
+#line 446 "gram.y"
{
yyval.tag.setenv = FALSE;
}
break;
case 58:
-#line 450 "gram.y"
+#line 449 "gram.y"
{
yyval.tag.log_input = TRUE;
}
break;
case 59:
-#line 453 "gram.y"
+#line 452 "gram.y"
{
yyval.tag.log_input = FALSE;
}
break;
case 60:
-#line 456 "gram.y"
+#line 455 "gram.y"
{
yyval.tag.log_output = TRUE;
}
break;
case 61:
-#line 459 "gram.y"
+#line 458 "gram.y"
{
yyval.tag.log_output = FALSE;
}
break;
case 62:
-#line 464 "gram.y"
+#line 463 "gram.y"
{
yyval.member = new_member(NULL, ALL);
}
break;
case 63:
-#line 467 "gram.y"
+#line 466 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, ALIAS);
}
break;
case 64:
-#line 470 "gram.y"
+#line 469 "gram.y"
{
struct sudo_command *c = emalloc(sizeof(*c));
c->cmnd = yyvsp[0].command.cmnd;
}
break;
case 67:
-#line 482 "gram.y"
+#line 481 "gram.y"
{
char *s;
if ((s = alias_add(yyvsp[-2].string, HOSTALIAS, yyvsp[0].member)) != NULL) {
}
break;
case 69:
-#line 492 "gram.y"
+#line 491 "gram.y"
{
list_append(yyvsp[-2].member, yyvsp[0].member);
yyval.member = yyvsp[-2].member;
}
break;
case 72:
-#line 502 "gram.y"
+#line 501 "gram.y"
{
char *s;
if ((s = alias_add(yyvsp[-2].string, CMNDALIAS, yyvsp[0].member)) != NULL) {
}
break;
case 74:
-#line 512 "gram.y"
+#line 511 "gram.y"
{
list_append(yyvsp[-2].member, yyvsp[0].member);
yyval.member = yyvsp[-2].member;
}
break;
case 77:
-#line 522 "gram.y"
+#line 521 "gram.y"
{
char *s;
if ((s = alias_add(yyvsp[-2].string, RUNASALIAS, yyvsp[0].member)) != NULL) {
}
break;
case 80:
-#line 535 "gram.y"
+#line 534 "gram.y"
{
char *s;
if ((s = alias_add(yyvsp[-2].string, USERALIAS, yyvsp[0].member)) != NULL) {
}
break;
case 82:
-#line 545 "gram.y"
+#line 544 "gram.y"
{
list_append(yyvsp[-2].member, yyvsp[0].member);
yyval.member = yyvsp[-2].member;
}
break;
case 83:
-#line 551 "gram.y"
+#line 550 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = FALSE;
}
break;
case 84:
-#line 555 "gram.y"
+#line 554 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = TRUE;
}
break;
case 85:
-#line 561 "gram.y"
+#line 560 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, ALIAS);
}
break;
case 86:
-#line 564 "gram.y"
+#line 563 "gram.y"
{
yyval.member = new_member(NULL, ALL);
}
break;
case 87:
-#line 567 "gram.y"
+#line 566 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, NETGROUP);
}
break;
case 88:
-#line 570 "gram.y"
+#line 569 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, USERGROUP);
}
break;
case 89:
-#line 573 "gram.y"
+#line 572 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, WORD);
}
break;
case 91:
-#line 579 "gram.y"
+#line 578 "gram.y"
{
list_append(yyvsp[-2].member, yyvsp[0].member);
yyval.member = yyvsp[-2].member;
}
break;
case 92:
-#line 585 "gram.y"
+#line 584 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = FALSE;
}
break;
case 93:
-#line 589 "gram.y"
+#line 588 "gram.y"
{
yyval.member = yyvsp[0].member;
yyval.member->negated = TRUE;
}
break;
case 94:
-#line 595 "gram.y"
+#line 594 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, ALIAS);
}
break;
case 95:
-#line 598 "gram.y"
+#line 597 "gram.y"
{
yyval.member = new_member(NULL, ALL);
}
break;
case 96:
-#line 601 "gram.y"
+#line 600 "gram.y"
{
yyval.member = new_member(yyvsp[0].string, WORD);
}
break;
-#line 1545 "y.tab.c"
+#line 1544 "y.tab.c"
}
yyssp -= yym;
yystate = *yyssp;
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1996, 1998-2005, 2007-2009
+ * Copyright (c) 1996, 1998-2005, 2007-2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
-# if defined(HAVE_MEMORY_H) && !defined(STDC_HEADERS)
-# include <memory.h>
-# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1996, 1998-2005, 2007-2009
+ * Copyright (c) 1996, 1998-2005, 2007-2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/*
- * Copyright (c) 1999-2005, 2008 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2005, 2008, 2010
+ * Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_TERMIOS_H
# include <termios.h>
#else
/*
- * Copyright (c) 1996, 1998-2005, 2007-2009
+ * Copyright (c) 1996, 1998-2005, 2007-2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#define INITIAL 0
#line 2 "toke.l"
/*
- * Copyright (c) 1996, 1998-2005, 2007-2009
+ * Copyright (c) 1996, 1998-2005, 2007-2010
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#define INSTR 5
-#line 1470 "lex.yy.c"
+#line 1469 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 128 "toke.l"
+#line 127 "toke.l"
-#line 1626 "lex.yy.c"
+#line 1625 "lex.yy.c"
if ( yy_init )
{
case 1:
YY_RULE_SETUP
-#line 129 "toke.l"
+#line 128 "toke.l"
BEGIN STARTDEFS;
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 131 "toke.l"
+#line 130 "toke.l"
{
BEGIN INDEFS;
LEXTRACE("DEFVAR ");
case 3:
YY_RULE_SETUP
-#line 140 "toke.l"
+#line 139 "toke.l"
{
BEGIN STARTDEFS;
LEXTRACE(", ");
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 146 "toke.l"
+#line 145 "toke.l"
{
LEXTRACE("= ");
return('=');
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 151 "toke.l"
+#line 150 "toke.l"
{
LEXTRACE("+= ");
return('+');
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 156 "toke.l"
+#line 155 "toke.l"
{
LEXTRACE("-= ");
return('-');
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 161 "toke.l"
+#line 160 "toke.l"
{
LEXTRACE("BEGINSTR ");
yylval.string = NULL;
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 167 "toke.l"
+#line 166 "toke.l"
{
LEXTRACE("WORD(2) ");
if (!fill(yytext, yyleng))
case 9:
YY_RULE_SETUP
-#line 176 "toke.l"
+#line 175 "toke.l"
{
/* Line continuation char followed by newline. */
++sudolineno;
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 182 "toke.l"
+#line 181 "toke.l"
{
LEXTRACE("ENDSTR ");
BEGIN INDEFS;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 188 "toke.l"
+#line 187 "toke.l"
{
LEXTRACE("BACKSLASH ");
if (!append(yytext, yyleng))
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 194 "toke.l"
+#line 193 "toke.l"
{
LEXTRACE("STRBODY ");
if (!append(yytext, yyleng))
case 13:
YY_RULE_SETUP
-#line 202 "toke.l"
+#line 201 "toke.l"
{
/* quoted fnmatch glob char, pass verbatim */
LEXTRACE("QUOTEDCHAR ");
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 210 "toke.l"
+#line 209 "toke.l"
{
/* quoted sudoers special char, strip backslash */
LEXTRACE("QUOTEDCHAR ");
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 218 "toke.l"
+#line 217 "toke.l"
{
BEGIN INITIAL;
yyless(0);
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 224 "toke.l"
+#line 223 "toke.l"
{
LEXTRACE("ARG ");
if (!fill_args(yytext, yyleng, sawspace))
case 17:
YY_RULE_SETUP
-#line 232 "toke.l"
+#line 231 "toke.l"
{
char *path;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 245 "toke.l"
+#line 244 "toke.l"
{
char *path;
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 261 "toke.l"
+#line 260 "toke.l"
{
int n;
for (n = 0; isblank((unsigned char)yytext[n]); n++)
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 290 "toke.l"
+#line 289 "toke.l"
{
int n;
for (n = 0; isblank((unsigned char)yytext[n]); n++)
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 310 "toke.l"
+#line 309 "toke.l"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 316 "toke.l"
+#line 315 "toke.l"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 322 "toke.l"
+#line 321 "toke.l"
{
LEXTRACE("NOEXEC ");
return(NOEXEC);
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 327 "toke.l"
+#line 326 "toke.l"
{
LEXTRACE("EXEC ");
return(EXEC);
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 332 "toke.l"
+#line 331 "toke.l"
{
LEXTRACE("SETENV ");
return(SETENV);
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 337 "toke.l"
+#line 336 "toke.l"
{
LEXTRACE("NOSETENV ");
return(NOSETENV);
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 342 "toke.l"
+#line 341 "toke.l"
{
/* netgroup */
if (!fill(yytext, yyleng))
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 350 "toke.l"
+#line 349 "toke.l"
{
/* UN*X group */
if (!fill(yytext, yyleng))
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 358 "toke.l"
+#line 357 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 365 "toke.l"
+#line 364 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 372 "toke.l"
+#line 371 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 383 "toke.l"
+#line 382 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 394 "toke.l"
+#line 393 "toke.l"
{
if (strcmp(yytext, "ALL") == 0) {
LEXTRACE("ALL ");
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 416 "toke.l"
+#line 415 "toke.l"
{
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(yytext, yyleng))
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 424 "toke.l"
+#line 423 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 431 "toke.l"
+#line 430 "toke.l"
{
/* directories can't have args... */
if (yytext[yyleng - 1] == '/') {
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 446 "toke.l"
+#line 445 "toke.l"
{
/* a quoted user/group name */
if (!fill(yytext + 1, yyleng - 2))
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 463 "toke.l"
+#line 462 "toke.l"
{
/* a word */
if (!fill(yytext, yyleng))
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 471 "toke.l"
+#line 470 "toke.l"
{
LEXTRACE("( ");
return ('(');
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 476 "toke.l"
+#line 475 "toke.l"
{
LEXTRACE(") ");
return(')');
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 481 "toke.l"
+#line 480 "toke.l"
{
LEXTRACE(", ");
return(',');
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 486 "toke.l"
+#line 485 "toke.l"
{
LEXTRACE("= ");
return('=');
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 491 "toke.l"
+#line 490 "toke.l"
{
LEXTRACE(": ");
return(':');
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 496 "toke.l"
+#line 495 "toke.l"
{
if (yyleng % 2 == 1)
return('!'); /* return '!' */
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 501 "toke.l"
+#line 500 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 508 "toke.l"
+#line 507 "toke.l"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 512 "toke.l"
+#line 511 "toke.l"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 518 "toke.l"
+#line 517 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 525 "toke.l"
+#line 524 "toke.l"
{
LEXTRACE("ERROR ");
return(ERROR);
case YY_STATE_EOF(STARTDEFS):
case YY_STATE_EOF(INDEFS):
case YY_STATE_EOF(INSTR):
-#line 530 "toke.l"
+#line 529 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 540 "toke.l"
+#line 539 "toke.l"
ECHO;
YY_BREAK
-#line 2280 "lex.yy.c"
+#line 2279 "lex.yy.c"
case YY_END_OF_BUFFER:
{
return 0;
}
#endif
-#line 540 "toke.l"
+#line 539 "toke.l"
static unsigned char
hexchar(s)
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# include <memory.h>
# endif
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#include <fcntl.h>
#include <limits.h>
#include <pwd.h>
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */