diff options
4 files changed, 533 insertions, 0 deletions
diff --git a/debian/patches/fs_unification0001-mach-defpager-fix-error-handling.patch b/debian/patches/fs_unification0001-mach-defpager-fix-error-handling.patch new file mode 100644 index 00000000..4c83f57d --- /dev/null +++ b/debian/patches/fs_unification0001-mach-defpager-fix-error-handling.patch @@ -0,0 +1,45 @@ +From 5742e58fa98d6002f2cdaf5c3e7b063ab122e6b0 Mon Sep 17 00:00:00 2001 +From: Justus Winter <justus@gnupg.org> +Date: Mon, 18 Apr 2016 21:48:32 +0200 +Subject: [PATCH hurd 1/3] mach-defpager: fix error handling + +* mach-defpager/default_pager.c (S_default_pager_storage_info): Fix +error handling. +--- + mach-defpager/default_pager.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c +index 5379795..c79a82a 100644 +--- a/mach-defpager/default_pager.c ++++ b/mach-defpager/default_pager.c +@@ -3268,7 +3268,7 @@ S_default_pager_storage_info (mach_port_t pager, + { + kr = vm_allocate(default_pager_self, &addr, + round_page(m * sizeof(*size)), TRUE); +- if (kr != KERN_SUCCESS); ++ if (kr != KERN_SUCCESS) + goto nomemory; + *size = (vm_size_array_t) addr; + } +@@ -3278,7 +3278,7 @@ S_default_pager_storage_info (mach_port_t pager, + { + kr = vm_allocate(default_pager_self, &addr, + round_page(m * sizeof(*free)), TRUE); +- if (kr != KERN_SUCCESS); ++ if (kr != KERN_SUCCESS) + goto nomemory; + *free = (vm_size_array_t) addr; + } +@@ -3288,7 +3288,7 @@ S_default_pager_storage_info (mach_port_t pager, + { + kr = vm_allocate(default_pager_self, &addr, + round_page(len), TRUE); +- if (kr != KERN_SUCCESS); ++ if (kr != KERN_SUCCESS) + goto nomemory; + *name = (data_t) addr; + } +-- +2.1.4 + diff --git a/debian/patches/fs_unification0002-libnetfs-rename-error-to-err.patch b/debian/patches/fs_unification0002-libnetfs-rename-error-to-err.patch new file mode 100644 index 00000000..7844066c --- /dev/null +++ b/debian/patches/fs_unification0002-libnetfs-rename-error-to-err.patch @@ -0,0 +1,259 @@ +From 6cf0c3024b28a29780c5f9a38090234784250b02 Mon Sep 17 00:00:00 2001 +From: Justus Winter <justus@gnupg.org> +Date: Mon, 18 Apr 2016 19:00:31 +0200 +Subject: [PATCH hurd 2/3] libnetfs: rename 'error' to 'err' + +* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Rename 'error' to 'err'. +--- + libnetfs/dir-lookup.c | 92 +++++++++++++++++++++++++-------------------------- + 1 file changed, 46 insertions(+), 46 deletions(-) + +diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c +index cbe2941..9a92c29 100644 +--- a/libnetfs/dir-lookup.c ++++ b/libnetfs/dir-lookup.c +@@ -48,7 +48,7 @@ netfs_S_dir_lookup (struct protid *diruser, + struct node *dnp, *np; + char *nextname; + char *relpath; +- error_t error; ++ error_t err; + struct protid *newpi = NULL; + struct iouser *user; + +@@ -132,7 +132,7 @@ netfs_S_dir_lookup (struct protid *diruser, + strcpy (retry_name, "/"); + else if (!lastcomp) + strcpy (retry_name, nextname); +- error = 0; ++ err = 0; + pthread_mutex_unlock (&dnp->lock); + goto out; + } +@@ -148,40 +148,40 @@ netfs_S_dir_lookup (struct protid *diruser, + strcpy (retry_name, "/"); + else if (!lastcomp) + strcpy (retry_name, nextname); +- error = 0; ++ err = 0; + pthread_mutex_unlock (&dnp->lock); + goto out; + } + else + /* We are global root */ + { +- error = 0; ++ err = 0; + np = dnp; + netfs_nref (np); + } + else + /* Attempt a lookup on the next pathname component. */ +- error = netfs_attempt_lookup (diruser->user, dnp, filename, &np); ++ err = netfs_attempt_lookup (diruser->user, dnp, filename, &np); + + /* At this point, DNP is unlocked */ + + /* Implement O_EXCL flag here */ +- if (lastcomp && create && excl && !error) +- error = EEXIST; ++ if (lastcomp && create && excl && !err) ++ err = EEXIST; + + /* Create the new node if necessary */ +- if (lastcomp && create && error == ENOENT) ++ if (lastcomp && create && err == ENOENT) + { + mode &= ~(S_IFMT | S_ISPARE | S_ISVTX); + mode |= S_IFREG; + pthread_mutex_lock (&dnp->lock); +- error = netfs_attempt_create_file (diruser->user, dnp, +- filename, mode, &np); ++ err = netfs_attempt_create_file (diruser->user, dnp, ++ filename, mode, &np); + + /* If someone has already created the file (between our lookup + and this create) then we just got EEXIST. If we are + EXCL, that's fine; otherwise, we have to retry the lookup. */ +- if (error == EEXIST && !excl) ++ if (err == EEXIST && !excl) + { + pthread_mutex_lock (&dnp->lock); + goto retry_lookup; +@@ -191,11 +191,11 @@ netfs_S_dir_lookup (struct protid *diruser, + } + + /* All remaining errors get returned to the user */ +- if (error) ++ if (err) + goto out; + +- error = netfs_validate_stat (np, diruser->user); +- if (error) ++ err = netfs_validate_stat (np, diruser->user); ++ if (err) + goto out; + + if ((((flags & O_NOTRANS) == 0) || !lastcomp || mustbedir) +@@ -251,21 +251,21 @@ netfs_S_dir_lookup (struct protid *diruser, + + /* Create an unauthenticated port for DNP, and then + unlock it. */ +- error = iohelp_create_empty_iouser (&user); +- if (! error) ++ err = iohelp_create_empty_iouser (&user); ++ if (! err) + { + newpi = netfs_make_protid (netfs_make_peropen (dnp, 0, + diruser->po), + user); + if (! newpi) + { +- error = errno; ++ err = errno; + iohelp_free_iouser (user); + } + } + + boolean_t register_translator = 0; +- if (! error) ++ if (! err) + { + dirport = ports_get_send_right (newpi); + +@@ -275,24 +275,24 @@ netfs_S_dir_lookup (struct protid *diruser, + translators. */ + register_translator = np->transbox.active == MACH_PORT_NULL; + +- error = fshelp_fetch_root (&np->transbox, diruser->po, +- dirport, +- diruser->user, +- lastcomp ? flags : 0, +- ((np->nn_translated & S_IPTRANS) +- ? _netfs_translator_callback1 +- : short_circuited_callback1), +- _netfs_translator_callback2, +- do_retry, retry_name, retry_port); ++ err = fshelp_fetch_root (&np->transbox, diruser->po, ++ dirport, ++ diruser->user, ++ lastcomp ? flags : 0, ++ ((np->nn_translated & S_IPTRANS) ++ ? _netfs_translator_callback1 ++ : short_circuited_callback1), ++ _netfs_translator_callback2, ++ do_retry, retry_name, retry_port); + /* fetch_root copies DIRPORT for success, so we always should + deallocate our send right. */ + mach_port_deallocate (mach_task_self (), dirport); + } + +- if (error != ENOENT) ++ if (err != ENOENT) + { + *retry_port_type = MACH_MSG_TYPE_MOVE_SEND; +- if (!error) ++ if (!err) + { + char *end = strchr (retry_name, '\0'); + if (mustbedir) +@@ -326,12 +326,12 @@ netfs_S_dir_lookup (struct protid *diruser, + else + asprintf (&complete_path, "%s/%s", diruser->po->path, translator_path); + +- error = fshelp_set_active_translator (&newpi->pi, +- complete_path, +- np->transbox.active); ++ err = fshelp_set_active_translator (&newpi->pi, ++ complete_path, ++ np->transbox.active); + if (complete_path != translator_path) + free(complete_path); +- if (error) ++ if (err) + { + ports_port_deref (newpi); + goto out; +@@ -346,7 +346,7 @@ netfs_S_dir_lookup (struct protid *diruser, + + /* ENOENT means there was a hiccup, and the translator vanished + while NP was unlocked inside fshelp_fetch_root; continue as normal. */ +- error = 0; ++ err = 0; + } + + if (S_ISLNK (np->nn_translated) +@@ -360,7 +360,7 @@ netfs_S_dir_lookup (struct protid *diruser, + /* Handle symlink interpretation */ + if (nsymlinks++ > netfs_maxsymlinks) + { +- error = ELOOP; ++ err = ELOOP; + goto out; + } + +@@ -370,8 +370,8 @@ netfs_S_dir_lookup (struct protid *diruser, + newnamelen = nextnamelen + linklen + 1 + 1; + linkbuf = alloca (newnamelen); + +- error = netfs_attempt_readlink (diruser->user, np, linkbuf); +- if (error) ++ err = netfs_attempt_readlink (diruser->user, np, linkbuf); ++ if (err) + goto out; + + if (nextname) +@@ -436,19 +436,19 @@ netfs_S_dir_lookup (struct protid *diruser, + netfs_validate_stat (np, diruser->user); + if (!S_ISDIR (np->nn_stat.st_mode)) + { +- error = ENOTDIR; ++ err = ENOTDIR; + goto out; + } + } +- error = netfs_check_open_permissions (diruser->user, np, +- flags, newnode); +- if (error) ++ err = netfs_check_open_permissions (diruser->user, np, ++ flags, newnode); ++ if (err) + goto out; + + flags &= ~OPENONLY_STATE_MODES; + +- error = iohelp_dup_iouser (&user, diruser->user); +- if (error) ++ err = iohelp_dup_iouser (&user, diruser->user); ++ if (err) + goto out; + + newpi = netfs_make_protid (netfs_make_peropen (np, flags, diruser->po), +@@ -456,7 +456,7 @@ netfs_S_dir_lookup (struct protid *diruser, + if (! newpi) + { + iohelp_free_iouser (user); +- error = errno; ++ err = errno; + goto out; + } + +@@ -474,7 +474,7 @@ netfs_S_dir_lookup (struct protid *diruser, + } + + if (! newpi->po->path) +- error = errno; ++ err = errno; + + *retry_port = ports_get_right (newpi); + ports_port_deref (newpi); +@@ -485,5 +485,5 @@ netfs_S_dir_lookup (struct protid *diruser, + if (dnp) + netfs_nrele (dnp); + free (relpath); +- return error; ++ return err; + } +-- +2.1.4 + diff --git a/debian/patches/fs_unification0003-libnetfs-rename-diruser-to-dircred.patch b/debian/patches/fs_unification0003-libnetfs-rename-diruser-to-dircred.patch new file mode 100644 index 00000000..41a55931 --- /dev/null +++ b/debian/patches/fs_unification0003-libnetfs-rename-diruser-to-dircred.patch @@ -0,0 +1,226 @@ +From b0df5d9b0f38d15b52ae8a35eb35256873cd7c18 Mon Sep 17 00:00:00 2001 +From: Justus Winter <justus@gnupg.org> +Date: Mon, 18 Apr 2016 19:06:59 +0200 +Subject: [PATCH hurd 3/3] libnetfs: rename 'diruser' to 'dircred' + +* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Rename 'diruser' to +'dircred'. +--- + libnetfs/dir-lookup.c | 58 +++++++++++++++++++++++++-------------------------- + 1 file changed, 29 insertions(+), 29 deletions(-) + +diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c +index 9a92c29..caeb151 100644 +--- a/libnetfs/dir-lookup.c ++++ b/libnetfs/dir-lookup.c +@@ -30,7 +30,7 @@ + #include "misc.h" + + error_t +-netfs_S_dir_lookup (struct protid *diruser, ++netfs_S_dir_lookup (struct protid *dircred, + char *filename, + int flags, + mode_t mode, +@@ -52,7 +52,7 @@ netfs_S_dir_lookup (struct protid *diruser, + struct protid *newpi = NULL; + struct iouser *user; + +- if (!diruser) ++ if (!dircred) + return EOPNOTSUPP; + + create = (flags & O_CREAT); +@@ -62,7 +62,7 @@ netfs_S_dir_lookup (struct protid *diruser, + while (*filename == '/') + filename++; + +- /* Preserve the path relative to diruser->po->path. */ ++ /* Preserve the path relative to dircred->po->path. */ + relpath = strdup (filename); + if (! relpath) + return ENOMEM; +@@ -79,13 +79,13 @@ netfs_S_dir_lookup (struct protid *diruser, + { + /* Set things up in the state expected by the code from gotit: on. */ + dnp = 0; +- np = diruser->po->np; ++ np = dircred->po->np; + pthread_mutex_lock (&np->lock); + netfs_nref (np); + goto gotit; + } + +- dnp = diruser->po->np; ++ dnp = dircred->po->np; + pthread_mutex_lock (&dnp->lock); + + netfs_nref (dnp); /* acquire a reference for later netfs_nput */ +@@ -120,13 +120,13 @@ netfs_S_dir_lookup (struct protid *diruser, + + retry_lookup: + +- if ((dnp == netfs_root_node || dnp == diruser->po->shadow_root) ++ if ((dnp == netfs_root_node || dnp == dircred->po->shadow_root) + && filename[0] == '.' && filename[1] == '.' && filename[2] == '\0') +- if (dnp == diruser->po->shadow_root) ++ if (dnp == dircred->po->shadow_root) + /* We're at the root of a shadow tree. */ + { + *do_retry = FS_RETRY_REAUTH; +- *retry_port = diruser->po->shadow_root_parent; ++ *retry_port = dircred->po->shadow_root_parent; + *retry_port_type = MACH_MSG_TYPE_COPY_SEND; + if (lastcomp && mustbedir) /* Trailing slash. */ + strcpy (retry_name, "/"); +@@ -136,13 +136,13 @@ netfs_S_dir_lookup (struct protid *diruser, + pthread_mutex_unlock (&dnp->lock); + goto out; + } +- else if (diruser->po->root_parent != MACH_PORT_NULL) +- /* We're at a real translator root; even if DIRUSER->po has a ++ else if (dircred->po->root_parent != MACH_PORT_NULL) ++ /* We're at a real translator root; even if DIRCRED->po has a + shadow root, we can get here if its in a directory that was + renamed out from under it... */ + { + *do_retry = FS_RETRY_REAUTH; +- *retry_port = diruser->po->root_parent; ++ *retry_port = dircred->po->root_parent; + *retry_port_type = MACH_MSG_TYPE_COPY_SEND; + if (lastcomp && mustbedir) /* Trailing slash. */ + strcpy (retry_name, "/"); +@@ -161,7 +161,7 @@ netfs_S_dir_lookup (struct protid *diruser, + } + else + /* Attempt a lookup on the next pathname component. */ +- err = netfs_attempt_lookup (diruser->user, dnp, filename, &np); ++ err = netfs_attempt_lookup (dircred->user, dnp, filename, &np); + + /* At this point, DNP is unlocked */ + +@@ -175,7 +175,7 @@ netfs_S_dir_lookup (struct protid *diruser, + mode &= ~(S_IFMT | S_ISPARE | S_ISVTX); + mode |= S_IFREG; + pthread_mutex_lock (&dnp->lock); +- err = netfs_attempt_create_file (diruser->user, dnp, ++ err = netfs_attempt_create_file (dircred->user, dnp, + filename, mode, &np); + + /* If someone has already created the file (between our lookup +@@ -194,7 +194,7 @@ netfs_S_dir_lookup (struct protid *diruser, + if (err) + goto out; + +- err = netfs_validate_stat (np, diruser->user); ++ err = netfs_validate_stat (np, dircred->user); + if (err) + goto out; + +@@ -216,7 +216,7 @@ netfs_S_dir_lookup (struct protid *diruser, + struct node *np = cookie1; + error_t err; + +- err = netfs_validate_stat (np, diruser->user); ++ err = netfs_validate_stat (np, dircred->user); + if (err) + return err; + +@@ -255,7 +255,7 @@ netfs_S_dir_lookup (struct protid *diruser, + if (! err) + { + newpi = netfs_make_protid (netfs_make_peropen (dnp, 0, +- diruser->po), ++ dircred->po), + user); + if (! newpi) + { +@@ -275,9 +275,9 @@ netfs_S_dir_lookup (struct protid *diruser, + translators. */ + register_translator = np->transbox.active == MACH_PORT_NULL; + +- err = fshelp_fetch_root (&np->transbox, diruser->po, ++ err = fshelp_fetch_root (&np->transbox, dircred->po, + dirport, +- diruser->user, ++ dircred->user, + lastcomp ? flags : 0, + ((np->nn_translated & S_IPTRANS) + ? _netfs_translator_callback1 +@@ -320,11 +320,11 @@ netfs_S_dir_lookup (struct protid *diruser, + translator_path[end - filename_start] = '\0'; + } + +- if (diruser->po->path == NULL || !strcmp (diruser->po->path,".")) +- /* diruser is the root directory. */ ++ if (dircred->po->path == NULL || !strcmp (dircred->po->path,".")) ++ /* dircred is the root directory. */ + complete_path = translator_path; + else +- asprintf (&complete_path, "%s/%s", diruser->po->path, translator_path); ++ asprintf (&complete_path, "%s/%s", dircred->po->path, translator_path); + + err = fshelp_set_active_translator (&newpi->pi, + complete_path, +@@ -370,7 +370,7 @@ netfs_S_dir_lookup (struct protid *diruser, + newnamelen = nextnamelen + linklen + 1 + 1; + linkbuf = alloca (newnamelen); + +- err = netfs_attempt_readlink (diruser->user, np, linkbuf); ++ err = netfs_attempt_readlink (dircred->user, np, linkbuf); + if (err) + goto out; + +@@ -433,25 +433,25 @@ netfs_S_dir_lookup (struct protid *diruser, + + if (mustbedir) + { +- netfs_validate_stat (np, diruser->user); ++ netfs_validate_stat (np, dircred->user); + if (!S_ISDIR (np->nn_stat.st_mode)) + { + err = ENOTDIR; + goto out; + } + } +- err = netfs_check_open_permissions (diruser->user, np, ++ err = netfs_check_open_permissions (dircred->user, np, + flags, newnode); + if (err) + goto out; + + flags &= ~OPENONLY_STATE_MODES; + +- err = iohelp_dup_iouser (&user, diruser->user); ++ err = iohelp_dup_iouser (&user, dircred->user); + if (err) + goto out; + +- newpi = netfs_make_protid (netfs_make_peropen (np, flags, diruser->po), ++ newpi = netfs_make_protid (netfs_make_peropen (np, flags, dircred->po), + user); + if (! newpi) + { +@@ -461,16 +461,16 @@ netfs_S_dir_lookup (struct protid *diruser, + } + + free (newpi->po->path); +- if (diruser->po->path == NULL || !strcmp (diruser->po->path,".")) ++ if (dircred->po->path == NULL || !strcmp (dircred->po->path,".")) + { +- /* diruser is the root directory. */ ++ /* dircred is the root directory. */ + newpi->po->path = relpath; + relpath = NULL; /* Do not free relpath. */ + } + else + { + newpi->po->path = NULL; +- asprintf (&newpi->po->path, "%s/%s", diruser->po->path, relpath); ++ asprintf (&newpi->po->path, "%s/%s", dircred->po->path, relpath); + } + + if (! newpi->po->path) +-- +2.1.4 + diff --git a/debian/patches/series b/debian/patches/series index 78af34c3..351b3bd6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -40,3 +40,6 @@ gpg0001-trans-add-identity-translator.patch gpg0002-trans-add-transparent-GnuPG-translator.patch gpg0003-libdiskfs-perform-synchronous-operations-in-periodic.patch gpg0004-libdiskfs-xxx-log-periodic-syncs.patch +fs_unification0001-mach-defpager-fix-error-handling.patch +fs_unification0002-libnetfs-rename-error-to-err.patch +fs_unification0003-libnetfs-rename-diruser-to-dircred.patch |