diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-11-20 20:10:05 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-11-20 20:10:05 +0300 |
commit | 647b92a7d420bee9244054947379f026d105def8 (patch) | |
tree | b6789b659745a0a709f4a1847036c2b0b34ff606 /winsup/cygwin/security.h | |
parent | 3a366b12f692fdfa5aeb8e7c603faa917d786011 (diff) |
* security.h: Declare internal_getpwsid and internal_getgrsid.
Undeclare internal_getpwent. Define DEFAULT_UID_NT. Change
DEFAULT_GID.
* passwd.cc (internal_getpwsid): New function.
(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.
(internal_getgrsid): New function.
(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
to /etc/passwd. Change some debug_printf.
Diffstat (limited to 'winsup/cygwin/security.h')
-rw-r--r-- | winsup/cygwin/security.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 1bc498b99..2952d8ece 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -11,7 +11,8 @@ details. */ #include <accctrl.h> #define DEFAULT_UID DOMAIN_USER_RID_ADMIN -#define DEFAULT_GID DOMAIN_ALIAS_RID_ADMINS +#define DEFAULT_UID_NT 400 /* Non conflicting number */ +#define DEFAULT_GID 401 #define MAX_SID_LEN 40 #define MAX_DACL_LEN(n) (sizeof (ACL) \ @@ -203,11 +204,12 @@ extern BOOL allow_ntea; extern BOOL allow_ntsec; extern BOOL allow_smbntsec; -/* These both functions are needed to allow walking through the passwd +/* These functions are needed to allow walking through the passwd and group lists so they are somehow security related. Besides that I didn't find a better place to declare them. */ -extern struct passwd *internal_getpwent (int); extern struct __group32 *internal_getgrent (int); +extern struct passwd *internal_getpwsid (cygsid &); +extern struct __group32 *internal_getgrsid (cygsid &); /* File manipulation */ int __stdcall set_process_privileges (); |