httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mladen Turk" <mt...@mappingsoft.com>
Subject RE: [REWRITE] htpasswd+htdbm+dbmmange
Date Tue, 06 Nov 2001 19:17:45 GMT
> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@covalent.net]
> Sent: Tuesday, November 06, 2001 5:30 PM
> To: dev@httpd.apache.org
> Subject: Re: [REWRITE] htpasswd+htdbm+dbmmange
>
>
> From: "Mladen Turk" <mturk@mappingsoft.com>
> Sent: Friday, October 12, 2001 2:15 PM
>
>
> > Hi,
> >
> > Some rewrite and some new stuffs.
> >
> > 1. htpasswd.c
> > a) uses the same command line options as old one
> > b) the default is MD5 on all platforms
> > c) has tree new options: list, delete and verify(check)
>
> I'd commented on this once before, it was too major of an
> overhaul to follow
> in cvs versioning.  I didn't (don't) see the need for such an
> extensive rewrite.
>

Well, after all, It's a rewrite. I don't think that the new version of
software must look like the old one except from the user perspective. It's
some times easier to build the things from ground-up then messing with
someone other code. APR-izing the old htpasswd isn't such a big deal now
that we have apr_mktemp, but as you noticed I've tried to introduce a new
concept to user/group management.

> > 2. htdbm.c
> > a) same syntax as htpasswd but manages DBM databases
> > b) has additional option for comments
> >
> > 3. dbmmange.c
> > a) replaces in a way the dbmmanage.pl
> > b) uses the apr-util's DBM
>
>
>   1. changes to stdout?  I don't get it.  If we must, let's use
> file name '-' as
>      many unix utilities do.

Same syntax from htpasswd...

>
>   2. -r makes more sense for remove (-d being taken already.)

Just change the the switch...

>   3. the code is rather, well, dirty, from the perspective that
> we overload this
>      htdbm.c with all of the trappings of an extension library.
> I'm absolutly -1
>      on this approach.  If you want to create an ap_htdbm.c
> library, and link it
>      to htdbm.c (using that api) then fine.

That was my thoughts in general. If you look at the code the htpasswd, htdbm
and htxml utilities main() functions differentiates very little from each
other (mostly command param options parsing).
All that can easily go to a library as in fact does for my GUI user/group
management tool.

>   4. you forgot such bits as initializing apr, the pool, etc.
> I'm already experimenting,
>      and happy to clean those up (such as using apr_getopt, etc,
> to shrink the code, using
>      a single char*username rather than the int gave_username
> approach, etc.)

Take a second look :-)
apu_xxxx_init calls the apr_initialize (APU_XXXX_STANDALONE flag).

You cannot use the apr_getopt and be backward compatible with the htpasswd
for example, because the old one can have "-bc" or "-b -c" as valid params
and using apr_getopt the valid ones are only "-b -c"...

>   5. groups and comments are an essential part of dbm management
> (and a key attraction)
>      for many users.  Again, I'm happy to round that out.

htdbm can easily manage comments (the -t option).
groups can be managed using plain encryption and using comma separated group
names instead password, but I agree that this can be done more user
friendly.

MT.


Mime
View raw message