Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r--winsup/cygwin/cygheap.h132
1 files changed, 3 insertions, 129 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index c4b2ed9ad..164a87090 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -1,7 +1,7 @@
/* cygheap.h: Cygwin heap manager.
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011, 2012, 2013, 2014 Red Hat, Inc.
+ 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -11,7 +11,6 @@ details. */
#include "hires.h"
#include "cygheap_malloc.h"
-#include "pwdgrp.h"
#define incygheap(s) (cygheap && ((char *) (s) >= (char *) cygheap) && ((char *) (s) <= ((char *) cygheap_max)))
@@ -156,8 +155,8 @@ public:
}
void set_sid (PSID new_sid) { effec_cygsid = new_sid;}
void set_saved_sid () { saved_cygsid = effec_cygsid; }
- cygpsid &sid () { return effec_cygsid; }
- cygpsid &saved_sid () { return saved_cygsid; }
+ PSID sid () { return effec_cygsid; }
+ PSID saved_sid () { return saved_cygsid; }
const char *ontherange (homebodies what, struct passwd * = NULL);
#define NO_IMPERSONATION NULL
bool issetuid () const { return curr_imp_token != NO_IMPERSONATION; }
@@ -356,128 +355,6 @@ struct user_heap_info
void __reg1 init ();
};
-class cygheap_domain_info
-{
- PWCHAR pdom_name;
- PWCHAR pdom_dns_name;
- cygsid pdom_sid;
-
- PWCHAR adom_name;
- cygsid adom_sid;
-
- PDS_DOMAIN_TRUSTSW tdom;
- ULONG tdom_count;
-
- PWCHAR rfc2307_domain_buf;
-
-public:
- ULONG lowest_tdo_posix_offset;
-
- bool init ();
-
- inline PCWSTR primary_flat_name () const { return pdom_name; }
- inline PCWSTR primary_dns_name () const { return pdom_dns_name; }
- inline cygsid &primary_sid () { return pdom_sid; }
-
- inline bool member_machine () const { return pdom_sid != NO_SID; }
-
- inline PCWSTR account_flat_name () const { return adom_name; }
- inline cygsid &account_sid () { return adom_sid; }
-
- inline PDS_DOMAIN_TRUSTSW trusted_domain (ULONG idx) const
- { return (idx < tdom_count) ? tdom + idx : NULL; }
-
- inline PWCHAR get_rfc2307_domain () const
- { return rfc2307_domain_buf ?: NULL; }
-};
-
-class cygheap_pwdgrp
-{
- static const int NSS_FILES = 1;
- static const int NSS_DB = 2;
- enum pfx_t {
- NSS_AUTO = 0,
- NSS_PRIMARY,
- NSS_ALWAYS
- };
- bool nss_inited;
- int pwd_src;
- int grp_src;
- pfx_t prefix;
- WCHAR separator[2];
- bool caching;
- int enums;
- PWCHAR enum_tdoms;
-
- void nss_init_line (const char *line);
- void _nss_init ();
-
-public:
- struct {
- pwdgrp cygserver;
- pwdgrp file;
- pwdgrp win;
- } pwd_cache;
- struct {
- pwdgrp cygserver;
- pwdgrp file;
- pwdgrp win;
- } grp_cache;
-
- void init ();
-
- inline void nss_init () { if (!nss_inited) _nss_init (); }
- inline bool nss_pwd_files () const { return !!(pwd_src & NSS_FILES); }
- inline bool nss_pwd_db () const { return !!(pwd_src & NSS_DB); }
- inline bool nss_grp_files () const { return !!(grp_src & NSS_FILES); }
- inline bool nss_grp_db () const { return !!(grp_src & NSS_DB); }
- inline bool nss_prefix_auto () const { return prefix == NSS_AUTO; }
- inline bool nss_prefix_primary () const { return prefix == NSS_PRIMARY; }
- inline bool nss_prefix_always () const { return prefix == NSS_ALWAYS; }
- inline PCWSTR nss_separator () const { return separator; }
- inline bool nss_cygserver_caching () const { return caching; }
- inline void nss_disable_cygserver_caching () { caching = false; }
- inline int nss_db_enums () const { return enums; }
- inline PCWSTR nss_db_enum_tdoms () const { return enum_tdoms; }
-};
-
-class cygheap_ugid_cache
-{
- struct idmap {
- uint32_t nfs_id;
- uint32_t cyg_id;
- };
- class idmaps {
- uint32_t _cnt;
- uint32_t _max;
- idmap *_map;
- public:
- uint32_t get (uint32_t id) const
- {
- for (uint32_t i = 0; i < _cnt; ++i)
- if (_map[i].nfs_id == id)
- return _map[i].cyg_id;
- return (uint32_t) -1;
- }
- void add (uint32_t nfs_id, uint32_t cyg_id)
- {
- if (_cnt >= _max)
- _map = (idmap *) crealloc (_map, (_max += 10) * sizeof (*_map));
- _map[_cnt].nfs_id = nfs_id;
- _map[_cnt].cyg_id = cyg_id;
- ++_cnt;
- }
- };
- idmaps uids;
- idmaps gids;
-
-public:
- uid_t get_uid (uid_t uid) const { return uids.get (uid); }
- gid_t get_gid (gid_t gid) const { return gids.get (gid); }
- void add_uid (uid_t nfs_uid, uid_t cyg_uid) { uids.add (nfs_uid, cyg_uid); }
- void add_gid (gid_t nfs_gid, gid_t cyg_gid) { gids.add (nfs_gid, cyg_gid); }
-};
-
struct hook_chain
{
void **loc;
@@ -501,9 +378,6 @@ struct init_cygheap: public mini_cygheap
UNICODE_STRING installation_key;
WCHAR installation_key_buf[18];
cygheap_root root;
- cygheap_domain_info dom;
- cygheap_pwdgrp pg;
- cygheap_ugid_cache ugid_cache;
cygheap_user user;
user_heap_info user_heap;
mode_t umask;