Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into ua126d19.elisa.omakaista.fi:/home/my/bk/mysql-4.0
This commit is contained in:
commit
a86c80e46a
@ -1014,13 +1014,20 @@ static void set_user(const char *user)
|
|||||||
{
|
{
|
||||||
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
|
#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
|
// don't bother if we aren't superuser
|
||||||
if (geteuid())
|
if (user_id)
|
||||||
{
|
{
|
||||||
if (user)
|
if (user)
|
||||||
|
{
|
||||||
|
/* 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,
|
fprintf(stderr,
|
||||||
"Warning: One can only use the --user switch if running as root\n");
|
"Warning: One can only use the --user switch if running as root\n");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (!user)
|
else if (!user)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user