diff options
author | unknown <joerg@mysql.com> | 2004-09-13 16:32:47 +0200 |
---|---|---|
committer | unknown <joerg@mysql.com> | 2004-09-13 16:32:47 +0200 |
commit | 8f8ccc4bd56957a8051ae2e4624d5c76a6502403 (patch) | |
tree | 08b01ab14c81430cc6433b734c5e5525f1339c9c /sql/mysqld.cc | |
parent | 4e639af733f2af49ff0afa66788c2cb19603531c (diff) | |
download | mariadb-git-8f8ccc4bd56957a8051ae2e4624d5c76a6502403.tar.gz |
Replace 'sete_id(__)' calls by 'setre_id(-1,__)' to solve the
missing prototyped problem (bug#5521).
sql/mysqld.cc:
Some systems (Unixware, SCO) have no prototypes for 'seteuid()' and
'setegid()', but have them for 'setreuid()' / 'setregid()'.
So 'sete_id(__)' calls are replaced by 'setre_id(-1,__)' (bug#5521).
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c59f1ddcad6..ce64d2a39da 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1126,14 +1126,14 @@ static void set_effective_user(struct passwd *user_info) { #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) DBUG_ASSERT(user_info); - if (setegid(user_info->pw_gid) == -1) + if (setregid((gid_t)-1, user_info->pw_gid) == -1) { - sql_perror("setegid"); + sql_perror("setregid"); unireg_abort(1); } - if (seteuid(user_info->pw_uid) == -1) + if (setreuid((uid_t)-1, user_info->pw_uid) == -1) { - sql_perror("seteuid"); + sql_perror("setreuid"); unireg_abort(1); } #endif @@ -2657,9 +2657,9 @@ server."); #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && !defined(EMBEDDED_LIBRARY) if (locked_in_memory && !getuid()) { - if (seteuid(0) == -1) + if (setreuid((uid_t)-1, 0) == -1) { // this should never happen - sql_perror("seteuid"); + sql_perror("setreuid"); unireg_abort(1); } if (mlockall(MCL_CURRENT)) |