root/src/funcs.h

/* [previous][next][first][last][top][bottom][index][help]  */

INCLUDED FROM


   1 /*
   2  * $Id: funcs.h,v 1.9 2004/01/23 18:56:42 vixie Exp $
   3  */
   4 
   5 /*
   6  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
   7  * Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
   8  *
   9  * Permission to use, copy, modify, and distribute this software for any
  10  * purpose with or without fee is hereby granted, provided that the above
  11  * copyright notice and this permission notice appear in all copies.
  12  *
  13  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
  14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  15  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
  16  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  17  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  18  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  19  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  20  */
  21 
  22 /* Notes:
  23  *      We should reorg this into sections by module.
  24  */
  25 
  26 #ifndef CRONIE_FUNCS_H
  27 #define CRONIE_FUNCS_H
  28 
  29 #include <stdio.h>
  30 #include <sys/types.h>
  31 
  32 #ifdef WITH_SELINUX
  33 #include <selinux/selinux.h>
  34 #endif
  35 
  36 #include "externs.h"
  37 #include "structs.h"
  38 
  39 void            set_cron_uid(void),
  40                 check_spool_dir(void),
  41                 open_logfile(void),
  42                 sigpipe_func(void),
  43                 job_add(entry *, user *),
  44                 do_command(entry *, user *),
  45                 link_user(cron_db *, user *),
  46                 unlink_user(cron_db *, user *),
  47                 free_user(user *),
  48                 env_free(char **),
  49                 unget_char(int, FILE *),
  50                 free_entry(entry *),
  51                 acquire_daemonlock(int),
  52                 skip_comments(FILE *),
  53                 log_it(const char *, PID_T, const char *, const char *, int),
  54                 log_close(void),
  55                 check_orphans(cron_db *);
  56 #if defined WITH_INOTIFY
  57 void            set_cron_watched(int ),
  58                 set_cron_unwatched(int ),
  59                 check_inotify_database(cron_db *);
  60 #endif
  61 
  62 int             load_database(cron_db *),
  63                 job_runqueue(void),
  64                 set_debug_flags(const char *),
  65                 get_char(FILE *),
  66                 get_string(char *, int, FILE *, const char *),
  67                 swap_uids(void),
  68                 swap_uids_back(void),
  69                 load_env(char *, FILE *),
  70                 env_set_from_environ(char ***envpp),
  71                 cron_pclose(FILE *),
  72                 glue_strings(char *, size_t, const char *, const char *, char),
  73                 strcmp_until(const char *, const char *, char),
  74                 allowed(const char * ,const char * ,const char *);
  75 
  76 size_t          strlens(const char *, ...),
  77                 strdtb(char *);
  78 
  79 char            *env_get(const char *, char **),
  80                 *arpadate(time_t *),
  81                 *mkprints(unsigned char *, size_t),
  82                 *first_word(const char *, const char *),
  83                 **env_init(void),
  84                 **env_copy(char **),
  85                 **env_set(char **, const char *),
  86                 **env_update_home(char **, const char *);
  87 
  88 user            *load_user(int, struct passwd *, const char *, const char *, const char *),
  89                 *find_user(cron_db *, const char *, const char *);
  90 
  91 entry           *load_entry(FILE *, void (*)(), struct passwd *, char **);
  92 
  93 FILE            *cron_popen(char *, const char *, struct passwd *, char **);
  94 
  95 struct passwd   *pw_dup(const struct passwd *);
  96 
  97 #ifndef HAVE_STRUCT_TM_TM_GMTOFF
  98 long            get_gmtoff(time_t *, struct tm *);
  99 #endif
 100 
 101 /* Red Hat security stuff (security.c): 
 102  */
 103 void cron_restore_default_security_context( void );
 104 
 105 int cron_set_job_security_context( entry *e, user *u, char ***jobenvp );
 106 
 107 int cron_open_security_session( struct passwd *pw );
 108 
 109 void cron_close_security_session( void );
 110 
 111 int cron_change_groups( struct passwd *pw );
 112 
 113 int cron_change_user_permanently( struct passwd *pw, char *homedir );
 114 
 115 int get_security_context(const char *name, 
 116                          int crontab_fd, 
 117                          security_context_t *rcontext, 
 118                          const char *tabname
 119                         );
 120 
 121 void free_security_context( security_context_t *scontext );
 122 
 123 int crontab_security_access(void);
 124 
 125 /* PAM */
 126 #ifdef WITH_PAM
 127 int cron_start_pam(struct passwd *pw);
 128 void cron_close_pam(void);
 129 #endif
 130 
 131 #endif /* CRONIE_FUNCS_H */

/* [previous][next][first][last][top][bottom][index][help]  */