[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freeipmi-devel] 0.3.1 release w/ BSD port?
From: |
Dmitry Frolov |
Subject: |
Re: [Freeipmi-devel] 0.3.1 release w/ BSD port? |
Date: |
Thu, 7 Dec 2006 12:29:11 +0600 |
User-agent: |
Mutt/1.5.11 |
* Al Chu <address@hidden> [07.12.2006 00:50]:
> > This is a bug. Thanks for helping us find it. In your case your home
> > dir of user "vcr" is not writable. So it opts for /tmp/.freeipmi-vcr
> > dir which already exist. Bug is, if it already exist, it should be
> > re-used. Instead it returns error. Bala is fixing it. We will make a
> > quick new release of this branch.
>
> If Dmitry is close/semi-close to finishg up the port patch, perhaps we
> can release it and this fix together?
>
> Dmitry?
Preliminary patch, that includes fixes for these problems is here:
ftp://ftp.riss-telecom.ru/pub/patches/freeipmi-0.3.0-fbsd3.diff
But I want Tejram to test this patch before it may be committed. I sent
him the new test port for this.
The _get_home_directory() part for Your review:
--- ../freeipmi-0.3.0/common/src/ipmi-sdr-api.c Mon Nov 6 23:24:34 2006
+++ ./common/src/ipmi-sdr-api.c Thu Dec 7 00:49:00 2006
@@ -165,12 +165,25 @@ _get_home_directory ()
uid_t user_id;
struct passwd *user_passwd = alloca (sizeof (*user_passwd));
char *home_dir = NULL;
- long int buf_len = sysconf (_SC_GETPW_R_SIZE_MAX);
- char *buf = alloca (buf_len);
+ long int buf_len;
+ char *buf;
+
+#if defined(_SC_GETPW_R_SIZE_MAX)
+ buf_len = sysconf(_SC_GETPW_R_SIZE_MAX);
+ if (buf_len < 0)
+ /* Variable was not implemented */
+#endif
+ buf_len = 1024; /* XXX */
+ buf = alloca (buf_len);
user_id = getuid ();
if (getpwuid_r (user_id, user_passwd, buf, buf_len, &user_passwd) != 0)
return NULL;
+ if (user_passwd == NULL) {
+ /* User not found */
+ errno = ENOENT;
+ return NULL;
+ }
if (user_passwd->pw_dir)
{
@@ -184,7 +197,8 @@ _get_home_directory ()
"/tmp/.%s-%s",
PACKAGE_NAME,
user_passwd->pw_name);
- if (mkdir (home_dir, FREEIPMI_CONFIG_DIRECTORY_MODE) == 0)
+ if (mkdir (home_dir, FREEIPMI_CONFIG_DIRECTORY_MODE) == 0 ||
+ errno == EEXIST)
return home_dir;
free (home_dir);
>
> Al
>
> --
> Albert Chu
> address@hidden
> 925-422-5311
> Computer Scientist
> High Performance Systems Division
> Lawrence Livermore National Laboratory
wbr&w, dmitry.
--
Dmitry Frolov <address@hidden>
RISS-Telecom Network, Novosibirsk, Russia
address@hidden, +7 383 2278800, DVF-RIPE
- [Freeipmi-devel] 0.3.1 release w/ BSD port?, Al Chu, 2006/12/06
- Re: [Freeipmi-devel] 0.3.1 release w/ BSD port?,
Dmitry Frolov <=
- [Freeipmi-devel] Re: freeipmi-0_3_0-sdr-cache-fix.diff, Anand Babu, 2006/12/08
- Re: [Freeipmi-devel] 0.3.1 release w/ BSD port?, Dmitry Frolov, 2006/12/11
- Re: [Freeipmi-devel] 0.3.1 release w/ BSD port?, Al Chu, 2006/12/12
- [Freeipmi-devel] 0.3.1 ready?, Al Chu, 2006/12/13
- Re: [Freeipmi-devel] 0.3.1 ready?, Anand Babu, 2006/12/13
- Re: [Freeipmi-devel] 0.3.1 ready?, Dmitry Frolov, 2006/12/13
- Re: [Freeipmi-devel] 0.3.1 ready?, Al Chu, 2006/12/13
- Re: [Freeipmi-devel] 0.3.1 ready?, Al Chu, 2006/12/15
- Re: [Freeipmi-devel] 0.3.1 ready?, Dmitry Frolov, 2006/12/16
- Re: [Freeipmi-devel] 0.3.1 ready?, Anand Babu, 2006/12/16