From 7868d789c2b2f6a074b7fc14cd4dc482957c90b5 Mon Sep 17 00:00:00 2001 From: mdw Date: Thu, 25 Jan 2001 22:21:43 +0000 Subject: [PATCH] Make flags be unsigned. --- checkpath.c | 13 ++++++------- checkpath.h | 27 +++++++++++++++------------ chkpath.c | 15 ++++++++------- path.c | 13 ++++++------- path.h | 27 +++++++++++++++------------ 5 files changed, 50 insertions(+), 45 deletions(-) diff --git a/checkpath.c b/checkpath.c index 4cf0e8f..28ca474 100644 --- a/checkpath.c +++ b/checkpath.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: checkpath.c,v 1.3 1999/05/21 22:07:20 mdw Exp $ + * $Id: checkpath.c,v 1.4 2001/01/25 22:16:02 mdw Exp $ * * Check a path for safety * @@ -29,6 +29,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: checkpath.c,v $ + * Revision 1.4 2001/01/25 22:16:02 mdw + * Make flags be unsigned. + * * Revision 1.3 1999/05/21 22:07:20 mdw * Take advantage of new dynamic string macros. * @@ -75,13 +78,9 @@ struct elt { char e_name[1]; /* Name of the directory */ }; -enum { - f_sticky = 1 /* Directory has sticky bit set */ -}; +#define f_sticky 1u /* Directory has sticky bit set */ -enum { - f_last = 1 /* This is the final item to check */ -}; +#define f_last 1u /* This is the final item to check */ /*----- Static variables --------------------------------------------------*/ diff --git a/checkpath.h b/checkpath.h index e759c07..74cd0f5 100644 --- a/checkpath.h +++ b/checkpath.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: checkpath.h,v 1.1 1999/04/06 20:12:07 mdw Exp $ + * $Id: checkpath.h,v 1.2 2001/01/25 22:16:02 mdw Exp $ * * Check a path for safety * @@ -29,8 +29,11 @@ /*----- Revision history --------------------------------------------------* * * $Log: checkpath.h,v $ - * Revision 1.1 1999/04/06 20:12:07 mdw - * Initial revision + * Revision 1.2 2001/01/25 22:16:02 mdw + * Make flags be unsigned. + * + * Revision 1.1.1.1 1999/04/06 20:12:07 mdw + * Import new project. * */ @@ -59,7 +62,7 @@ struct chkpath { gid_t cp_gid[NGROUPS_MAX + 1]; /* Array of groups that are OK */ int cp_gids; /* Number of groups in the array */ int cp_verbose; /* Verbosity level to spit up */ - int cp_what; /* What things to check for */ + unsigned cp_what; /* What things to check for */ void (*cp_report)(int /*what*/, int /*verb*/, const char */*dir*/, const char */*msg*/, void */*p*/); @@ -68,14 +71,14 @@ struct chkpath { /* --- Flags for `@what@' fields in the above --- */ -#define CP_ERROR 1 /* Error report */ -#define CP_WRWORLD 2 /* Check write by world */ -#define CP_WRGRP 4 /* Check write by any group */ -#define CP_WROTHGRP 8 /* Check write by other group */ -#define CP_WROTHUSR 16 /* Check write by other user */ -#define CP_SYMLINK 32 /* Report symbolic links */ -#define CP_REPORT 64 /* Make user-readable reports */ -#define CP_STICKYOK 128 /* Don't care if sticky is set */ +#define CP_ERROR 1u /* Error report */ +#define CP_WRWORLD 2u /* Check write by world */ +#define CP_WRGRP 4u /* Check write by any group */ +#define CP_WROTHGRP 8u /* Check write by other group */ +#define CP_WROTHUSR 16u /* Check write by other user */ +#define CP_SYMLINK 32u /* Report symbolic links */ +#define CP_REPORT 64u /* Make user-readable reports */ +#define CP_STICKYOK 128u /* Don't care if sticky is set */ /*----- Functions provided ------------------------------------------------*/ diff --git a/chkpath.c b/chkpath.c index e90b0d7..250e922 100644 --- a/chkpath.c +++ b/chkpath.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: chkpath.c,v 1.1 1999/04/06 20:12:07 mdw Exp $ + * $Id: chkpath.c,v 1.2 2001/01/25 22:16:02 mdw Exp $ * * Check a user's file search path * @@ -29,8 +29,11 @@ /*----- Revision history --------------------------------------------------* * * $Log: chkpath.c,v $ - * Revision 1.1 1999/04/06 20:12:07 mdw - * Initial revision + * Revision 1.2 2001/01/25 22:16:02 mdw + * Make flags be unsigned. + * + * Revision 1.1.1.1 1999/04/06 20:12:07 mdw + * Import new project. * */ @@ -109,10 +112,8 @@ int main(int argc, char *argv[]) struct chkpath cp; int f = 0; - enum { - f_print = 1, - f_colon = 2 - }; +#define f_print 1u +#define f_colon 2u /* --- Initialize the world --- */ diff --git a/path.c b/path.c index 657abd1..f731e52 100644 --- a/path.c +++ b/path.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: path.c,v 1.3 1999/05/21 22:07:20 mdw Exp $ + * $Id: path.c,v 1.4 2001/01/25 22:16:02 mdw Exp $ * * Check a path for safety * @@ -29,6 +29,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: path.c,v $ + * Revision 1.4 2001/01/25 22:16:02 mdw + * Make flags be unsigned. + * * Revision 1.3 1999/05/21 22:07:20 mdw * Take advantage of new dynamic string macros. * @@ -75,13 +78,9 @@ struct elt { char e_name[1]; /* Name of the directory */ }; -enum { - f_sticky = 1 /* Directory has sticky bit set */ -}; +#define f_sticky 1u /* Directory has sticky bit set */ -enum { - f_last = 1 /* This is the final item to check */ -}; +#define f_last 1u /* This is the final item to check */ /*----- Static variables --------------------------------------------------*/ diff --git a/path.h b/path.h index 51ff2d9..fc7478a 100644 --- a/path.h +++ b/path.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: path.h,v 1.1 1999/04/06 20:12:07 mdw Exp $ + * $Id: path.h,v 1.2 2001/01/25 22:16:02 mdw Exp $ * * Check a path for safety * @@ -29,8 +29,11 @@ /*----- Revision history --------------------------------------------------* * * $Log: path.h,v $ - * Revision 1.1 1999/04/06 20:12:07 mdw - * Initial revision + * Revision 1.2 2001/01/25 22:16:02 mdw + * Make flags be unsigned. + * + * Revision 1.1.1.1 1999/04/06 20:12:07 mdw + * Import new project. * */ @@ -59,7 +62,7 @@ struct chkpath { gid_t cp_gid[NGROUPS_MAX + 1]; /* Array of groups that are OK */ int cp_gids; /* Number of groups in the array */ int cp_verbose; /* Verbosity level to spit up */ - int cp_what; /* What things to check for */ + unsigned cp_what; /* What things to check for */ void (*cp_report)(int /*what*/, int /*verb*/, const char */*dir*/, const char */*msg*/, void */*p*/); @@ -68,14 +71,14 @@ struct chkpath { /* --- Flags for `@what@' fields in the above --- */ -#define CP_ERROR 1 /* Error report */ -#define CP_WRWORLD 2 /* Check write by world */ -#define CP_WRGRP 4 /* Check write by any group */ -#define CP_WROTHGRP 8 /* Check write by other group */ -#define CP_WROTHUSR 16 /* Check write by other user */ -#define CP_SYMLINK 32 /* Report symbolic links */ -#define CP_REPORT 64 /* Make user-readable reports */ -#define CP_STICKYOK 128 /* Don't care if sticky is set */ +#define CP_ERROR 1u /* Error report */ +#define CP_WRWORLD 2u /* Check write by world */ +#define CP_WRGRP 4u /* Check write by any group */ +#define CP_WROTHGRP 8u /* Check write by other group */ +#define CP_WROTHUSR 16u /* Check write by other user */ +#define CP_SYMLINK 32u /* Report symbolic links */ +#define CP_REPORT 64u /* Make user-readable reports */ +#define CP_STICKYOK 128u /* Don't care if sticky is set */ /*----- Functions provided ------------------------------------------------*/ -- 2.11.0