[Top][All Lists]

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

RE: user.c, user.h

From: Andrey Aristarkhov
Subject: RE: user.c, user.h
Date: Wed, 14 Aug 2002 12:29:47 +0400

> -----Original Message-----
> From: Derek Robert Price [mailto:derek@ximbiot.com]
> Sent: Tuesday, August 13, 2002 11:37 PM
> To: Andrey Aristarkhov
> Cc: bug-cvs@gnu.org
> Subject: Re: user.c, user.h
> Texinfo, the TeX wrapper the CVS documentation uses is prety
> straightforward.  If you ignore some of the setup stuff at the
> beginning, then it's mostly simple text tags.  You might need to know
> how to declare a new `node' (chapter/section) or add index entries,
> you should be able to get that by scanning what's already in
> cvs.texinfo.  Other useful tags are @code{}, @file{}, and @strong{}
> block quote type effects, @sc{cvs} as the name of the application
> discussion, and @pxref{} and @xref{} for cross references to other
> nodes, but like I said, you should be able to get most of it by
> the file.  You don't have to get everything right the first time
>  If I check it in I'll review it and tidy up as long as most of the
> important data is there.
Thanks, it will help.

> >>Oops, I almost missed getpwpath().  I deleted your code already, but
> >>there is already a construct_cvspass_filename() function in
> >>
> >>
> >as
> >
> >
> >>well.
> >>
> >>
> >construct_cvspass_filename() constructs path to user's password file.
> >{set,get}pwpath functions is used to store path to CVSROOT/passwd
> >
> >
> Yep, you're right.  Sorry about that.  I like your abstraction and I'm
> tempted to say it should be in root.c or the like and extended for all
> admin files (e.g. get_repository_admin_file(root, CVSROOTADM_PASSWD))
> simply because all those sprintf("%s/%s/%s",...)'s that litter the
> look messy and don't necessarily remain portable across OSs, but I'm
> hardly going to require that for acceptance of this patch.
I agree with you. I can write the function in root.c.

> >>Again, much of this happens in `server.c'.  Please reuse code.  And
> >>unless I'm mistaken, this asks for the admin password - that
> >>be happening.  If the user is an administrator they should already
> >>
> >>
> >>authenticated.
> >>
> >>
> >I've investigated server.c and login.c before writing this code.
> >is no reusable code over there.
> >
> Sorry.  It's your get_password() function that duplicates code, but I
> already mentioned that.
My suggestion is place get_password(char * username, char *
passpwd_file) as a common function and reuse it in user.c, login.c and
server.c, since it has the same logic for .cvspass and CVSROOT/passwd.
Function get_alias also could be placed in server.c and reused.

> >The only thing I've taken from login.c
> >is GETPASS macro definition. Suppose it should be placed in cvs.h
> >file.
> >
> >
> I missed that GETPASS was from login.c.  `cvs.h' might be an
> place.  Maybe a new `user.h' or `subr.h' would be more appropriate.
I think user.h is more suitable place.

> Sorry yet again.  I think I misread:
> >3. User's password can be changed either by CVS Administrator or by a
> >person who knows current user's CVS password.
> >
> >
> to mean that a non-admin user specifying another username could change
> the password if they knew the user's password, which isn't like any
> I've used.  But it sounds like you did it Right (tm).
I try to explain why I have done it in this way. User can work with
repository in local and server mode. In a server mode there is no
problem to detect current user name, but it's not possible in local mode
- only the caller principal can be detected.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]