comparison common/util.h @ 323:31ba7ed4d50f

Made is_elevated portable.
author Sascha Wilde <wilde@intevation.de>
date Mon, 07 Apr 2014 13:20:34 +0200
parents 824ef90a6721
children 17e1c8f37d72
comparison
equal deleted inserted replaced
322:e30c9fee111a 323:31ba7ed4d50f
3 /* @file util.h 3 /* @file util.h
4 * @brief The usual useful stuff that fit nowhere else 4 * @brief The usual useful stuff that fit nowhere else
5 */ 5 */
6 #include <stdbool.h> 6 #include <stdbool.h>
7 7
8 #ifdef WIN32
9 /**@brief Check if the current process is running with elevated privileges. 8 /**@brief Check if the current process is running with elevated privileges.
10 * 9 *
11 * Elevates the current process token to check if it is marked as elevated. 10 * Elevates the current process token to check if it is marked as elevated.
12 * Uses TokenElevation. 11 * Uses TokenElevation on windows and checks effective UID on Linux.
13 * 12 *
14 * @returns true if the current process is elevated.*/ 13 * @returns true if the current process is elevated.*/
15 bool is_elevated(); 14 bool is_elevated();
16 #endif 15
17 #endif // COMMON_UTIL_H 16 #endif // COMMON_UTIL_H

http://wald.intevation.org/projects/trustbridge/