Commit e66f7ed1 e66f7ed1d4b5f6cb696e5b6e02033181d392dc1e by Sergey Poznyakoff

Use mu_getpwuid() instead of getpwuid().

1 parent 24ed1e41
......@@ -27,7 +27,7 @@ imap4d_bye (int reason)
int
imap4d_bye0 (int reason, struct imap4d_command *command)
{
struct passwd *pw = getpwuid (getuid ());
struct passwd *pw = mu_getpwuid (getuid ());
const char *username;
int status = EXIT_FAILURE;
username = (pw) ? pw->pw_name : "Unknown";
......
......@@ -75,7 +75,7 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
if (strcasecmp (name, "INBOX") == 0 && !mu_virtual_domain)
{
struct passwd *pw = getpwuid (getuid());
struct passwd *pw = mu_getpwuid (getuid());
mailbox_name = strdup ((pw) ? pw->pw_name : "");
}
else
......
......@@ -89,7 +89,7 @@ imap4d_rename (struct imap4d_command *command, char *arg)
}
free (name);
free (newname);
pw = getpwuid (getuid ());
pw = mu_getpwuid (getuid ());
if (pw)
{
mailbox_t inbox = NULL;
......
......@@ -59,7 +59,7 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
if (strcasecmp (mailbox_name, "INBOX") == 0 && !mu_virtual_domain)
{
pw = getpwuid (getuid ());
pw = mu_getpwuid (getuid ());
if (pw)
{
mailbox_name = malloc (strlen (maildir) + strlen (pw->pw_name) + 1);
......
......@@ -47,7 +47,7 @@ imap4d_status (struct imap4d_command *command, char *arg)
if (strcasecmp (name, "INBOX") == 0 && !mu_virtual_domain)
{
struct passwd *pw = getpwuid (getuid());
struct passwd *pw = mu_getpwuid (getuid());
mailbox_name = strdup ((pw) ? pw->pw_name : "");
}
else
......
......@@ -86,12 +86,12 @@ get_homedir (const char *user)
homedir = getenv ("HOME");
if (homedir == NULL)
{
pw = getpwuid (getuid ());
pw = mu_getpwuid (getuid ());
if (pw)
homedir = pw->pw_dir;
}
#else
pw = getpwuid (getuid ());
pw = mu_getpwuid (getuid ());
if (pw)
homedir = pw->pw_dir;
#endif
......@@ -283,7 +283,7 @@ mailbox_create_default (mailbox_t *pmbox, const char *mail)
if (user == NULL)
{
struct passwd *pw;
pw = getpwuid (getuid ());
pw = mu_getpwuid (getuid ());
if (pw)
user = pw->pw_name;
else
......
......@@ -925,7 +925,7 @@ message_sender (envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
{
struct passwd *pw;
const char *sender;
pw = getpwuid (getuid ());
pw = mu_getpwuid (getuid ());
sender = (pw) ? pw->pw_name : "unknown";
n = strlen (sender);
if (buf && len > 0)
......
......@@ -621,7 +621,7 @@ get_from (message_t msg, char *localhost, address_t *pmail_from)
/* If it's not in the header create one form the passwd. */
if (status != 0 || size == 0)
{
struct passwd *pwd = getpwuid (getuid ());
struct passwd *pwd = mu_getpwuid (getuid ());
/* Not in the passwd ???? We have a problem. */
if (pwd == 0 || pwd->pw_name == NULL)
{
......
......@@ -397,7 +397,7 @@ get_user (url_t url, const char *filename, char **user)
}
else
{
struct passwd *pw = getpwuid (getuid ());
struct passwd *pw = mu_getpwuid (getuid ());
if (pw && pw->pw_name)
{
u = strdup (pw->pw_name);
......
......@@ -254,7 +254,7 @@ mu_get_homedir (void)
{
struct passwd *pwd;
pwd = getpwuid (getuid ());
pwd = mu_getpwuid (getuid ());
if (!pwd)
return NULL;
homedir = pwd->pw_dir;
......