Commit d793db2b authored by jani@ua126d19.elisa.omakaista.fi's avatar jani@ua126d19.elisa.omakaista.fi

Merge bk-internal.mysql.com:/home/bk/mysql-4.0

into ua126d19.elisa.omakaista.fi:/home/my/bk/mysql-4.0
parents e09517e2 058d8ed1
......@@ -1013,14 +1013,21 @@ static void set_ports()
static void set_user(const char *user)
{
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
struct passwd *ent;
struct passwd *ent;
uid_t user_id= geteuid();
// don't bother if we aren't superuser
if (geteuid())
if (user_id)
{
if (user)
fprintf(stderr,
"Warning: One can only use the --user switch if running as root\n");
{
/* Don't give a warning, if real user is same as given with --user */
struct passwd *user_info= getpwnam(user);
if (!user_info || user_id != user_info->pw_uid)
fprintf(stderr,
"Warning: One can only use the --user switch if running as root\n");
}
return;
}
else if (!user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment