Mercurial > irccd
comparison cmake/IrccdSystem.cmake @ 708:0dd4fb9dfcc8
Irccd: disable pid, gid, uid and daemon options, closes #846 @1h
Those options are too platform specific and should be handled by the service
manager instead.
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 07 Jul 2018 09:21:10 +0200 |
parents | 91bc29e87399 |
children | a17de53db29b |
comparison
equal
deleted
inserted
replaced
707:48afa8c41f50 | 708:0dd4fb9dfcc8 |
---|---|
93 # | 93 # |
94 # Where any of these function / feature is required, include the <irccd/sysconfig.h> file. | 94 # Where any of these function / feature is required, include the <irccd/sysconfig.h> file. |
95 # | 95 # |
96 # The following variables are defined in irccd/sysconfig.h | 96 # The following variables are defined in irccd/sysconfig.h |
97 # | 97 # |
98 # HAVE_DAEMON True if daemon(3), | |
99 # HAVE_GETLOGIN True if getlogin(3) function (and unistd.h) | 98 # HAVE_GETLOGIN True if getlogin(3) function (and unistd.h) |
100 # HAVE_GETPID True if has getpid(2) function (and sys/types.h and unistd.h and grp.h), | |
101 # HAVE_POPEN True if has popen(3) function (in stdio.h) | 99 # HAVE_POPEN True if has popen(3) function (in stdio.h) |
102 # HAVE_SETGID True if has setgid(2) function and getgrnam(3) (and sys/types.h and unistd.h and pwd.h), | |
103 # HAVE_SETPROGNAME True if setprogname(3) is available from C library, | 100 # HAVE_SETPROGNAME True if setprogname(3) is available from C library, |
104 # HAVE_SETUID True if has setuid(2) function and getpwnam(3) (and sys/types.h and unistd.h and pwd.h), | |
105 # HAVE_STAT True if has stat(2) function (and sys/types.h and sys/stat.h), | 101 # HAVE_STAT True if has stat(2) function (and sys/types.h and sys/stat.h), |
106 # HAVE_STAT_ST_DEV The struct stat has st_dev field, | 102 # HAVE_STAT_ST_DEV The struct stat has st_dev field, |
107 # HAVE_STAT_ST_INO The struct stat has st_ino field, | 103 # HAVE_STAT_ST_INO The struct stat has st_ino field, |
108 # HAVE_STAT_ST_NLINK The struct stat has st_nlink field, | 104 # HAVE_STAT_ST_NLINK The struct stat has st_nlink field, |
109 # HAVE_STAT_ST_UID The struct stat has st_uid field, | 105 # HAVE_STAT_ST_UID The struct stat has st_uid field, |
121 check_include_file(unistd.h HAVE_UNISTD_H) | 117 check_include_file(unistd.h HAVE_UNISTD_H) |
122 | 118 |
123 # Check for sys/types.h | 119 # Check for sys/types.h |
124 check_include_file(sys/types.h HAVE_SYS_TYPES_H) | 120 check_include_file(sys/types.h HAVE_SYS_TYPES_H) |
125 | 121 |
126 # Check for daemon(3) function, include: | |
127 # | |
128 # #include <cstdlib> | |
129 check_function_exists(daemon HAVE_DAEMON) | |
130 | |
131 # Check of setprogname(3) function, include: | 122 # Check of setprogname(3) function, include: |
132 # | 123 # |
133 # #include <cstdlib> | 124 # #include <cstdlib> |
134 check_function_exists(setprogname HAVE_SETPROGNAME) | 125 check_function_exists(setprogname HAVE_SETPROGNAME) |
135 | 126 |
142 | 133 |
143 if (NOT HAVE_UNISTD_H) | 134 if (NOT HAVE_UNISTD_H) |
144 set(HAVE_GETLOGIN FALSE) | 135 set(HAVE_GETLOGIN FALSE) |
145 endif () | 136 endif () |
146 | 137 |
147 # getpid() function | |
148 # | |
149 # If HAVE_GETPID is defined, include: | |
150 # | |
151 # #include <sys/types.h> | |
152 # #include <unistd.h> | |
153 check_function_exists(getpid HAVE_GETPID) | |
154 | |
155 if (NOT HAVE_UNISTD_H OR NOT HAVE_SYS_TYPES_H) | |
156 set(HAVE_GETPID FALSE) | |
157 endif () | |
158 | |
159 # setgid() function (and getgrnam) | |
160 # | |
161 # If HAVE_SETGID is defined, include: | |
162 # | |
163 # #include <sys/types.h> | |
164 # #include <unistd.h> | |
165 # #include <grp.h> // only for getgrnam | |
166 check_include_file(grp.h HAVE_GRP_H) | |
167 check_function_exists(getgrnam HAVE_GETGRNAM) | |
168 check_function_exists(setgid HAVE_SETGID) | |
169 | |
170 if (NOT HAVE_UNISTD_H OR NOT HAVE_SYS_TYPES_H OR NOT HAVE_GETGRNAM OR NOT HAVE_GRP_H) | |
171 set(HAVE_SETGID FALSE) | |
172 endif () | |
173 | |
174 # popen() function | 138 # popen() function |
175 # | 139 # |
176 # If HAVE_POPEN is defined, include; | 140 # If HAVE_POPEN is defined, include; |
177 # | 141 # |
178 # #include <cstdio> | 142 # #include <cstdio> |
179 check_function_exists(popen HAVE_POPEN) | 143 check_function_exists(popen HAVE_POPEN) |
180 | |
181 # setuid() function (and getpwnam) | |
182 # | |
183 # If HAVE_SETUID is defined, include: | |
184 # | |
185 # #include <sys/types.h> | |
186 # #include <unistd.h> | |
187 # #include <pwd.h> // only for getpwnam | |
188 check_include_file(pwd.h HAVE_PWD_H) | |
189 check_function_exists(getpwnam HAVE_GETPWNAM) | |
190 check_function_exists(setuid HAVE_SETUID) | |
191 | |
192 if (NOT HAVE_UNISTD_H OR NOT HAVE_SYS_TYPES_H OR NOT HAVE_GETPWNAM OR NOT HAVE_PWD_H) | |
193 set(HAVE_SETUID FALSE) | |
194 endif () | |
195 | 144 |
196 # stat(2) function | 145 # stat(2) function |
197 # | 146 # |
198 # If HAVE_STAT is defined, include: | 147 # If HAVE_STAT is defined, include: |
199 # | 148 # |