summaryrefslogtreecommitdiff
path: root/modules/pam_time
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-06-16 06:35:16 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-06-16 06:35:16 +0000
commit08af548ce20b85b0c269672a841016866d8b4267 (patch)
tree783b4a6308b59452d087436a2d08275f71a71ed9 /modules/pam_time
parent07140990580262cbdfff9cc2134ae34865c887a2 (diff)
Relevant BUGIDs:
Purpose of commit: cleanup Commit summary: --------------- 2006-06-16 Thorsten Kukuk <kukuk@thkukuk.de> * modules/pam_time/pam_time.c: Replace type boolean with int. * modules/pam_group/pam_group.c: Likewise.
Diffstat (limited to 'modules/pam_time')
-rw-r--r--modules/pam_time/pam_time.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/pam_time/pam_time.c b/modules/pam_time/pam_time.c
index 075d951f..43b716f0 100644
--- a/modules/pam_time/pam_time.c
+++ b/modules/pam_time/pam_time.c
@@ -25,14 +25,13 @@
#define PAM_TIME_BUFLEN 1000
#define FIELD_SEPARATOR ';' /* this is new as of .02 */
-#ifdef TRUE
-# undef TRUE
+#ifndef TRUE
+# define TRUE 1
#endif
-#ifdef FALSE
-# undef FALSE
+#ifndef FALSE
+# define FALSE 0
#endif
-typedef enum { FALSE, TRUE } boolean;
typedef enum { AND, OR } operator;
/*
@@ -256,12 +255,12 @@ logic_member(const char *string, int *at)
typedef enum { VAL, OP } expect;
-static boolean
+static int
logic_field(pam_handle_t *pamh, const void *me, const char *x, int rule,
- boolean (*agrees)(pam_handle_t *pamh,
+ int (*agrees)(pam_handle_t *pamh,
const void *, const char *, int, int))
{
- boolean left=FALSE, right, not=FALSE;
+ int left=FALSE, right, not=FALSE;
operator oper=OR;
int at=0, l;
expect next=VAL;
@@ -309,7 +308,7 @@ logic_field(pam_handle_t *pamh, const void *me, const char *x, int rule,
return left;
}
-static boolean
+static int
is_same(pam_handle_t *pamh UNUSED, const void *A, const char *b,
int len, int rule UNUSED)
{
@@ -367,11 +366,11 @@ time_now(void)
}
/* take the current date and see if the range "date" passes it */
-static boolean
+static int
check_time(pam_handle_t *pamh, const void *AT, const char *times,
int len, int rule)
{
- boolean not,pass;
+ int not,pass;
int marked_day, time_start, time_end;
const TIME *at;
int i,j=0;
@@ -482,7 +481,7 @@ check_account(pam_handle_t *pamh, const char *service,
here_and_now = time_now(); /* find current time */
do {
- boolean good=TRUE,intime;
+ int good=TRUE,intime;
/* here we get the service name field */