This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ntsec patch #4: passwd and group


Corinna,

Almost same as last week, but with the diff and ChangeLog against current CVS.
I also made a small change.

Pierre

At 09:52 AM 11/15/2002 -0500, Pierre A. Humblet wrote:
>Corinna,
>
>Here is the ntsec patch #4 diff. As discussed before, the main motivation
>was to handle more robustly incomplete passwd and group files.
>In the process I fixed some bugs in related code and added
>getpwsid and getgrsid.
>
>This does not try to completely address the issue of invalid pointers
>after a re-read of passwd and group, that will be for later.
>
>Note that there is a small bug fix in the getgroup32 code from
>yesterday and some streamlining in is_grp_member.

(bug is already fixed in CVS)


2002/11/18  Pierre Humblet  <pierre.humblet@ieee.org>

	* security.h: Declare getpwsid and getgrsid. Undeclare 
	internal_getpwent. Define DEFAULT_UID_NT. Change DEFAULT_GID.
	* passwd.cc (getpwsid): Create.
	(internal_getpwent): Suppress.
	(read_etc_passwd): Make static. Rewrite the code for the completion
	line. Set curr_lines to 0.
	(parse_pwd): Change type to static int. Return 0 for short lines.
	(add_pwd_line): Pay attention to the value of parse_pwd.     
	(search_for): Do not look for nor return the DEFAULT_UID.
	* grp.cc (read_etc_group): Make static. Free gr_mem and set 
	curr_lines to 0. Always call add_pwd_line. Rewrite the code for the 
	completion line.
	(parse_grp): If grp.gr_mem is empty, set it to &null_ptr.
	Never NULL gr_passwd. 
	(getgrgid32): Only return the default if ntsec is off and the gid is 
	ILLEGAL_GID.
	* sec_helper.cc (cygsid::get_id): Use getpwsid and getgrsid;
	(cygsid_getfrompw): Clean up last line.
	(cygsid_getfromgr): Ditto.
	(is_grp_member): Use getpwuid32 and getgrgid32.
	* uinfo.cc (internal_getlogin): Set DEFAULT_GID at start.
	Use getpwsid. Move the read of /etc/group after the second access 
	of /etc/passwd. Change some debug_printf. 

Attachment: pwd.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]