aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorLAN-TE <lantw44@gmail.com>2012-11-12 17:25:43 +0800
committerLAN-TE <lantw44@gmail.com>2012-11-12 17:25:43 +0800
commitdd395f346b69a124608e22b64322c1f1d94e0df3 (patch)
tree7127a2bf4d93ef8d629607a8f160b2ed815dcc30 /src/common.h
parentd7f706956e0c4914879d2d08c24227ba0bb6ef0f (diff)
downloadsctjudge-dd395f346b69a124608e22b64322c1f1d94e0df3.tar.gz
sctjudge-dd395f346b69a124608e22b64322c1f1d94e0df3.tar.zst
sctjudge-dd395f346b69a124608e22b64322c1f1d94e0df3.zip
修正 save_uids() 和 UID 相關變數的宣告
由於要避免使用 getuid(),相關宣告不再是僅限 --disable-cap 的狀況才需要,現在不 論是哪種情況,因為都要檢查 UID,所以一定需要這些東西。
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/common.h b/src/common.h
index ca1f5f2..5d45377 100644
--- a/src/common.h
+++ b/src/common.h
@@ -9,19 +9,16 @@ void checktimespec(struct timespec*);
void difftimespec(const struct timespec*, const struct timespec*,
struct timespec*);
int comparetimespec(const struct timespec*, const struct timespec*);
-
+void save_uids(void); /* 這個一定要先執行,不然預設 uid 就是 0 */
#ifndef HAVE_CONF_CAP
-void save_uids(void); /* 這個一定要先執行,不然預設 uid 就是 0 */
void disable_setuid(void);
void enable_setuid(void);
#endif
-#ifndef _POSIX_SAVED_IDS
-/* 避免 disable_setuid() 之後 getuid() 得到錯誤的值,所以用這個變數來取代 */
+/* 避免 disable_setuid() 之後 getuid() 得到錯誤的值,所以用這些變數把最初的
+ * UID 給記下來!*/
extern uid_t procrealuid;
extern uid_t proceffuid;
-#endif
-
#endif