diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2002-08-05 01:35:38 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2002-08-05 01:35:38 +0000 |
commit | 3dd6cc0adff72adba0f32cd4313c3e59b45c5aa0 (patch) | |
tree | 81a15f1c398dc61353ef5013f01c3bc340aea6ef | |
parent | aade88821af534624b3ae5c46ad63c6c33cfc235 (diff) |
2002-08-05 Marcus Brinkmann <marcus@gnu.org>
* proxy-defpager.c (allowed): Check CRED, not PORT.
(default_pager_info): Use real_defpager, not DEFAULT_PAGER.
(proxy_defpager_demuxer): New demuxer.
(main): Use it.
-rw-r--r-- | trans/ChangeLog | 7 | ||||
-rw-r--r-- | trans/proxy-defpager.c | 17 |
2 files changed, 21 insertions, 3 deletions
diff --git a/trans/ChangeLog b/trans/ChangeLog index 75b136b2..2f50c789 100644 --- a/trans/ChangeLog +++ b/trans/ChangeLog @@ -1,3 +1,10 @@ +2002-08-05 Marcus Brinkmann <marcus@gnu.org> + + * proxy-defpager.c (allowed): Check CRED, not PORT. + (default_pager_info): Use real_defpager, not DEFAULT_PAGER. + (proxy_defpager_demuxer): New demuxer. + (main): Use it. + 2002-06-14 Roland McGrath <roland@frob.com> * proxy-defpager.c: New file. diff --git a/trans/proxy-defpager.c b/trans/proxy-defpager.c index d4c8d753..24671c81 100644 --- a/trans/proxy-defpager.c +++ b/trans/proxy-defpager.c @@ -33,7 +33,7 @@ allowed (mach_port_t port, int mode) { struct trivfs_protid *cred = ports_lookup_port (0, port, trivfs_protid_portclasses[0]); - if (port == 0) + if (!cred) return MIG_BAD_ID; error_t result = (cred->po->openmodes & mode) ? 0 : EACCES; ports_port_deref (cred); @@ -53,7 +53,7 @@ kern_return_t default_pager_info (mach_port_t default_pager, default_pager_info_t *info) { return allowed (default_pager, O_READ) - ?: default_pager_info (default_pager, info); + ?: default_pager_info (real_defpager, info); } kern_return_t @@ -215,6 +215,16 @@ Access to control interfaces of Mach default pager.\n\ This translator should normally be set on " _SERVERS_DEFPAGER "."}; int +proxy_defpager_demuxer (mach_msg_header_t *inp, + mach_msg_header_t *outp) +{ + extern int default_pager_server (mach_msg_header_t *, mach_msg_header_t *); + + return default_pager_server (inp, outp) + || trivfs_demuxer (inp, outp); +} + +int main (int argc, char **argv) { error_t err; @@ -248,7 +258,8 @@ main (int argc, char **argv) error (4, err, "Contacting parent"); /* Launch. */ - ports_manage_port_operations_multithread (fsys->pi.bucket, trivfs_demuxer, + ports_manage_port_operations_multithread (fsys->pi.bucket, + proxy_defpager_demuxer, 2 * 60 * 1000, 0, 0); return 0; |