• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision4b9c0954eb3e715177f0fa723f5cf38a6e1875cf (tree)
Time2019-06-09 23:06:19
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38844 player_euid, player_egid を player_type 構造体に加える.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -54,8 +54,6 @@ extern bool repair_objects;
5454 * Software options (set via the '=' command). See "tables.c"
5555 */
5656
57-extern int player_euid;
58-extern int player_egid;
5957 extern pos_list tmp_pos;
6058 extern STR_OFFSET quark__num;
6159 extern concptr *quark__str;
--- a/src/files.c
+++ b/src/files.c
@@ -150,11 +150,11 @@ void safe_setuid_grab(void)
150150
151151 # ifdef SAFE_SETUID_POSIX
152152
153- if (setuid(player_euid) != 0)
153+ if (setuid(p_ptr->player_egid) != 0)
154154 {
155155 quit(_("setuid(): 正しく許可が取れません!", "setuid(): cannot set permissions correctly!"));
156156 }
157- if (setgid(player_egid) != 0)
157+ if (setgid(p_ptr->player_egid) != 0)
158158 {
159159 quit(_("setgid(): 正しく許可が取れません!", "setgid(): cannot set permissions correctly!"));
160160 }
--- a/src/main.c
+++ b/src/main.c
@@ -292,8 +292,8 @@ int main(int argc, char *argv[])
292292 # ifdef _POSIX_SAVED_IDS
293293
294294 /* Save some info for later */
295- player_euid = geteuid();
296- player_egid = getegid();
295+ p_ptr->player_euid = geteuid();
296+ p_ptr->player_egid = getegid();
297297
298298 # endif
299299
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -61,6 +61,8 @@ typedef struct player_type player_type;
6161 struct player_type
6262 {
6363 int player_uid;
64+ int player_euid;
65+ int player_egid;
6466
6567 POSITION oldpy; /* Previous player location -KMW- */
6668 POSITION oldpx; /* Previous player location -KMW- */
--- a/src/variable.c
+++ b/src/variable.c
@@ -17,11 +17,6 @@
1717 bool repair_monsters; /* Hack -- optimize detect monsters */
1818 bool repair_objects; /* Hack -- optimize detect objects */
1919
20-/*
21- * User info
22- */
23-int player_euid;
24-int player_egid;
2520
2621 pos_list tmp_pos;
2722
Show on old repository browser