1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
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
126 #ifdef WITH_PAM
127 int cron_start_pam(struct passwd *pw);
128 void cron_close_pam(void);
129 #endif
130
131 #endif