diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-02-25 11:25:17 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-02-25 11:25:17 +0100 |
commit | 7416842c91cbfe9f8e64d4f132ef99709933375e (patch) | |
tree | 6fdb694263dd55461f8bd2bdd63649119790edc8 /debian/patches | |
parent | afee2d85a0855fd87203b005e51ee68408e9cbbf (diff) |
drop merged patches
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/diskfs-fix-fsys-receiver-lookups.patch | 400 | ||||
-rw-r--r-- | debian/patches/fix-get-children-source.patch | 1097 | ||||
-rw-r--r-- | debian/patches/netfs-fix-fsys-receiver-lookups.patch | 264 | ||||
-rw-r--r-- | debian/patches/series | 4 |
4 files changed, 0 insertions, 1765 deletions
diff --git a/debian/patches/diskfs-fix-fsys-receiver-lookups.patch b/debian/patches/diskfs-fix-fsys-receiver-lookups.patch deleted file mode 100644 index b2c265fc..00000000 --- a/debian/patches/diskfs-fix-fsys-receiver-lookups.patch +++ /dev/null @@ -1,400 +0,0 @@ -commit 7e43d4030786ee13e791ad944c93256054e5f34b -Author: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Wed Jan 29 14:06:15 2014 +0100 - - libdiskfs: fix receiver lookups in fsys server functions - - * libdiskfs/diskfs.h (struct diskfs_control): New declaration. - (diskfs_begin_using_control_port): New declaration and function. - (diskfs_end_using_control_port): Likewise. - * libdiskfs/fsmutations.h: Add translation functions. - * libdiskfs/priv.h (control_t): New type declaration for mig. - * libdiskfs/boot-start.c: Fix receiver lookups. - * libdiskfs/fsys-getfile.c: Likewise. - * libdiskfs/fsys-getroot.c: Likewise. - * libdiskfs/fsys-goaway.c: Likewise. - * libdiskfs/fsys-options.c: Likewise. - * libdiskfs/fsys-syncfs.c: Likewise. - -diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c -index 05d3b43..7b8a84f 100644 ---- a/libdiskfs/boot-start.c -+++ b/libdiskfs/boot-start.c -@@ -426,17 +426,16 @@ diskfs_execboot_fsys_startup (mach_port_t port, int flags, - /* Called by init to get the privileged ports as described - in <hurd/fsys.defs>. */ - kern_return_t --diskfs_S_fsys_getpriv (mach_port_t port, -+diskfs_S_fsys_getpriv (struct diskfs_control *init_bootstrap_port, - mach_port_t reply, mach_msg_type_name_t reply_type, - mach_port_t *host_priv, mach_msg_type_name_t *hp_type, - mach_port_t *dev_master, mach_msg_type_name_t *dm_type, - mach_port_t *fstask, mach_msg_type_name_t *task_type) - { - error_t err; -- struct port_info *init_bootstrap_port = -- ports_lookup_port (diskfs_port_bucket, port, diskfs_initboot_class); - -- if (!init_bootstrap_port) -+ if (!init_bootstrap_port -+ || init_bootstrap_port->pi.class != diskfs_initboot_class) - return EOPNOTSUPP; - - err = get_privileged_ports (host_priv, dev_master); -@@ -447,20 +446,17 @@ diskfs_S_fsys_getpriv (mach_port_t port, - *task_type = MACH_MSG_TYPE_COPY_SEND; - } - -- ports_port_deref (init_bootstrap_port); -- - return err; - } - - /* Called by init to give us ports to the procserver and authserver as - described in <hurd/fsys.defs>. */ - kern_return_t --diskfs_S_fsys_init (mach_port_t port, -+diskfs_S_fsys_init (struct diskfs_control *pt, - mach_port_t reply, mach_msg_type_name_t replytype, - mach_port_t procserver, - mach_port_t authhandle) - { -- struct port_info *pt; - static int initdone = 0; - mach_port_t host, startup; - error_t err; -@@ -468,10 +464,10 @@ diskfs_S_fsys_init (mach_port_t port, - struct protid *rootpi; - struct peropen *rootpo; - -- pt = ports_lookup_port (diskfs_port_bucket, port, diskfs_initboot_class); -- if (!pt) -+ if (!pt -+ || pt->pi.class != diskfs_initboot_class) - return EOPNOTSUPP; -- ports_port_deref (pt); -+ - if (initdone) - return EOPNOTSUPP; - initdone = 1; -diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h -index db6a1d8..359b11b 100644 ---- a/libdiskfs/diskfs.h -+++ b/libdiskfs/diskfs.h -@@ -121,6 +121,11 @@ struct node - int author_tracks_uid; - }; - -+struct diskfs_control -+{ -+ struct port_info pi; -+}; -+ - /* Possibly lookup types for diskfs_lookup call */ - enum lookup_type - { -@@ -795,8 +800,10 @@ error_t diskfs_start_protid (struct peropen *po, struct protid **cred); - void diskfs_finish_protid (struct protid *cred, struct iouser *user); - - extern struct protid * diskfs_begin_using_protid_port (file_t port); -+extern struct diskfs_control * diskfs_begin_using_control_port (fsys_t port); - - extern void diskfs_end_using_protid_port (struct protid *cred); -+extern void diskfs_end_using_control_port (struct diskfs_control *cred); - - #if defined(__USE_EXTERN_INLINES) || defined(DISKFS_DEFINE_EXTERN_INLINE) - -@@ -809,6 +816,13 @@ diskfs_begin_using_protid_port (file_t port) - return ports_lookup_port (diskfs_port_bucket, port, diskfs_protid_class); - } - -+/* And for the fsys interface. */ -+DISKFS_EXTERN_INLINE struct diskfs_control * -+diskfs_begin_using_control_port (fsys_t port) -+{ -+ return ports_lookup_port (diskfs_port_bucket, port, NULL); -+} -+ - /* Called by MiG after server routines have been run; this - balances begin_using_protid_port, and is arranged for the io - and fs interfaces by fsmutations.h. */ -@@ -819,6 +833,14 @@ diskfs_end_using_protid_port (struct protid *cred) - ports_port_deref (cred); - } - -+/* And for the fsys interface. */ -+DISKFS_EXTERN_INLINE void -+diskfs_end_using_control_port (struct diskfs_control *cred) -+{ -+ if (cred) -+ ports_port_deref (cred); -+} -+ - #endif /* Use extern inlines. */ - - /* Called when a protid CRED has no more references. (Because references\ -diff --git a/libdiskfs/fsmutations.h b/libdiskfs/fsmutations.h -index 5026810..68b6ae3 100644 ---- a/libdiskfs/fsmutations.h -+++ b/libdiskfs/fsmutations.h -@@ -23,6 +23,9 @@ - #define IO_INTRAN protid_t diskfs_begin_using_protid_port (io_t) - #define IO_DESTRUCTOR diskfs_end_using_protid_port (protid_t) - -+#define FSYS_INTRAN control_t diskfs_begin_using_control_port (fsys_t) -+#define FSYS_DESTRUCTOR diskfs_end_using_control_port (control_t) -+ - #define FILE_IMPORTS import "priv.h"; - #define IO_IMPORTS import "priv.h"; - #define FSYS_IMPORTS import "priv.h"; -diff --git a/libdiskfs/fsys-getfile.c b/libdiskfs/fsys-getfile.c -index 2fe9495..9dd5d73 100644 ---- a/libdiskfs/fsys-getfile.c -+++ b/libdiskfs/fsys-getfile.c -@@ -27,7 +27,7 @@ - /* Return in FILE & FILE_TYPE the file in FSYS corresponding to the NFS file - handle HANDLE & HANDLE_LEN. */ - error_t --diskfs_S_fsys_getfile (mach_port_t fsys, -+diskfs_S_fsys_getfile (struct diskfs_control *pt, - mach_port_t reply, mach_msg_type_name_t reply_type, - uid_t *uids, mach_msg_type_number_t nuids, - gid_t *gids, mach_msg_type_number_t ngids, -@@ -41,15 +41,13 @@ diskfs_S_fsys_getfile (mach_port_t fsys, - struct protid *new_cred; - struct peropen *new_po; - struct iouser *user; -- struct port_info *pt = -- ports_lookup_port (diskfs_port_bucket, fsys, diskfs_control_class); - -- if (!pt) -+ if (!pt -+ || pt->pi.class != diskfs_control_class) - return EOPNOTSUPP; - - if (handle_len != sizeof *f) - { -- ports_port_deref (pt); - return EINVAL; - } - -@@ -58,14 +56,12 @@ diskfs_S_fsys_getfile (mach_port_t fsys, - err = diskfs_cached_lookup (f->data.cache_id, &node); - if (err) - { -- ports_port_deref (pt); - return err; - } - - if (node->dn_stat.st_gen != f->data.gen) - { - diskfs_nput (node); -- ports_port_deref (pt); - return ESTALE; - } - -@@ -73,7 +69,6 @@ diskfs_S_fsys_getfile (mach_port_t fsys, - if (err) - { - diskfs_nput (node); -- ports_port_deref (pt); - return err; - } - -@@ -98,7 +93,6 @@ diskfs_S_fsys_getfile (mach_port_t fsys, - iohelp_free_iouser (user); - - diskfs_nput (node); -- ports_port_deref (pt); - - if (! err) - { -diff --git a/libdiskfs/fsys-getroot.c b/libdiskfs/fsys-getroot.c -index 85e1167..5212214 100644 ---- a/libdiskfs/fsys-getroot.c -+++ b/libdiskfs/fsys-getroot.c -@@ -26,7 +26,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - - /* Implement fsys_getroot as described in <hurd/fsys.defs>. */ - kern_return_t --diskfs_S_fsys_getroot (fsys_t controlport, -+diskfs_S_fsys_getroot (struct diskfs_control *pt, - mach_port_t reply, - mach_msg_type_name_t replytype, - mach_port_t dotdot, -@@ -40,8 +40,6 @@ diskfs_S_fsys_getroot (fsys_t controlport, - file_t *returned_port, - mach_msg_type_name_t *returned_port_poly) - { -- struct port_info *pt = ports_lookup_port (diskfs_port_bucket, controlport, -- diskfs_control_class); - error_t err = 0; - mode_t type; - struct protid *newpi; -@@ -55,7 +53,8 @@ diskfs_S_fsys_getroot (fsys_t controlport, - path: NULL, - }; - -- if (!pt) -+ if (!pt -+ || pt->pi.class != diskfs_control_class) - return EOPNOTSUPP; - - flags &= O_HURD; -@@ -200,8 +199,6 @@ diskfs_S_fsys_getroot (fsys_t controlport, - pthread_mutex_unlock (&diskfs_root_node->lock); - pthread_rwlock_unlock (&diskfs_fsys_lock); - -- ports_port_deref (pt); -- - drop_idvec (); - - return err; -diff --git a/libdiskfs/fsys-goaway.c b/libdiskfs/fsys-goaway.c -index 2aabce8..b910387 100644 ---- a/libdiskfs/fsys-goaway.c -+++ b/libdiskfs/fsys-goaway.c -@@ -25,16 +25,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - - /* Implement fsys_goaway as described in <hurd/fsys.defs>. */ - error_t --diskfs_S_fsys_goaway (fsys_t controlport, -+diskfs_S_fsys_goaway (struct diskfs_control *pt, - mach_port_t reply, - mach_msg_type_name_t reply_type, - int flags) - { -- struct port_info *pt = ports_lookup_port (diskfs_port_bucket, controlport, -- diskfs_control_class); - error_t ret; - -- if (!pt) -+ if (!pt -+ || pt->pi.class != diskfs_control_class) - return EOPNOTSUPP; - - /* XXX FSYS_GOAWAY_NOWAIT not implemented. */ -@@ -48,6 +47,5 @@ diskfs_S_fsys_goaway (fsys_t controlport, - exit (0); - } - -- ports_port_deref (pt); - return ret; - } -diff --git a/libdiskfs/fsys-options.c b/libdiskfs/fsys-options.c -index bb18319..b366d14 100644 ---- a/libdiskfs/fsys-options.c -+++ b/libdiskfs/fsys-options.c -@@ -28,15 +28,13 @@ - - /* Implement fsys_set_options as described in <hurd/fsys.defs>. */ - kern_return_t --diskfs_S_fsys_set_options (fsys_t fsys, -+diskfs_S_fsys_set_options (struct diskfs_control *pt, - mach_port_t reply, - mach_msg_type_name_t replytype, - char *data, mach_msg_type_number_t len, - int do_children) - { - error_t err = 0; -- struct port_info *pt = -- ports_lookup_port (diskfs_port_bucket, fsys, diskfs_control_class); - - error_t - helper (struct node *np) -@@ -60,7 +58,8 @@ diskfs_S_fsys_set_options (fsys_t fsys, - return error; - } - -- if (!pt) -+ if (!pt -+ || pt->pi.class != diskfs_control_class) - return EOPNOTSUPP; - - if (do_children) -@@ -77,13 +76,12 @@ diskfs_S_fsys_set_options (fsys_t fsys, - pthread_rwlock_unlock (&diskfs_fsys_lock); - } - -- ports_port_deref (pt); - return err; - } - - /* Implement fsys_get_options as described in <hurd/fsys.defs>. */ - error_t --diskfs_S_fsys_get_options (fsys_t fsys, -+diskfs_S_fsys_get_options (struct diskfs_control *port, - mach_port_t reply, - mach_msg_type_name_t replytype, - char **data, mach_msg_type_number_t *data_len) -@@ -91,10 +89,9 @@ diskfs_S_fsys_get_options (fsys_t fsys, - char *argz = 0; - size_t argz_len = 0; - error_t err; -- struct port_info *port = -- ports_lookup_port (diskfs_port_bucket, fsys, diskfs_control_class); - -- if (!port) -+ if (!port -+ || port->pi.class != diskfs_control_class) - return EOPNOTSUPP; - - err = argz_add (&argz, &argz_len, program_invocation_name); -@@ -111,6 +108,5 @@ diskfs_S_fsys_get_options (fsys_t fsys, - else - free (argz); - -- ports_port_deref (port); - return err; - } -diff --git a/libdiskfs/fsys-syncfs.c b/libdiskfs/fsys-syncfs.c -index beb8881..4dceed7 100644 ---- a/libdiskfs/fsys-syncfs.c -+++ b/libdiskfs/fsys-syncfs.c -@@ -24,14 +24,12 @@ - - /* Implement fsys_syncfs as described in <hurd/fsys.defs>. */ - kern_return_t --diskfs_S_fsys_syncfs (fsys_t controlport, -+diskfs_S_fsys_syncfs (struct diskfs_control *pi, - mach_port_t reply, - mach_msg_type_name_t replytype, - int wait, - int children) - { -- struct port_info *pi = ports_lookup_port (diskfs_port_bucket, controlport, -- diskfs_control_class); - error_t - helper (struct node *np) - { -@@ -49,7 +47,8 @@ diskfs_S_fsys_syncfs (fsys_t controlport, - return 0; - } - -- if (!pi) -+ if (!pi -+ || pi->pi.class != diskfs_control_class) - return EOPNOTSUPP; - - pthread_rwlock_rdlock (&diskfs_fsys_lock); -@@ -67,8 +66,5 @@ diskfs_S_fsys_syncfs (fsys_t controlport, - } - - pthread_rwlock_unlock (&diskfs_fsys_lock); -- -- ports_port_deref (pi); -- - return 0; - } -diff --git a/libdiskfs/priv.h b/libdiskfs/priv.h -index bd23ab9..b41fa43 100644 ---- a/libdiskfs/priv.h -+++ b/libdiskfs/priv.h -@@ -73,6 +73,7 @@ extern int _diskfs_diskdirty; - - /* Needed for MiG. */ - typedef struct protid *protid_t; -+typedef struct diskfs_control *control_t; - - /* Actually read or write a file. The file size must already permit - the requested access. NP is the file to read/write. DATA is a buffer diff --git a/debian/patches/fix-get-children-source.patch b/debian/patches/fix-get-children-source.patch deleted file mode 100644 index e8789aa7..00000000 --- a/debian/patches/fix-get-children-source.patch +++ /dev/null @@ -1,1097 +0,0 @@ -diff --git a/hurd/fs.defs b/hurd/fs.defs -index 52d83bd..2452682 100644 ---- a/hurd/fs.defs -+++ b/hurd/fs.defs -@@ -352,3 +352,22 @@ routine file_reparent ( - RPT - parent: mach_port_t; - out new_file: mach_port_send_t); -+ -+/* Return any active translators bound to nodes below FILE. CHILDREN -+ is an argz vector containing file names relative to the root of the -+ receiving translator. */ -+routine file_get_children ( -+ file: file_t; -+ RPT -+ out children: data_t); -+ -+/* Return information about the source of FILE. If the concept of a -+ source is applicable, SOURCE should refer to the source of FILE and -+ should be a description considered appropriate in the context of -+ the translator. For example, if FILE refers to a node on a -+ filesystems, SOURCE should be the file name of the underlying block -+ device. */ -+routine file_get_source ( -+ file: file_t; -+ RPT -+ out source: string_t); -diff --git a/hurd/fsys.defs b/hurd/fsys.defs -index 7f99f7f..b36b944 100644 ---- a/hurd/fsys.defs -+++ b/hurd/fsys.defs -@@ -128,21 +128,5 @@ routine fsys_get_options ( - RPT - out options: data_t, dealloc); - --/* Return any active translators bound to nodes of the receiving -- filesystem. CHILDREN is an argz vector containing file names -- relative to the root of the receiving translator. */ --routine fsys_get_children ( -- server: fsys_t; -- RPT -- out children: data_t); -- --/* Return information about the source of the receiving filesystem. -- If the concept of a source is applicable, SOURCE should refer to -- the source of the receiving translator and should be a description -- considered appropriate in the context of the translator. For -- example for the case of block device based filesystems, SOURCE -- should be the file name of the underlying block device. */ --routine fsys_get_source ( -- server: fsys_t; -- RPT -- out source: string_t); -+skip; /* Was fsys_get_children */ -+skip; /* Was fsys_get_source */ -diff --git a/libdiskfs/Makefile b/libdiskfs/Makefile -index 03c2e2b..aeebe4e 100644 ---- a/libdiskfs/Makefile -+++ b/libdiskfs/Makefile -@@ -35,7 +35,7 @@ IOSRCS= io-async-icky.c io-async.c io-duplicate.c io-get-conch.c io-revoke.c \ - io-select.c io-stat.c io-stubs.c io-write.c io-version.c io-sigio.c - FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-startup.c fsys-getfile.c \ - fsys-options.c fsys-syncfs.c fsys-forward.c \ -- fsys-get-children.c fsys-get-source.c -+ file-get-children.c file-get-source.c - IFSOCKSRCS=ifsock.c - OTHERSRCS = conch-fetch.c conch-set.c dir-clear.c dir-init.c dir-renamed.c \ - extern-inline.c \ -diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h -index 22262aa..db6a1d8 100644 ---- a/libdiskfs/diskfs.h -+++ b/libdiskfs/diskfs.h -@@ -569,10 +569,11 @@ error_t (*diskfs_create_symlink_hook)(struct node *np, const char *target); - error_t (*diskfs_read_symlink_hook)(struct node *np, char *target); - - /* The user may define this function. The function must set source to -- the source device of the filesystem. The function may return an -- EOPNOTSUPP to indicate that the concept of a source device is not -- applicable. The default function always returns EOPNOTSUPP. */ --error_t diskfs_get_source (char *source); -+ the source of CRED. The function may return an EOPNOTSUPP to -+ indicate that the concept of a source device is not applicable. The -+ default function always returns EOPNOTSUPP. */ -+error_t diskfs_get_source (struct protid *cred, -+ char *source, size_t source_len); - - /* The library exports the following functions for general use */ - -diff --git a/libdiskfs/file-get-children.c b/libdiskfs/file-get-children.c -new file mode 100644 -index 0000000..4581e4e ---- /dev/null -+++ b/libdiskfs/file-get-children.c -@@ -0,0 +1,95 @@ -+/* file_get_children -+ -+ Copyright (C) 2013 Free Software Foundation, Inc. -+ -+ Written by Justus Winter <4winter@informatik.uni-hamburg.de> -+ -+ This file is part of the GNU Hurd. -+ -+ The GNU Hurd is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ The GNU Hurd is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -+ -+#include "priv.h" -+#include "fs_S.h" -+ -+#include <argz.h> -+ -+/* Return any active translators bound to nodes of the receiving -+ filesystem. CHILDREN is an argz vector containing file names -+ relative to the root of the receiving translator. */ -+error_t -+diskfs_S_file_get_children (struct protid *cred, -+ char **children, -+ mach_msg_type_number_t *children_len) -+{ -+ error_t err; -+ if (! cred -+ || cred->pi.bucket != diskfs_port_bucket -+ || cred->pi.class != diskfs_protid_class) -+ return EOPNOTSUPP; -+ -+ /* check_access performs the same permission check as is normally -+ done, i.e. it checks that all but the last path components are -+ executable by the requesting user and that the last component is -+ readable. */ -+ error_t check_access (const char *path) -+ { -+ error_t err; -+ char *elements = NULL; -+ size_t elements_len = 0; -+ -+ err = argz_create_sep (path, '/', &elements, &elements_len); -+ if (err) -+ return err; -+ -+ struct node *dp = diskfs_root_node; -+ -+ for (char *entry = elements; -+ entry; -+ entry = argz_next (elements, elements_len, entry)) -+ { -+ struct node *next; -+ err = diskfs_lookup (dp, entry, LOOKUP, &next, NULL, cred); -+ -+ if (dp != diskfs_root_node) -+ diskfs_nput (dp); -+ -+ if (err) -+ return err; -+ -+ dp = next; -+ } -+ -+ err = fshelp_access (&dp->dn_stat, S_IRUSR, cred->user); -+ diskfs_nput (dp); -+ return err; -+ } -+ -+ -+ char *c = NULL; -+ size_t c_len = 0; -+ -+ err = fshelp_get_active_translators (&c, &c_len, check_access); -+ if (err) -+ goto errout; -+ -+ err = iohelp_return_malloced_buffer (c, c_len, children, children_len); -+ if (err) -+ goto errout; -+ -+ c = NULL; /* c was freed by iohelp_return_malloced_buffer. */ -+ -+ errout: -+ free (c); -+ return err; -+} -diff --git a/libdiskfs/file-get-source.c b/libdiskfs/file-get-source.c -new file mode 100644 -index 0000000..b5c3184 ---- /dev/null -+++ b/libdiskfs/file-get-source.c -@@ -0,0 +1,37 @@ -+/* file_get_source -+ -+ Copyright (C) 2013 Free Software Foundation, Inc. -+ -+ Written by Justus Winter <4winter@informatik.uni-hamburg.de> -+ -+ This file is part of the GNU Hurd. -+ -+ The GNU Hurd is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ The GNU Hurd is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -+ -+#include "priv.h" -+#include "fs_S.h" -+ -+/* Return information about the source of the receiving -+ filesystem. */ -+error_t -+diskfs_S_file_get_source (struct protid *cred, -+ char *source) -+{ -+ if (! cred -+ || cred->pi.bucket != diskfs_port_bucket -+ || cred->pi.class != diskfs_protid_class) -+ return EOPNOTSUPP; -+ -+ return diskfs_get_source (cred, source, 1024 /* XXX */); -+} -diff --git a/libdiskfs/fsys-get-children.c b/libdiskfs/fsys-get-children.c -deleted file mode 100644 -index 69c9963..0000000 ---- a/libdiskfs/fsys-get-children.c -+++ /dev/null -@@ -1,99 +0,0 @@ --/* fsys_get_children -- -- Copyright (C) 2013 Free Software Foundation, Inc. -- -- Written by Justus Winter <4winter@informatik.uni-hamburg.de> -- -- This file is part of the GNU Hurd. -- -- The GNU Hurd is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2, or (at your option) -- any later version. -- -- The GNU Hurd is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -- --#include "priv.h" --#include "fsys_S.h" -- --#include <argz.h> -- --/* Return any active translators bound to nodes of the receiving -- filesystem. CHILDREN is an argz vector containing file names -- relative to the root of the receiving translator. */ --error_t --diskfs_S_fsys_get_children (fsys_t server, -- mach_port_t reply, -- mach_msg_type_name_t replyPoly, -- char **children, -- mach_msg_type_number_t *children_len) --{ -- error_t err; -- -- struct protid *cred = ports_lookup_port (diskfs_port_bucket, -- server, -- diskfs_protid_class); -- if (! cred) -- return EOPNOTSUPP; -- -- /* check_access performs the same permission check as is normally -- done, i.e. it checks that all but the last path components are -- executable by the requesting user and that the last component is -- readable. */ -- error_t check_access (const char *path) -- { -- error_t err; -- char *elements = NULL; -- size_t elements_len = 0; -- -- err = argz_create_sep (path, '/', &elements, &elements_len); -- if (err) -- return err; -- -- struct node *dp = diskfs_root_node; -- -- for (char *entry = elements; -- entry; -- entry = argz_next (elements, elements_len, entry)) -- { -- struct node *next; -- err = diskfs_lookup (dp, entry, LOOKUP, &next, NULL, cred); -- -- if (dp != diskfs_root_node) -- diskfs_nput (dp); -- -- if (err) -- return err; -- -- dp = next; -- } -- -- err = fshelp_access (&dp->dn_stat, S_IRUSR, cred->user); -- diskfs_nput (dp); -- return err; -- } -- -- -- char *c = NULL; -- size_t c_len = 0; -- -- err = fshelp_get_active_translators (&c, &c_len, check_access); -- if (err) -- goto errout; -- -- err = iohelp_return_malloced_buffer (c, c_len, children, children_len); -- if (err) -- goto errout; -- -- c = NULL; /* c was freed by iohelp_return_malloced_buffer. */ -- -- errout: -- free (c); -- return err; --} -diff --git a/libdiskfs/fsys-get-source.c b/libdiskfs/fsys-get-source.c -deleted file mode 100644 -index 08f227c..0000000 ---- a/libdiskfs/fsys-get-source.c -+++ /dev/null -@@ -1,34 +0,0 @@ --/* fsys_get_source -- -- Copyright (C) 2013 Free Software Foundation, Inc. -- -- Written by Justus Winter <4winter@informatik.uni-hamburg.de> -- -- This file is part of the GNU Hurd. -- -- The GNU Hurd is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2, or (at your option) -- any later version. -- -- The GNU Hurd is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -- --#include "priv.h" --#include "fsys_S.h" -- --/* Return information about the source of the receiving -- filesystem. */ --error_t --diskfs_S_fsys_get_source (fsys_t server, -- mach_port_t reply, -- mach_msg_type_name_t replyPoly, -- char *source) --{ -- return diskfs_get_source (source); --} -diff --git a/libdiskfs/get-source.c b/libdiskfs/get-source.c -index d0c143b..4399446 100644 ---- a/libdiskfs/get-source.c -+++ b/libdiskfs/get-source.c -@@ -22,7 +22,12 @@ - #include "priv.h" - - error_t --diskfs_get_source (char *source) -+diskfs_get_source (struct protid *cred, char *source, size_t source_len) - { -- return EOPNOTSUPP; -+ if (diskfs_disk_name == NULL) -+ return EOPNOTSUPP; -+ -+ strncpy (source, diskfs_disk_name, source_len - 1); -+ source[source_len - 1] = '\0'; -+ return 0; - } -diff --git a/libnetfs/Makefile b/libnetfs/Makefile -index 1a71b49..c3830c0 100644 ---- a/libnetfs/Makefile -+++ b/libnetfs/Makefile -@@ -45,7 +45,7 @@ IOSRCS= io-read.c io-readable.c io-seek.c io-write.c io-stat.c io-async.c \ - io-version.c - - FSYSSRCS= fsys-syncfs.c fsys-getroot.c fsys-get-options.c fsys-set-options.c \ -- fsys-goaway.c fsysstubs.c fsys-get-children.c fsys-get-source.c -+ fsys-goaway.c fsysstubs.c file-get-children.c file-get-source.c - - IFSOCKSRCS= - OTHERSRCS= drop-node.c init-init.c make-node.c make-peropen.c make-protid.c \ -diff --git a/libnetfs/file-get-children.c b/libnetfs/file-get-children.c -new file mode 100644 -index 0000000..80a727f ---- /dev/null -+++ b/libnetfs/file-get-children.c -@@ -0,0 +1,108 @@ -+/* file_get_children -+ -+ Copyright (C) 2013 Free Software Foundation, Inc. -+ -+ Written by Justus Winter <4winter@informatik.uni-hamburg.de> -+ -+ This file is part of the GNU Hurd. -+ -+ The GNU Hurd is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ The GNU Hurd is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -+ -+#include "priv.h" -+ -+#include <argz.h> -+ -+/* Return any active translators bound to nodes of the receiving -+ filesystem. CHILDREN is an argz vector containing file names -+ relative to the root of the receiving translator. */ -+error_t -+netfs_S_file_get_children (struct protid *cred, -+ char **children, -+ mach_msg_type_number_t *children_len) -+{ -+ error_t err; -+ if (! cred -+ || cred->pi.bucket != netfs_port_bucket -+ || cred->pi.class != netfs_protid_class) -+ return EOPNOTSUPP; -+ -+ /* check_access performs the same permission check as is normally -+ done, i.e. it checks that all but the last path components are -+ executable by the requesting user and that the last component is -+ readable. */ -+ error_t check_access (const char *path) -+ { -+ error_t err; -+ char *elements = NULL; -+ size_t elements_len = 0; -+ -+ err = argz_create_sep (path, '/', &elements, &elements_len); -+ if (err) -+ return err; -+ -+ struct node *dp = netfs_root_node; -+ -+ /* Lock the root node. netfs_attempt_lookup expects the directory to -+ be locked. */ -+ pthread_mutex_lock (&dp->lock); -+ -+ /* Increase the reference count, it will be decremented in the loop -+ ahead. */ -+ netfs_nref (dp); -+ -+ for (char *entry = elements; -+ entry; -+ entry = argz_next (elements, elements_len, entry)) -+ { -+ struct node *next; -+ err = netfs_attempt_lookup (cred->user, dp, entry, &next); -+ /* netfs_attempt_lookup has unlocked dp and returned next -+ locked, so there is no locking to do here. */ -+ -+ /* Decrease reference count. */ -+ netfs_nrele (dp); -+ -+ if (err) -+ goto errout; -+ -+ dp = next; -+ } -+ -+ err = fshelp_access (&dp->nn_stat, S_IRUSR, cred->user); -+ -+ errout: -+ /* Unlock and unreference the last node. */ -+ netfs_nput (dp); -+ -+ free (elements); -+ return err; -+ } -+ -+ char *c = NULL; -+ size_t c_len = 0; -+ -+ err = fshelp_get_active_translators (&c, &c_len, check_access); -+ if (err) -+ goto errout; -+ -+ err = iohelp_return_malloced_buffer (c, c_len, children, children_len); -+ if (err) -+ goto errout; -+ -+ c = NULL; /* c was freed by iohelp_return_malloced_buffer. */ -+ -+ errout: -+ free (c); -+ return err; -+} -diff --git a/libnetfs/file-get-source.c b/libnetfs/file-get-source.c -new file mode 100644 -index 0000000..8b73d5a ---- /dev/null -+++ b/libnetfs/file-get-source.c -@@ -0,0 +1,37 @@ -+/* file_get_source -+ -+ Copyright (C) 2013 Free Software Foundation, Inc. -+ -+ Written by Justus Winter <4winter@informatik.uni-hamburg.de> -+ -+ This file is part of the GNU Hurd. -+ -+ The GNU Hurd is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ The GNU Hurd is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -+ -+#include "priv.h" -+#include "fs_S.h" -+ -+/* Return information about the source of the receiving -+ filesystem. */ -+error_t -+netfs_S_file_get_source (struct protid *cred, -+ char *source) -+{ -+ if (! cred -+ || cred->pi.bucket != netfs_port_bucket -+ || cred->pi.class != netfs_protid_class) -+ return EOPNOTSUPP; -+ -+ return netfs_get_source (cred, source, 1024 /* XXX */); -+} -diff --git a/libnetfs/fsys-get-children.c b/libnetfs/fsys-get-children.c -deleted file mode 100644 -index fb3af91..0000000 ---- a/libnetfs/fsys-get-children.c -+++ /dev/null -@@ -1,112 +0,0 @@ --/* fsys_get_children -- -- Copyright (C) 2013 Free Software Foundation, Inc. -- -- Written by Justus Winter <4winter@informatik.uni-hamburg.de> -- -- This file is part of the GNU Hurd. -- -- The GNU Hurd is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2, or (at your option) -- any later version. -- -- The GNU Hurd is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -- --#include "priv.h" -- --#include <argz.h> -- --/* Return any active translators bound to nodes of the receiving -- filesystem. CHILDREN is an argz vector containing file names -- relative to the root of the receiving translator. */ --error_t --netfs_S_fsys_get_children (fsys_t server, -- mach_port_t reply, -- mach_msg_type_name_t replyPoly, -- char **children, -- mach_msg_type_number_t *children_len) --{ -- error_t err; -- -- struct protid *cred = ports_lookup_port (netfs_port_bucket, -- server, -- netfs_protid_class); -- if (! cred) -- return EOPNOTSUPP; -- -- /* check_access performs the same permission check as is normally -- done, i.e. it checks that all but the last path components are -- executable by the requesting user and that the last component is -- readable. */ -- error_t check_access (const char *path) -- { -- error_t err; -- char *elements = NULL; -- size_t elements_len = 0; -- -- err = argz_create_sep (path, '/', &elements, &elements_len); -- if (err) -- return err; -- -- struct node *dp = netfs_root_node; -- -- /* Lock the root node. netfs_attempt_lookup expects the directory to -- be locked. */ -- pthread_mutex_lock (&dp->lock); -- -- /* Increase the reference count, it will be decremented in the loop -- ahead. */ -- netfs_nref (dp); -- -- for (char *entry = elements; -- entry; -- entry = argz_next (elements, elements_len, entry)) -- { -- struct node *next; -- err = netfs_attempt_lookup (cred->user, dp, entry, &next); -- /* netfs_attempt_lookup has unlocked dp and returned next -- locked, so there is no locking to do here. */ -- -- /* Decrease reference count. */ -- netfs_nrele (dp); -- -- if (err) -- goto errout; -- -- dp = next; -- } -- -- err = fshelp_access (&dp->nn_stat, S_IRUSR, cred->user); -- -- errout: -- /* Unlock and unreference the last node. */ -- netfs_nput (dp); -- -- free (elements); -- return err; -- } -- -- char *c = NULL; -- size_t c_len = 0; -- -- err = fshelp_get_active_translators (&c, &c_len, check_access); -- if (err) -- goto errout; -- -- err = iohelp_return_malloced_buffer (c, c_len, children, children_len); -- if (err) -- goto errout; -- -- c = NULL; /* c was freed by iohelp_return_malloced_buffer. */ -- -- errout: -- free (c); -- return err; --} -diff --git a/libnetfs/fsys-get-source.c b/libnetfs/fsys-get-source.c -deleted file mode 100644 -index 6143d10..0000000 ---- a/libnetfs/fsys-get-source.c -+++ /dev/null -@@ -1,34 +0,0 @@ --/* fsys_get_source -- -- Copyright (C) 2013 Free Software Foundation, Inc. -- -- Written by Justus Winter <4winter@informatik.uni-hamburg.de> -- -- This file is part of the GNU Hurd. -- -- The GNU Hurd is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2, or (at your option) -- any later version. -- -- The GNU Hurd is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -- --#include "priv.h" --#include "fsys_S.h" -- --/* Return information about the source of the receiving -- filesystem. */ --error_t --netfs_S_fsys_get_source (fsys_t server, -- mach_port_t reply, -- mach_msg_type_name_t replyPoly, -- char *source) --{ -- return netfs_get_source (source); --} -diff --git a/libnetfs/get-source.c b/libnetfs/get-source.c -index 71a9639..73e48be 100644 ---- a/libnetfs/get-source.c -+++ b/libnetfs/get-source.c -@@ -22,7 +22,7 @@ - #include "priv.h" - - error_t --netfs_get_source (char *source) -+netfs_get_source (struct protid *cred, char *source, size_t source_len) - { - return EOPNOTSUPP; - } -diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h -index e10ccae..5d50f57 100644 ---- a/libnetfs/netfs.h -+++ b/libnetfs/netfs.h -@@ -315,10 +315,11 @@ error_t netfs_file_get_storage_info (struct iouser *cred, - mach_msg_type_number_t *data_len); - - /* The user may define this function. The function must set source to -- the source device of the filesystem. The function may return an -- EOPNOTSUPP to indicate that the concept of a source device is not -- applicable. The default function always returns EOPNOTSUPP. */ --error_t netfs_get_source (char *source); -+ the source of CRED. The function may return an EOPNOTSUPP to -+ indicate that the concept of a source device is not applicable. The -+ default function always returns EOPNOTSUPP. */ -+error_t netfs_get_source (struct protid *cred, -+ char *source, size_t source_len); - - /* Option parsing */ - -diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile -index 241b76d..3e4c039 100644 ---- a/libtrivfs/Makefile -+++ b/libtrivfs/Makefile -@@ -35,7 +35,7 @@ IOSRCS=io-async-icky.c io-async.c io-duplicate.c io-map.c io-modes-get.c \ - - FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-stubs.c fsys-syncfs.c \ - fsys-forward.c fsys-set-options.c fsys-get-options.c \ -- fsys-get-children.c fsys-get-source.c -+ file-get-children.c file-get-source.c - - OTHERSRCS=demuxer.c protid-clean.c protid-dup.c cntl-create.c \ - cntl-clean.c migsupport.c times.c startup.c open.c \ -diff --git a/libtrivfs/file-get-children.c b/libtrivfs/file-get-children.c -new file mode 100644 -index 0000000..a3afbba ---- /dev/null -+++ b/libtrivfs/file-get-children.c -@@ -0,0 +1,35 @@ -+/* file_get_children -+ -+ Copyright (C) 2013 Free Software Foundation, Inc. -+ -+ Written by Justus Winter <4winter@informatik.uni-hamburg.de> -+ -+ This file is part of the GNU Hurd. -+ -+ The GNU Hurd is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ The GNU Hurd is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -+ -+#include "priv.h" -+ -+/* Return any active translators bound to nodes of the receiving -+ filesystem. CHILDREN is an argz vector containing file names -+ relative to the root of the receiving translator. */ -+error_t -+trivfs_S_file_get_children (struct trivfs_protid *cred, -+ mach_port_t reply, -+ mach_msg_type_name_t replyPoly, -+ char **children, -+ mach_msg_type_number_t *children_len) -+{ -+ return EOPNOTSUPP; -+} -diff --git a/libtrivfs/file-get-source.c b/libtrivfs/file-get-source.c -new file mode 100644 -index 0000000..35636b5 ---- /dev/null -+++ b/libtrivfs/file-get-source.c -@@ -0,0 +1,33 @@ -+/* file_get_source -+ -+ Copyright (C) 2013 Free Software Foundation, Inc. -+ -+ Written by Justus Winter <4winter@informatik.uni-hamburg.de> -+ -+ This file is part of the GNU Hurd. -+ -+ The GNU Hurd is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ The GNU Hurd is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -+ -+#include "priv.h" -+ -+/* Return information about the source of the receiving -+ filesystem. */ -+error_t -+trivfs_S_file_get_source (struct trivfs_protid *cred, -+ mach_port_t reply, -+ mach_msg_type_name_t replyPoly, -+ char *source) -+{ -+ return cred? trivfs_get_source (cred, source, 1024 /* XXX */): EOPNOTSUPP; -+} -diff --git a/libtrivfs/fsys-get-children.c b/libtrivfs/fsys-get-children.c -deleted file mode 100644 -index 4697cc5..0000000 ---- a/libtrivfs/fsys-get-children.c -+++ /dev/null -@@ -1,35 +0,0 @@ --/* fsys_get_children -- -- Copyright (C) 2013 Free Software Foundation, Inc. -- -- Written by Justus Winter <4winter@informatik.uni-hamburg.de> -- -- This file is part of the GNU Hurd. -- -- The GNU Hurd is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2, or (at your option) -- any later version. -- -- The GNU Hurd is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -- --#include "priv.h" -- --/* Return any active translators bound to nodes of the receiving -- filesystem. CHILDREN is an argz vector containing file names -- relative to the root of the receiving translator. */ --error_t --trivfs_S_fsys_get_children (trivfs_control_t server, -- mach_port_t reply, -- mach_msg_type_name_t replyPoly, -- char **children, -- mach_msg_type_number_t *children_len) --{ -- return EOPNOTSUPP; --} -diff --git a/libtrivfs/fsys-get-source.c b/libtrivfs/fsys-get-source.c -deleted file mode 100644 -index 64aec2f..0000000 ---- a/libtrivfs/fsys-get-source.c -+++ /dev/null -@@ -1,33 +0,0 @@ --/* fsys_get_source -- -- Copyright (C) 2013 Free Software Foundation, Inc. -- -- Written by Justus Winter <4winter@informatik.uni-hamburg.de> -- -- This file is part of the GNU Hurd. -- -- The GNU Hurd is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2, or (at your option) -- any later version. -- -- The GNU Hurd is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -- --#include "priv.h" -- --/* Return information about the source of the receiving -- filesystem. */ --error_t --trivfs_S_fsys_get_source (trivfs_control_t server, -- mach_port_t reply, -- mach_msg_type_name_t replyPoly, -- char *source) --{ -- return trivfs_get_source (source); --} -diff --git a/libtrivfs/get-source.c b/libtrivfs/get-source.c -index 9ea5693..2605dac 100644 ---- a/libtrivfs/get-source.c -+++ b/libtrivfs/get-source.c -@@ -22,7 +22,7 @@ - #include "priv.h" - - error_t --trivfs_get_source (char *source) -+trivfs_get_source (struct trivfs_protid *cred, char *source, size_t source_len) - { - return EOPNOTSUPP; - } -diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h -index cf817b5..306a430 100644 ---- a/libtrivfs/trivfs.h -+++ b/libtrivfs/trivfs.h -@@ -235,10 +235,11 @@ error_t trivfs_append_args (struct trivfs_control *fsys, - char **argz, size_t *argz_len); - - /* The user may define this function. The function must set source to -- the source device of the filesystem. The function may return an -- EOPNOTSUPP to indicate that the concept of a source device is not -- applicable. The default function always returns EOPNOTSUPP. */ --error_t trivfs_get_source (char *source); -+ the source device of CRED. The function may return an EOPNOTSUPP to -+ indicate that the concept of a source device is not applicable. The -+ default function always returns EOPNOTSUPP. */ -+error_t trivfs_get_source (struct trivfs_protid *cred, -+ char *source, size_t source_len); - - /* Add the port class *CLASS to the list of control port classes recognized - by trivfs; if *CLASS is 0, an attempt is made to allocate a new port -diff --git a/nfs/main.c b/nfs/main.c -index 3ce75a9..cd1c29a 100644 ---- a/nfs/main.c -+++ b/nfs/main.c -@@ -269,6 +269,20 @@ netfs_append_args (char **argz, size_t *argz_len) - return err; - } - -+/* The user may define this function. The function must set source to -+ the source of CRED. The function may return an EOPNOTSUPP to -+ indicate that the concept of a source device is not applicable. The -+ default function always returns EOPNOTSUPP. */ -+error_t -+netfs_get_source (struct protid *cred, char *source, size_t source_len) -+{ -+ if (! cred) -+ return EOPNOTSUPP; -+ -+ snprintf (source, source_len, "%s:%s", host, remote_fs); -+ return 0; -+} -+ - /* Extract the host and remote filesystem names from SPEC, which should use - either HOST:FS or FS@HOST notation. Returns the malloced storage into - which both REMOTE_FS and HOST point, or 0 if SPEC is invalid. */ -diff --git a/tmpfs/tmpfs.c b/tmpfs/tmpfs.c -index 7da3dd5..a45d343 100644 ---- a/tmpfs/tmpfs.c -+++ b/tmpfs/tmpfs.c -@@ -33,7 +33,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - char *diskfs_server_name = "tmpfs"; - char *diskfs_server_version = HURD_VERSION; - char *diskfs_extra_version = "GNU Hurd"; --char *diskfs_disk_name = "swap"; -+char *diskfs_disk_name = "none"; - - /* We ain't got to show you no stinkin' sync'ing. */ - int diskfs_default_sync_interval = 0; -diff --git a/trans/Makefile b/trans/Makefile -index c0386d0..90df479 100644 ---- a/trans/Makefile -+++ b/trans/Makefile -@@ -56,7 +56,7 @@ magic: ../libiohelp/libiohelp.a - hello: ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a ../libports/libports.a ../libihash/libihash.a - fakeroot: ../libnetfs/libnetfs.a ../libfshelp/libfshelp.a ../libiohelp/libiohelp.a ../libports/libports.a ../libihash/libihash.a - remap: ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a ../libports/libports.a ../libihash/libihash.a --mtab: ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a ../libports/libports.a ../libihash/libihash.a fsysUser.o -+mtab: ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a ../libports/libports.a ../libihash/libihash.a fsUser.o - $(targets): ../libshouldbeinlibc/libshouldbeinlibc.a - - $(targets): %: %.o -diff --git a/trans/mtab.c b/trans/mtab.c -index 75ef1d3..da83e6f 100644 ---- a/trans/mtab.c -+++ b/trans/mtab.c -@@ -36,7 +36,7 @@ - #include <unistd.h> - #include <version.h> - --#include "fsys_U.h" -+#include "fs_U.h" - - static char *target_path = NULL; - static int insecure = 0; -@@ -421,21 +421,14 @@ mtab_populate (struct mtab *mtab, const char *path, int insecure) - argz_stringify (options, options_len, ','); - - string_t source; -- err = fsys_get_source (node, source); -+ err = file_get_source (node, source); - if (err) -- { -- if (err == EOPNOTSUPP) -- { -- /* Guess based on the last argument. */ -- err = map_device_to_path (argv[count - 1], &src); -- if (err) -- goto errout; -- } -- else -- goto errout; -- } -- else -- src = source; -+ goto errout; -+ -+ /* Guess based on the last argument. */ -+ err = map_device_to_path (source, &src); -+ if (err) -+ goto errout; - - entry_len = asprintf (&entry, "%s %s %s %s 0 0\n", src, path, type, - options? options: MNTOPT_DEFAULTS); -@@ -450,7 +443,7 @@ mtab_populate (struct mtab *mtab, const char *path, int insecure) - goto errout; - - /* path has an active translator, query its children. */ -- err = fsys_get_children (node, &children, &children_len); -+ err = file_get_children (node, &children, &children_len); - if (err == EOPNOTSUPP) - { - err = 0; -@@ -571,7 +564,7 @@ map_device_to_path (const char *device, char **path) - else if (looks_like_block_device (device)) - asprintf (path, "/dev/%s", device); - else -- *path = strdup ("none"); -+ *path = strdup (device); - - if (! *path) - return ENOMEM; -diff --git a/trans/symlink.c b/trans/symlink.c -index 8562662..845a112 100644 ---- a/trans/symlink.c -+++ b/trans/symlink.c -@@ -234,18 +234,3 @@ S_fsys_forward (mach_port_t server, mach_port_t requestor, - { - return EOPNOTSUPP; - } -- --error_t --S_fsys_get_children (mach_port_t server, -- char **children, -- mach_msg_type_number_t *children_len) --{ -- return EOPNOTSUPP; --} -- --error_t --S_fsys_get_source (mach_port_t server, -- char *source) --{ -- return EOPNOTSUPP; --} diff --git a/debian/patches/netfs-fix-fsys-receiver-lookups.patch b/debian/patches/netfs-fix-fsys-receiver-lookups.patch deleted file mode 100644 index 8d72e458..00000000 --- a/debian/patches/netfs-fix-fsys-receiver-lookups.patch +++ /dev/null @@ -1,264 +0,0 @@ -commit 300fc1b78311cf32dce548d9716ada4b961346c5 -Author: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Wed Feb 12 11:24:14 2014 +0100 - - libnetfs: fix receiver lookups in fsys server functions - - * mutations.h: Add translation functions. - * netfs.h (struct netfs_control): New declaration. - * priv.h: Define translation functions. - * fsys-get-options.c: Fix receiver lookups. - * fsys-getroot.c: Likewise. - * fsys-goaway.c: Likewise. - * fsys-set-options.c: Likewise. - * fsys-syncfs.c: Likewise. - * fsysstubs.c: Likewise. - -diff --git a/libnetfs/fsys-get-options.c b/libnetfs/fsys-get-options.c -index 54bd9a0..836806b 100644 ---- a/libnetfs/fsys-get-options.c -+++ b/libnetfs/fsys-get-options.c -@@ -31,7 +31,7 @@ - - /* Implement fsys_get_options as described in <hurd/fsys.defs>. */ - error_t --netfs_S_fsys_get_options (fsys_t fsys, -+netfs_S_fsys_get_options (struct netfs_control *port, - mach_port_t reply, - mach_msg_type_name_t reply_type, - char **data, mach_msg_type_number_t *data_len) -@@ -39,8 +39,6 @@ netfs_S_fsys_get_options (fsys_t fsys, - error_t err; - char *argz = 0; - size_t argz_len = 0; -- struct port_info *port = -- ports_lookup_port (netfs_port_bucket, fsys, netfs_control_class); - - if (!port) - return EOPNOTSUPP; -@@ -63,7 +61,5 @@ netfs_S_fsys_get_options (fsys_t fsys, - else - free (argz); - -- ports_port_deref (port); -- - return err; - } -diff --git a/libnetfs/fsys-getroot.c b/libnetfs/fsys-getroot.c -index 0d80111..2d02120 100644 ---- a/libnetfs/fsys-getroot.c -+++ b/libnetfs/fsys-getroot.c -@@ -25,7 +25,7 @@ - #include <fcntl.h> - - error_t --netfs_S_fsys_getroot (mach_port_t cntl, -+netfs_S_fsys_getroot (struct netfs_control *pt, - mach_port_t reply, - mach_msg_type_name_t reply_type, - mach_port_t dotdot, -@@ -37,8 +37,6 @@ netfs_S_fsys_getroot (mach_port_t cntl, - mach_port_t *retry_port, - mach_msg_type_name_t *retry_port_type) - { -- struct port_info *pt = ports_lookup_port (netfs_port_bucket, cntl, -- netfs_control_class); - struct iouser *cred; - error_t err; - struct protid *newpi; -@@ -51,7 +49,6 @@ netfs_S_fsys_getroot (mach_port_t cntl, - - if (!pt) - return EOPNOTSUPP; -- ports_port_deref (pt); - - err = iohelp_create_complex_iouser (&cred, uids, nuids, gids, ngids); - if (err) -diff --git a/libnetfs/fsys-goaway.c b/libnetfs/fsys-goaway.c -index 0ac36d3..872d073 100644 ---- a/libnetfs/fsys-goaway.c -+++ b/libnetfs/fsys-goaway.c -@@ -26,17 +26,15 @@ - #include <hurd/ports.h> - - error_t --netfs_S_fsys_goaway (fsys_t control, -+netfs_S_fsys_goaway (struct netfs_control *pt, - mach_port_t reply, - mach_msg_type_name_t reply_type, - int flags) - { - error_t err; -- struct port_info *pt; - -- pt = ports_lookup_port (netfs_port_bucket, control, -- netfs_control_class); -- if (! pt) -+ -+ if (!pt) - return EOPNOTSUPP; - - err = netfs_shutdown (flags); -@@ -46,7 +44,5 @@ netfs_S_fsys_goaway (fsys_t control, - exit (0); - } - -- ports_port_deref (pt); -- - return err; - } -diff --git a/libnetfs/fsys-set-options.c b/libnetfs/fsys-set-options.c -index d7dc743..fb1c87e 100644 ---- a/libnetfs/fsys-set-options.c -+++ b/libnetfs/fsys-set-options.c -@@ -31,15 +31,15 @@ - - /* Implement fsys_set_options as described in <hurd/fsys.defs>. */ - error_t --netfs_S_fsys_set_options (fsys_t fsys, -+netfs_S_fsys_set_options (struct netfs_control *pt, - mach_port_t reply, - mach_msg_type_name_t reply_type, - char *data, mach_msg_type_number_t data_len, - int do_children) - { - error_t err = 0; -- struct port_info *pt = -- ports_lookup_port (netfs_port_bucket, fsys, netfs_control_class); -+ if (!pt) -+ return EOPNOTSUPP; - - error_t - helper (struct node *np) -@@ -64,9 +64,6 @@ netfs_S_fsys_set_options (fsys_t fsys, - return error; - } - -- if (!pt) -- return EOPNOTSUPP; -- - #if NOT_YET - if (do_children) - { -@@ -87,7 +84,5 @@ netfs_S_fsys_set_options (fsys_t fsys, - #endif - } - -- ports_port_deref (pt); -- - return err; - } -diff --git a/libnetfs/fsys-syncfs.c b/libnetfs/fsys-syncfs.c -index f57cb14..e232936 100644 ---- a/libnetfs/fsys-syncfs.c -+++ b/libnetfs/fsys-syncfs.c -@@ -22,7 +22,7 @@ - #include "fsys_S.h" - - error_t --netfs_S_fsys_syncfs (mach_port_t cntl, -+netfs_S_fsys_syncfs (struct netfs_control *cntl, - mach_port_t reply, - mach_msg_type_name_t reply_type, - int wait, -diff --git a/libnetfs/fsysstubs.c b/libnetfs/fsysstubs.c -index f44155d..a64fd64 100644 ---- a/libnetfs/fsysstubs.c -+++ b/libnetfs/fsysstubs.c -@@ -23,7 +23,7 @@ - #include "fsys_S.h" - - error_t --netfs_S_fsys_getfile (fsys_t cntl, -+netfs_S_fsys_getfile (struct netfs_control *cntl, - mach_port_t reply, - mach_msg_type_name_t reply_type, - uid_t *uids, mach_msg_type_number_t nuids, -@@ -35,7 +35,7 @@ netfs_S_fsys_getfile (fsys_t cntl, - } - - error_t --netfs_S_fsys_getpriv (fsys_t cntl, -+netfs_S_fsys_getpriv (struct netfs_control *cntl, - mach_port_t reply, - mach_msg_type_name_t reply_type, - mach_port_t *host, mach_msg_type_name_t *hosttp, -@@ -46,7 +46,7 @@ netfs_S_fsys_getpriv (fsys_t cntl, - } - - error_t --netfs_S_fsys_init (fsys_t cntl, -+netfs_S_fsys_init (struct netfs_control *cntl, - mach_port_t reply, - mach_msg_type_name_t reply_type, - mach_port_t proc, auth_t auth) -@@ -55,7 +55,7 @@ netfs_S_fsys_init (fsys_t cntl, - } - - error_t --netfs_S_fsys_forward (fsys_t cntl, -+netfs_S_fsys_forward (mach_port_t cntl, - mach_port_t reply, - mach_msg_type_name_t reply_type, - mach_port_t request, -diff --git a/libnetfs/mutations.h b/libnetfs/mutations.h -index e6700f5..51ca871 100644 ---- a/libnetfs/mutations.h -+++ b/libnetfs/mutations.h -@@ -28,6 +28,9 @@ - #define IO_INTRAN protid_t begin_using_protid_port (io_t) - #define IO_DESTRUCTOR end_using_protid_port (protid_t) - -+#define FSYS_INTRAN control_t begin_using_control_port (fsys_t) -+#define FSYS_DESTRUCTOR end_using_control_port (control_t) -+ - #define FILE_IMPORTS import "netfs.h"; import "priv.h"; - #define IO_IMPORTS import "netfs.h"; import "priv.h"; - #define FSYS_IMPORTS import "netfs.h"; import "priv.h"; -diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h -index 5d50f57..aef4a3d 100644 ---- a/libnetfs/netfs.h -+++ b/libnetfs/netfs.h -@@ -100,6 +100,11 @@ struct node - struct dirmod *dirmod_reqs; - }; - -+struct netfs_control -+{ -+ struct port_info pi; -+}; -+ - /* The user must define this variable. Set this to the name of the - filesystem server. */ - extern char *netfs_server_name; -@@ -437,6 +442,7 @@ extern auth_t netfs_auth_server_port; - - /* Mig gook. */ - typedef struct protid *protid_t; -+typedef struct netfs_control *control_t; - - - #endif /* _HURD_NETFS_H_ */ -diff --git a/libnetfs/priv.h b/libnetfs/priv.h -index 00db9fa..ba31080 100644 ---- a/libnetfs/priv.h -+++ b/libnetfs/priv.h -@@ -37,4 +37,18 @@ end_using_protid_port (struct protid *cred) - if (cred) - ports_port_deref (cred); - } -+ -+static inline struct netfs_control * __attribute__ ((unused)) -+begin_using_control_port (fsys_t port) -+{ -+ return ports_lookup_port (netfs_port_bucket, port, netfs_control_class); -+} -+ -+static inline void __attribute__ ((unused)) -+end_using_control_port (struct netfs_control *cred) -+{ -+ if (cred) -+ ports_port_deref (cred); -+} -+ - #endif diff --git a/debian/patches/series b/debian/patches/series index a7d05778..8226f109 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -43,10 +43,6 @@ proc_set_init_task.patch newRPC.patch revert-remove-threadvars-hack.patch xkb-compat.patch -fix-get-children-source.patch -diskfs-fix-fsys-receiver-lookups.patch -netfs-fix-fsys-receiver-lookups.patch xxx-fix-build.patch -some-fixes.patch fix-translator-functions.patch |