Commit Graph

18 Commits

Author SHA1 Message Date
Duncan Overbruck
de484e9369
lib: change xbps_dbg_printf to not require xbps_handle
This allows to simplify a lot of code by not having to pass around
the xbps handle everywhere just to print some debug information.
2022-12-24 14:29:23 +01:00
Juan RP
d36d37fc6a lib/external/fexec.c: fix potential insecure usage in vfork().
Reported by clang-analyzer.

After reading the linux man-pages vfork(2) manpage I came to the
conclusion that it's better to change the behaviour of the
original source (NetBSD) and change this to use fork(2).
2019-06-18 18:49:29 +02:00
Duncaen
008e1ed901 lib/external/fexec.c: run child with 022 umask 2019-06-14 21:09:15 +02:00
Juan RP
041708f643 Revert "Execute pkg scripts via posix_spawn(3)."
This reverts commit e33f6354c3.

@Gottox pointed out why this won't work.
2016-02-06 10:56:32 +01:00
Juan RP
e33f6354c3 Execute pkg scripts via posix_spawn(3). 2016-02-04 11:39:02 +01:00
Juan RP
c61317e219 lib/external/fexec.c: fix build with glibc>=2.20 (needs _DEFAULT_SOURCE). 2014-09-08 18:46:12 +02:00
Juan RP
5eea259c13 Remove the config.h kludge and override vasprintf detection via HAVE_VASPRINTF. 2014-01-20 18:50:33 +01:00
Juan RP
f5f6f50e27 lib/external/fexec.c: add some parens so that expression is evaluated correctly. 2013-03-07 20:15:16 +01:00
Juan RP
fd7153fe5c lib/external/fexec.c: error out if chroot/chdir fails, ignore target_arch. 2013-03-07 18:07:47 +01:00
Juan RP
8b5f6d7b65 When running scripts exit from child with errno from execv(). 2013-02-26 09:12:44 +01:00
Juan RP
26778964a4 When executing scripts don't chroot if XBPS_TARGET_ARCH is set. 2013-02-25 23:00:20 +01:00
Juan RP
0a082a82c3 xbps_file_exec: don't fail if chroot(2) fails (due to EPERM). 2012-11-17 11:44:14 +01:00
Juan RP
a77727887d Improvements for xbps_fetch_file and xbps_repository_sync_index.
xbps_fetch_file:
	- A temp file is created with .part extension to improve resuming.
	- Files are downloaded in cwd.
	- Switch to futimens(2) and fsync(2).

xbps_repository_sync_index:
	- Do not create local repodir in metadir if it already exists.
	- Simplify the code thanks to new xbps_fetch_file().
2012-11-11 11:29:49 +01:00
Juan RP
3e9e87fc2a libxbps: require a pointer to xbps_handle in functions that need it.
This removes 2 global vars from lib/initend.c and easier to know
what functions require access to xbps_handle.
2012-06-14 08:22:11 +02:00
Juan RP
27aacf97f4 xbps_file_exec: simplify and don't chroot when rootdir == /.
Before that change we were chroot(2)ing even when rootdir was set to /.
2012-05-30 17:44:39 +02:00
Juan RP
a94dd5dbfa Revert "libxbps: implement xbps_file_exec() with posix_spawn()."
This reverts commit 5aa05f4c72.
2012-05-30 17:26:25 +02:00
Juan RP
5aa05f4c72 libxbps: implement xbps_file_exec() with posix_spawn(). 2012-05-30 14:45:47 +02:00
Juan RP
ca8e8accc4 Move external code used by libxbps into lib/external. 2011-10-24 09:05:16 +02:00