Naive concatenation of $LD_LIBRARY_PATH can result in an empty
colon-delimited segment; this tells glibc to load libraries from the
current directory, which is definitely wrong, and may be a security
vulnerability if the current directory is untrusted. (See #67234, for
example.) Fix this throughout the tree.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
umount.davfs2 uses ps to get a process list to terminate gracefully.
On NixOS, this currently fails:
```
sh: ps: command not found
/run/current-system/sw/bin/umount.davfs:
can't find mount.davfs-process with pid 4085;
trying to unmount anyway.
you propably have to remove /var/run/mount.davfs/root-x.pid manually
sh: umount: command not found
```
Fix this by patching ${procps}/bin/ps into the ps_command.
Afterwards:
```
umount.davfs: waiting for mount.davfs (pid 4106) to terminate gracefully .. OK
```
Samba 3 has been discontinued since Q1/2015. So I think it's time
to just wipe it from the pkgs. FuseSMB is pretty much abandoned,
upstream does not exist and it's also not as useful as it used to
be anyways.
correct platforms. ceph currently doesn't build on aarch64-linux. So
let's not lie in meta.platforms.
ceph: fix multiple output
We currently just move $out/share/ceph/mgr to
$lib/lib/ceph, and then remove all references to $out with a find
command.
I checked $out, the only reference to $out is in
$lib/lib/ceph/libceph-common.so.0, coming from src/common/options.cc:
https://github.com/ceph/ceph/blob/master/src/common/options.cc#L5050:
> Option("mgr_module_path", Option::TYPE_STR, Option::LEVEL_ADVANCED)
> .set_default(CEPH_DATADIR "/mgr")
> .add_service("mgr")
> .set_description("Filesystem path to manager modules."),
Just removing the reference might break some behaviour - it should point
to $lib/ceph/mgr instead.
We can fix this in a much more elegant fashion by just passing a custom
CMAKE_INSTALL_DATADIR to the build system.
ceph: fix outdated Boost::python substitutions
Instead of substituting in CMakeLists.txt files, one now needs to set
MGR_PYTHON_VERSION.
ceph: clean up PYTHONPATH wrapping
Set `pythonPath` instead of exporting PYTHONPATH.
Use `toPythonPath` to construct the PYTHONPATH where we need manual
wrapping. There's no ceph-volume, only ceph-mgr.
ceph: set doCheck = false explicitly
and describe why.
ceph: patch more shebangs
ceph: use system-provided gtest and rocksdb
The patch prevents the following error:
[2/7] Generating manpages with a custom command.
../sshfs.rst:210: (ERROR/3) Unexpected indentation.
../sshfs.rst:211: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
This new patch is the patch between 4.4, and commit [1], a pull request
at [2] to upsteam Mac and BSD compatibility. That pull request is
itself a rebase of an older pull request for an earlier version of
squashfs-tools. I squashed all commits between 4.4 and [1], apart from
the BSD-specific ones, and exported the new patch from that. Attached
below is the git diff --ignore-space-change between squashfs-tools 4.4
with the previous patch applied, and with the new patch applied.
[1]: 7d31beec53e6245d3405d6ef2b96e9811ae07044
[2]: https://github.com/plougher/squashfs-tools/pull/69
---
diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c
index 8efefe6..5c2f835 100644
--- a/squashfs-tools/info.c
+++ b/squashfs-tools/info.c
@@ -159,7 +159,7 @@ void *info_thrd(void *arg)
case EINTR:
continue;
default:
- BAD_ERROR("sigwaitfailed "
+ BAD_ERROR("sigwait failed "
"because %s\n", strerror(errno));
}
}
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index 67d86a5..3607448 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -35,7 +35,10 @@
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef linux
+#ifndef linux
+#include <sys/sysctl.h>
+#else
+#include <sys/sysinfo.h>
#include <sys/sysmacros.h>
#endif
#include <fcntl.h>
@@ -52,7 +55,6 @@
#include <sys/wait.h>
#include <limits.h>
#include <ctype.h>
-#include <sys/sysinfo.h>
#ifndef FNM_EXTMATCH /* glibc extension */
#define FNM_EXTMATCH 0
@@ -5191,7 +5193,17 @@ int parse_mode(char *arg, mode_t *res)
int get_physical_memory()
{
+ /*
+ * Long longs are used here because with PAE, a 32-bit
+ * machine can have more than 4GB of physical memory
+ *
+ * sysconf(_SC_PHYS_PAGES) relies on /proc being mounted.
+ * If it fails use sysinfo, if that fails return 0
+ */
+ long long num_pages = sysconf(_SC_PHYS_PAGES);
+ long long page_size = sysconf(_SC_PAGESIZE);
int phys_mem;
+
#ifndef linux
#ifdef HW_MEMSIZE
#define SYSCTL_PHYSMEM HW_MEMSIZE
@@ -5221,16 +5233,6 @@ int get_physical_memory()
}
#undef SYSCTL_PHYSMEM
#else
- /*
- * Long longs are used here because with PAE, a 32-bit
- * machine can have more than 4GB of physical memory
- *
- * sysconf(_SC_PHYS_PAGES) relies on /proc being mounted.
- * If it fails use sysinfo, if that fails return 0
- */
- long long num_pages = sysconf(_SC_PHYS_PAGES);
- long long page_size = sysconf(_SC_PAGESIZE);
-
if(num_pages == -1 || page_size == -1) {
struct sysinfo sys;
int res = sysinfo(&sys);
diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
index 88d0b5c..1beefef 100644
--- a/squashfs-tools/mksquashfs.h
+++ b/squashfs-tools/mksquashfs.h
@@ -24,7 +24,6 @@
* mksquashfs.h
*
*/
-#include <pthread.h>
struct dir_info {
char *pathname;
diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
index f8fd529..48e6b27 100644
--- a/squashfs-tools/pseudo.c
+++ b/squashfs-tools/pseudo.c
@@ -30,7 +30,6 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
index 00615ce..c1a6183 100644
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
@@ -38,7 +38,6 @@
#include <sys/sysinfo.h>
#include <sys/sysmacros.h>
#endif
-
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
@@ -1085,7 +1084,7 @@ int create_inode(char *pathname, struct inode *i)
break;
case SQUASHFS_SYMLINK_TYPE:
case SQUASHFS_LSYMLINK_TYPE: {
- struct timespec times[2] = {
+ struct timeval times[2] = {
{ i->time, 0 },
{ i->time, 0 }
};
@@ -1104,8 +1103,7 @@ int create_inode(char *pathname, struct inode *i)
goto failed;
}
- res = utimensat(AT_FDCWD, pathname, times,
- AT_SYMLINK_NOFOLLOW);
+ res = lutimes(pathname, times);
if(res == -1) {
EXIT_UNSQUASH_STRICT("create_inode: failed to set time on "
"%s, because %s\n", pathname,