[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comments on LDAP support in heimdal



> Yes, it would, but there is backward compatiblity code in there to make it
> work with older configurations. How about this patch ?

Looks like it would solve the immediate problem.  I'll give it a shot
tomorrow sometime.

> How about this for now ?
>
>         p = strrchr(dbname, '.');
>         if(p == NULL)
>           asprintf(variable, "%s/%s.%s", HDB_DB_DIR, dbname, ext);
>         else
>           asprintf(variable, "%s/%.*s.%s",
>                    HDB_DB_DIR, (int)(p - dbname), dbname, ext);

Definately better, but there's the (rare?) potentional for name conflicts
(e.g., dbname=ldap:o=company.com and dbname=ldap:o=company.org would map to
the same filenames, since this code would treat the final domain component
as an extension and strip it off).

One could simply stop stripping off the final extension (so if
dbname=/var/heimdal/mydomain.db, then log_file would default to
/var/heimdal/mydomain.db.log).  The default filename would always be:

          asprintf(variable, "%s/%s.%s", HDB_DB_DIR, dbname, ext);

Would this break anything?  It seems simpler.

-- Lars