commit e00d494f7345478b9215ff61403c3b7bd6ec32da7c6cb0ab753fe5c236540f79 Author: Adrian Schröter Date: Fri May 3 16:56:10 2024 +0200 Sync from SUSE:SLFO:Main nbd revision ba7edab4f262fc828ba33af3c007ae06 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/0001_fix_setgroup.patch b/0001_fix_setgroup.patch new file mode 100644 index 0000000..ede6701 --- /dev/null +++ b/0001_fix_setgroup.patch @@ -0,0 +1,30 @@ +From 0cd9e3ba2a0f54d930d813bfde9ff9d57a12d9ed Mon Sep 17 00:00:00 2001 +From: Luiz Angelo Daros de Luca +Date: Tue, 24 Jul 2018 15:59:39 -0300 +Subject: [PATCH] server: clean supplementary groups when setuid +Upstream: merged +References: https://github.com/NetworkBlockDevice/nbd/commit/0cd9e3ba2a0f54d930d813bfde9ff9d57a12d9ed +References: gh#NetworkBlockDevice/nbd#79 +References: https://github.com/NetworkBlockDevice/nbd/pull/79 + +When nbd-server drops privileges, it was leaving supplementary +groups untouched. As nbd-server was normally dropping from root, +nbd-server kept membership to root supplementary groups. + +Signed-off-by: Luiz Angelo Daros de Luca +--- + nbd-server.c | 1 + + 1 file changed, 1 insertion(+) + +Index: nbd-3.19/nbd-server.c +=================================================================== +--- nbd-3.19.orig/nbd-server.c ++++ nbd-3.19/nbd-server.c +@@ -3476,6 +3476,7 @@ void dousers(const gchar *const username + err(str); + } + setgroups(0, NULL); ++ setgroups(0, NULL); + if(setuid(pw->pw_uid)<0) { + err("Could not set UID: %m"); + } diff --git a/config.example b/config.example new file mode 100644 index 0000000..186f476 --- /dev/null +++ b/config.example @@ -0,0 +1,33 @@ +[generic] + # The [generic] section is required, even if nothing is specified + # there. + # When either of these options are specified, nbd-server drops + # privileges to the given user and group after opening ports, but + # _before_ opening files. + user = nbd + group = nbd + # Since version 2.9.17, nbd-server will do exports on a name + # basis (the used name is the name of the section in which the + # export is specified). This however required an incompatible + # protocol change. To enable backwards-compatible port-based + # exports, uncomment the following line: + # oldstyle = true +[export1] + exportname = /export/nbd/export1-file + # The following line will be ignored unless the + # "oldstyle = true" line in the generic section above is + # enabled. + port = 12345 + authfile = /export/nbd/export1-authfile + timeout = 30 + filesize = 10000000 + readonly = false + multifile = false + copyonwrite = false + prerun = dd if=/dev/zero of=%s bs=1k count=500 + postrun = rm -f %s +[otherexport] + exportname = /export/nbd/experiment + # The other options are all optional, except this one in case + # the oldstyle option is used in [generic]: + # port = 12346 diff --git a/nbd-3.24.tar.xz b/nbd-3.24.tar.xz new file mode 100644 index 0000000..d39d4aa --- /dev/null +++ b/nbd-3.24.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6877156d23a7b33f75eee89d2f5c2c91c542afc3cdcb636dea5a88539a58d10c +size 556928 diff --git a/nbd-client.service b/nbd-client.service new file mode 100644 index 0000000..7af5ca4 --- /dev/null +++ b/nbd-client.service @@ -0,0 +1,12 @@ +[Unit] +Description=NBD client connection for %i +Documentation=man:nbd-client(8) man:nbdtab(5) +After=network-online.target + +[Service] +Type=forking +ExecStart=/usr/sbin/nbd-client %i +ExecStop=/usr/sbin/nbd-client -d /dev/%i + +[Install] +WantedBy=multi-user.target diff --git a/nbd-server.service b/nbd-server.service new file mode 100644 index 0000000..b96e489 --- /dev/null +++ b/nbd-server.service @@ -0,0 +1,14 @@ +[Unit] +Description=Network Block Device server +Documentation=man:nbd-server(1) man:nbd-server(5) +After=syslog.target network.target + +[Service] +Type=forking +EnvironmentFile=/etc/sysconfig/nbd-server +ExecStart=/usr/bin/nbd-server $OPTIONS +ExecReload=/usr/bin/kill -HUP $MAINPID +PIDFile=/run/nbd-server.pid + +[Install] +WantedBy=multi-user.target diff --git a/nbd-server.sysconfig b/nbd-server.sysconfig new file mode 100644 index 0000000..e8f582d --- /dev/null +++ b/nbd-server.sysconfig @@ -0,0 +1,2 @@ +# Command line options for nbd-server +OPTIONS="" diff --git a/nbd.changes b/nbd.changes new file mode 100644 index 0000000..15513a6 --- /dev/null +++ b/nbd.changes @@ -0,0 +1,585 @@ +------------------------------------------------------------------- +Sun Apr 10 14:45:08 UTC 2022 - Dirk Müller + +- update to 3.24 (bsc#1196827, bsc#1196828, CVE-2022-26495, CVE-2022-26496): + * https://github.com/advisories/GHSA-q9rw-8758-hccj + +------------------------------------------------------------------- +Sat Dec 11 14:39:22 UTC 2021 - Andreas Stieger + +- nbd 3.23: + * Don't overwrite the hostname with the TLS hostname + +------------------------------------------------------------------- +Sat Oct 16 09:02:50 UTC 2021 - Dirk Müller + +- update to 3.22: + - nbd-server: handle auth for v6-mapped IPv4 addresses + - nbd-client.c: parse the next option in all cases + - configure.ac: silence a few autoconf 2.71 warnings + - spec: Relax NBD_OPT_LIST_META_CONTEXTS + - client: Don't confuse Unix socket with TLS hostname + - server: Avoid deprecated g_memdup + +------------------------------------------------------------------- +Thu Feb 4 11:16:57 UTC 2021 - Dirk Müller + +- update to 3.21: + - Fix --disable-manpages build + - Fix a bug in whitespace handling regarding authorization files + - Support client-side marking of devices as read-only + - Support preinitialized NBD connection (i.e., skip the negotiation). + - Fix the systemd unit file for nbd-client so it works with netlink (the + more common situation nowadays) + +------------------------------------------------------------------- +Fri Sep 18 08:53:47 UTC 2020 - Michał Rostecki + +- Remove firewalld service file - it's in the main firewalld + package now. + +------------------------------------------------------------------- +Fri Sep 11 18:22:18 UTC 2020 - Franck Bui + +- Drop use of DISABLE_RESTART_ON_UPDATE=yes + + This interface is deprecated and %service_del_postun_without_restart + should be preferred. + + However the variable was misused as DISABLE_RESTART_ON_UPDATE=yes + was not supposed to be used with %service_add_post in %post but with + %service_del_postun in %postun section. + + Given that no one noticed that for years let's just drop it. + +------------------------------------------------------------------- +Thu Aug 20 07:03:13 UTC 2020 - Dominique Leuenberger + +- Fix typo in previous commit (%{prefix/lib} ->%{_prefix}/lib). + +------------------------------------------------------------------- +Tue Aug 18 15:27:46 UTC 2020 - Dominique Leuenberger + +- Fix wrong usage of %{_libexecdir} for systemd/firewalld owned + paths. + +------------------------------------------------------------------- +Wed Mar 18 10:36:55 UTC 2020 - Paolo Stivanin + +- Update to 3.20.0 (no changelog) + +------------------------------------------------------------------- +Wed May 29 13:43:41 UTC 2019 - Martin Pluskal + +- Update to version 3.19.0: + * Better error messages in case of unexpected disconnects + * Better compatibility with non-bash sh implementations + (for configure.sh) + * Fix for a segfault in NBD_OPT_INFO handling + * The ability to specify whether to listen on both TCP and Unix + domain sockets, rather than to always do so + * Various minor editorial and spelling fixes in the documentation. + +------------------------------------------------------------------- +Tue Jan 15 15:09:19 UTC 2019 - Martin Pluskal + +- Update to version 1.18.0: + * Client: Add the "-g" option to avoid even trying the NBD_OPT_GO + message + * Server: fixes to inetd mode + * Don't make gnutls and libnl automagic. + * Server: bugfixes in handling of some export names during verification. + * Server: clean supplementary groups when changing user. + * Client: when using the netlink protocol, only set a timeout + when there actually is a timeout, rather than defaulting to 0 + seconds + * Improve documentation on the nbdtab file + * Minor improvements to some error messages + * Improvements to test suite so it works better on non-GNU + userland environments +- Refresh 0001_fix_setgroup.patch + +------------------------------------------------------------------- +Fri Sep 7 08:08:46 UTC 2018 - olaf@aepfle.de + +- Provide %_fillupdir in case it is not defined + +------------------------------------------------------------------- +Tue Jul 24 19:31:37 UTC 2018 - luizluca@gmail.com + +- Add firewalld service file +- Fix some rpmlint warnings: + * 0001_fix_setgroup.patch (gh#NetworkBlockDevice/nbd#79) + * Workaround macro-in-comment (rpmlint bug) + +------------------------------------------------------------------- +Mon Jul 9 14:47:47 UTC 2018 - mpluskal@suse.com + +- Update to version 1.17.0: + * proto: add xNBD command NBD_CMD_CACHE to the spec + * server: do not crash when handling child name + * server: Close socket pair when fork fails + +------------------------------------------------------------------- +Fri Jan 5 13:15:24 UTC 2018 - mpluskal@suse.com + +- Update to version 1.16.2: + * Make the test suite less chatty + * Various build system improvements + * Fixes to the systemd unit to make it work again with recent + systemd + * Point to the nbd mailinglist, rather than to the maintainer's + personal email address, for bug reports. + +------------------------------------------------------------------- +Thu Nov 23 13:46:10 UTC 2017 - rbrown@suse.com + +- Replace references to /var/adm/fillup-templates with new + %_fillupdir macro (boo#1069468) + +------------------------------------------------------------------- +Fri Oct 13 09:58:54 UTC 2017 - olaf@aepfle.de + +- Disable restart on update to keep existing client connections alive + (bsc#1063135) + +------------------------------------------------------------------- +Thu Sep 7 13:21:03 UTC 2017 - olaf@aepfle.de + +- Add nbd-client.service which will provide a nbd@.service to + allow other units to require a nbd@nbd0.service if /etc/nbdtab + is configured accordingly + +------------------------------------------------------------------- +Thu Jun 8 12:07:49 UTC 2017 - mpluskal@suse.com + +- Update to version 3.16.1: + * Only change is a minor bugfix from 3.16, so that + --enable-syslog is unbroken. +- Changes for version 3.16.0: + * Implement the NBD_OPT_GO and NBD_OPT_INFO negotiation options + in both the client and the server, and use them in preference + over NBD_OPT_EXPORT_NAME (but fall back to the latter in case + the serverdoesn't support NBD_OPT_GO). + * Make sure we still run the postrun command, even if the + connection was closed improperly. + * Add a new "waitfile" parameter. + * Make sure that nbd compiles on non-Linux platforms again, in + the face of all variants of the GnuTLS options. + * Various fixes for issues found by Coverity + +------------------------------------------------------------------- +Fri Mar 24 12:16:55 UTC 2017 - mpluskal@suse.com + +- Update to version 3.15.2: + * Fix the copyonwrite situation with multiple threads. This has + been broken since nbd 3.12, where multiple outstanding writes + could corrupt the copyonwrite diff file. + * Build system improvements so that things work again if + nbd-client isn't buildable while GnuTLS is enabled + * Documentation updates + * Fixes to the GnuTLS usage, and the ability to configure the + priority string for that library +- Changes for version 3.15.1: + * minor but crucial fix in the handling of the WRITE_ZEROES + command, which would otherwise not work in cooperation with + TLS. +- Changes for version 3.15.0: + * Implement NBD_CMD_WRITE_ZEROES, for efficiently writing large + numbers of zeroes (server side implementation only) + * (optional) support for NBD_OPT_STARTTLS, using GnuTLS. + * Support for multiplexing commands over multiple connections, + for improving performance (requires Linux 4.10 or above). + * Support for using splice(), also for improving performance + * Protocol errors during negotiation now are accompanied by a + human-readable error string. + * Fix the handling of maxconnections, so that it is not a global + setting (over all exports) but rather a per-export setting. + * Fix handling of unknown options sent to the server. Previously + we would desync from the protocol, causing another error and a + disconnect. + * Produce a log message when the address family of the client + socket does not match the expected address family in the + authfile handling. A proper fix would convert IPv4 sockets to + v6-mapped v4 sockets, but that's much more complicated. + * and various other minor fixes too small to mention here; see + the changelog +- Changes for version 3.14.0: + * Major review of doc/proto.md, with many clarifications. + * Some bug fixes for nbd-server that were discovered during the + extensive updates to proto.md + * Some fixes for non-Linux platforms, + * Some minor incremental improvements to the new nbdtab + functionality, + * Fix the way we tell the kernel about really small exports, + * Removal of references to the no longer supported oldstyle from + all documentation + * Minor updates, clarifications, and syntax fixes for man pages + and other documentation + * Addition of a systemd unit file for nbd-client. This requires a + kernel which issues change events upon disconnect + (commit 37091fdd83), and a udev which correctly sets + SYSTEMD_READY +- Drop init.nbd-server and support for non systemd distributions +- Drop patches: + * nbd-2.9.25-close.diff (upstreamed) + * nbd-2.9.25-doxyfile.diff (no longer needed) +- Do not build doc subpackage + +------------------------------------------------------------------- +Mon Feb 8 13:20:09 UTC 2016 - dmueller@suse.com + +- autoload nbd module + +------------------------------------------------------------------- +Fri Feb 5 17:11:09 UTC 2016 - dmueller@suse.com + +- nbd-server.service: implement reload + +------------------------------------------------------------------- +Sat Jan 23 16:59:39 UTC 2016 - mpluskal@suse.com + +- Update to 3.13 + * This is mainly a bugfix release, containing fixes found in + 3.12.1 by compiling on different architectures, submitting the + build to Coverity Scan, and some analysis of intermittent + failures that found a race condition. + +------------------------------------------------------------------- +Tue Dec 1 17:01:47 UTC 2015 - p.drouand@gmail.com +- Update to version 3.12.1 + * ensures the source to the "nbdtab" man page is correctly shipped + with the rest of the source. +- Changes from version 3.12 + * inetd mode should work again, now using the default export name + in the newstyle protocol + * when specifying an export on the server command line or not specifying + a name on a client command line, the newstyle protocol is used with + the default export name (but a warning will be produced stating + that oldstyle is no longer supported) + * All traces of oldstyle (except a few error messages) have been + removed + * We now listen on IPv4 and IPv6 by default, regardless of what + the system's configuration is like, by explicitly listening both + on 0.0.0.0 and ::. + * Some bugs in the handling of the TRIM command have been removed + * nbd *client now uses readit() in the negotiation, rather than + plain non *retrying read(). + * It is now possible to listen on multiple addresses; the + "listenaddr" parameter has been changed into a comma *separated + list of addresses to listen on + * nbd *client now supports an nbdtab file, which allows connecting + a device by just using the device name + * nbd *server now uses a GThreadPool to implement asynchronous handling + of requests + * Punching holes on files is now supported on cygwin, too. +- Remove no-return-nonvoid.patch; fixed on upstream release + +------------------------------------------------------------------- +Thu May 28 11:32:18 UTC 2015 - mpluskal@suse.com + +- Update to 3.11 + * nbd-server: fix unsafe signal handling + * define error values as part of the protocol + * docs/proto: clarify NBD_CMD_FLUSH +- Drop nbd_signaling_CVE-2015-0847.patch as fix is included in + upstream + +------------------------------------------------------------------- +Mon May 11 08:13:48 UTC 2015 - mpluskal@suse.com + +- Fix CVE-2015-0847 + * nbd_signaling_CVE-2015-0847.patch + +------------------------------------------------------------------- +Fri Apr 17 13:27:19 UTC 2015 - mpluskal@suse.com + +- Update to 3.10 + * There really is only one change since 3.9: drop of the + "oldstyle" support from nbd-server and nbd-client. + +------------------------------------------------------------------- +Thu Mar 5 12:28:06 UTC 2015 - mpluskal@suse.com + +- Cleanup spec-file with spec-cleaner +- Do not generate config.example from README + * add config.example as source +- Add unit file (nbd-server.service) +- Add sysconfig template (nbd-server.sysconfig) +- Add no-return-nonvoid.patch +- Update requirements +- Update to 3.9 + * AF_UNIX support + * Fixed test suite on non-GNU getopt() implementations + * New "treefiles" mode, which exports a gazillion of page-sized + files; useful for exporting things which are stored on an + SSHFS or amazon AWS (trough FUSE) or similar, where every + write causes an upload to the backend storage + * New "cowdir" option, allowing to specify where copy-on-write + files are written. + * Minor changes so that nbd-client can now also be compiled for + the Android platform. This required removal of the -swap + command line option, which requires the mlockall() system + call, unavailable on Android. + * Protocol update: a reserved bit is used to avoid sending + the 124 bytes of useless data at the beginning of the + negotiation. The change is implemented so that things will + still work with clients not supporting this option, however. + * gznbd is now built by the same build system, rather than + a separate one. Note however that gznbd is still + unmaintained; it should be considered a "contrib" feature. + * "nbd-server -V" will now output the nbd-server version number. + * Various fixes found through Coverity and the clang static + analyzer, and lots of other minor things too small to + mention here. + +------------------------------------------------------------------- +Sun Nov 09 19:27:00 UTC 2014 - Led + +- fix bashisms in pre script + +------------------------------------------------------------------- +Thu Apr 18 19:38:29 UTC 2013 - dmueller@suse.com + +- update to 3.3: + * and various bugfixes, upgrading is strongly recommended + * Fix various nbd-server misbehave bugs + +------------------------------------------------------------------- +Tue Jul 10 07:08:17 UTC 2012 - aj@suse.de + +- Fix restart_on_update usage. + +------------------------------------------------------------------- +Fri May 18 13:44:05 UTC 2012 - tabraham@novell.com + +- Update to nbd-3.1 + * minor bug fixes + * new feature: ability for the client to list the exports a server + supports + +------------------------------------------------------------------- +Wed Feb 29 15:51:37 UTC 2012 - tabraham@novell.com + +- Update to nbd-3.0 + * minor bug fixes + +- removed obsolete nbd-2.9.25-have_falloc_ph.diff +- compile with -fno-strict-aliasing to prevent breakage with new gcc + +------------------------------------------------------------------- +Thu Jan 5 20:31:57 UTC 2012 - tabraham@novell.com + +- Update to nbd-2.9.25 + * TRIM now uses FALLOC_FL_PUNCH_HOLE + * minor bug fixes + +- removed obsolete nbd-2.9.20-bigendian.diff +- refreshed nbd-2.9.20-close.diff + +------------------------------------------------------------------- +Fri Sep 16 13:46:09 UTC 2011 - rfno@fietze-home.de + +- Install nbd-server.5 man page + +------------------------------------------------------------------- +Mon Apr 4 17:30:17 CEST 2011 - ms@suse.de + +- socklen_t is always 32bit, size_t is 64bit. so a classical + big endian 64bit error (bnc #674281) + +------------------------------------------------------------------- +Fri Feb 25 12:40:16 CET 2011 - ms@suse.de + +- Update to nbd-2.9.20: + * Documentation update + * Fix buffer size checking (bnc #674281) + * Extend test suite and fix named exports + +------------------------------------------------------------------- +Wed Aug 5 11:58:52 CEST 2009 - ms@suse.de + +- fixed missing close to open (bnc #528272) + +------------------------------------------------------------------- +Thu Jul 9 11:41:55 CEST 2009 - ms@suse.de + +- Update to nbd-2.9.13: + * Documentation update + * Don't try working on partitions + When a partition is given to the -d or -c command line options, reduce + it to the master device instead. This assumes udev-style naming + of device entries, though. + * Fix autodetection + Everything else in nbd-server was already 64bit-clean, but this part, + where the size of a block device is autodected, wasn't. + Replace the ioctl() to BLKGETSIZE with its 64bit version, so that trying + to detect the size of a multi-terabyte block device does not fail. + * Avoid unaligned access + * Actually go daemon + just doing chdir("/") leave file descriptors open, which is not ideal. + Doing it this way closes everything, including any system-specific + things we're not aware of. + * Remove support for timeout option + +------------------------------------------------------------------- +Mon May 4 10:40:15 CEST 2009 - ms@suse.de + +- Update to nbd-2.9.12: + * use atoll instead of atol ... so that multi-terabyte exports work, too + * Change meaning of -swap option: rather than trying to use a kernel patch + which has been effectively dead since sometime around 2.1.something, do an + mlockall() so that the kernel won't throw us out. The MCL_CURRENT | MCL_FUTURE + bit might prove to be problematic, but if so, we'll deal with it when + we get there + * Use right printf() format string + +------------------------------------------------------------------- +Wed Aug 20 08:13:31 CEST 2008 - garloff@suse.de + +- Update to nbd-2.9.11: + * nbd-client: new option -c to check for connection, -d to + drop connection, -persist to infinitely retry connections + dropped by server. timeout= setting + * nbd-server: drop autoreadonly option + +------------------------------------------------------------------- +Thu Nov 15 14:26:56 CET 2007 - garloff@suse.de + +- Update to nbd-2.9.9: + * Document -C option of nbd-server. + * Fix name of /var/run/ file. + +------------------------------------------------------------------- +Wed Nov 7 22:12:26 CET 2007 - garloff@suse.de + +- Split nbd into nbd and nbd-doc packages. +- Update to nbd-2.9.8: + * nbd-server can now setuid to specified user and group. + * prerun and postrun scripts can be specified. + * IP address to bind to (listenaddress) can be configured. + * Socket Direct Protocol (sdp) -- not enabled. + * server exits now after connection has gone (oops!). + * nbd-client: timeout parameter. + +------------------------------------------------------------------- +Mon Jul 30 15:51:16 CEST 2007 - garloff@suse.de + +- Convert options from old nbd-server.conf to new nbd-server/config + on update and drop support for old config file syntax. +- Fix daemonize(0) segfault and pid filename. +- Fix compiler warnings. +- Fix /dev filename docu. +- Use startproc, killproc, checkproc in init script +- nbd-server does not support SIGHUP, fix init script accordingly. + +------------------------------------------------------------------- +Tue Jul 17 00:54:45 CEST 2007 - garloff@suse.de + +- Update to nbd-2.9.5: + * Support for more platforms, pkgconfig, debug build. + * -o option to convert cmdline options to config file. + * Fix duplication in handling nonblocking server socket. + +------------------------------------------------------------------- +Mon Mar 12 23:45:45 CET 2007 - garloff@suse.de + +- Update to 2.9.2: + * make child socket nonblocking + * Reintegrate fix for 64bit on looking for file size. + * Fix cross-compiling + * Search for libraries to allow linking on Solaris +- Update to 2.9.1: + * A fix for a piece of code following a null pointer, and one + for a memory leak (if only minor). +- Update to 2.9.0: + * * Configuration file support + * The ability to server multiple nbd-server exports from one server + * Better multiple-file support (files can now be of any random size) + * Better support for virtualizing servers (in addition to replacing + %s with the client's IP address, it is now also possible to use + other options which allow for hashed directories) + * Support for changing uid and gid after startup + * The ability to do the copy-on-write stuff with a sparse file rather + than a mapped file (specified by a config file option), which may be + slightly faster. + +------------------------------------------------------------------- +Sat Nov 18 01:49:07 CET 2006 - garloff@suse.de + +- Add nbd-server init script (parses /etc/nbd-server.conf). + +------------------------------------------------------------------- +Thu Oct 19 14:03:52 CEST 2006 - garloff@suse.de + +- Update to nbd-2.8.7: + * A fix for build against nbd.h for kernel 2.6.18 (and above, + presumably) + +------------------------------------------------------------------- +Fri Oct 13 00:50:12 CEST 2006 - ro@suse.de + +- include linux/types.h before linux/nbd.h + +------------------------------------------------------------------- +Mon Aug 7 15:32:39 CEST 2006 - garloff@suse.de + +- Update to nbd-2.8.6: + * performance/reliability improvements: Use select() rather than + accept() and waitpid() with WNOHANG rather than wait(). +- Update to nbd-2.8.5: + * -persist option. + * Add export verification. + * Make sure queue is empty for write requests to read-only export. +- Update to nbd-2.8.4: + * Includes the previous fix (closing server socket) + +------------------------------------------------------------------- +Mon Mar 6 14:14:26 CET 2006 - garloff@suse.de + +- Make sure children quit when they finish serving, rather than + trying to do stuff with a server socket that they've closed + already in a loop. Whoops. (Fix from nbd-2.8.4.) + +------------------------------------------------------------------- +Wed Jan 25 21:38:34 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Mon Jan 23 16:07:50 CET 2006 - garloff@suse.de + +- Enable -fstack-protector. + +------------------------------------------------------------------- +Mon Jan 9 14:41:25 CET 2006 - garloff@suse.de + +- Update to nbd-2.8.3: + * CVE-2005-3534. + * A fix for 64bit systems regarding the BLKGETSIZE ioctl(). + * Better handling of SIGCHLD. + +------------------------------------------------------------------- +Tue Dec 20 00:05:22 CET 2005 - garloff@suse.de + +- Update to nbd-2.8.2: + * Enable LFS by default. + +------------------------------------------------------------------- +Wed Nov 2 22:27:40 CET 2005 - dmueller@suse.de + +- don't build as root + +------------------------------------------------------------------- +Fri Oct 28 10:22:59 CEST 2005 - garloff@suse.de + +- Update to version 2.8.1. +- Documentation added. + +------------------------------------------------------------------- +Mon Jul 4 18:24:39 CEST 2005 - garloff@suse.de + +- Initial creation of package. + +------------------------------------------------------------------- +Mon Jul 4 18:24:39 CEST 2005 - diff --git a/nbd.spec b/nbd.spec new file mode 100644 index 0000000..4786a1c --- /dev/null +++ b/nbd.spec @@ -0,0 +1,151 @@ +# +# spec file for package nbd +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%if ! %{defined _fillupdir} + %define _fillupdir %{_localstatedir}/adm/fillup-templates +%endif +Name: nbd +Version: 3.24 +Release: 0 +Summary: Network Block Device Server and Client Utilities +License: GPL-2.0-or-later +Group: Productivity/Networking/Other +URL: https://nbd.sourceforge.io/ +Source0: https://sourceforge.net/projects/nbd/files/nbd/%{version}/nbd-%{version}.tar.xz +Source1: %{name}-server.service +Source3: config.example +Source4: nbd-server.sysconfig +Source5: nbd-client.service +Patch1: 0001_fix_setgroup.patch +BuildRequires: bison +BuildRequires: pkgconfig +BuildRequires: systemd-rpm-macros +BuildRequires: pkgconfig(glib-2.0) >= 2.26.0 +BuildRequires: pkgconfig(gnutls) +BuildRequires: pkgconfig(libnl-3.0) +Requires(pre): %fillup_prereq +Requires(pre): coreutils +%systemd_requires + +%description +This package contains nbd-server. It is the server backend for the nbd +network block device driver that's in the Linux kernel. + +nbd can be used to have a filesystem stored on another machine. It does +provide a block device, not a file system; so unless you put a +clustering filesystem on top of it, you can't access it simultaneously +from more than one client. Use NFS or a real cluster FS (such as +ocfs2) if you want to do this. nbd-server can export a file (which may +contain a filesystem image) or a partition. Swapping over nbd is +possible as well, though it's said not to be safe against OOM and +should not be used for that case. nbd-server also has a copy-on-write +mode where changes are saved to a separate file and thrown away when +the connection closes. + +The package also contains the nbd-client tools, which you need to +configure the nbd devices on the client side. + +%prep +%setup -q +%patch1 -p1 + +%build +%configure +%make_build + +%install +%make_install + +# install systemd unit +install -D -p -m 0644 %{SOURCE5} \ + %{buildroot}/%{_unitdir}/%{name}@.service +install -D -p -m 0644 %{SOURCE1} \ + %{buildroot}/%{_unitdir}/%{name}-server.service +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-server + +# autoload nbd module +install -d -m 755 %{buildroot}%{_prefix}/lib/modules-load.d/ +echo "nbd" > %{buildroot}%{_prefix}/lib/modules-load.d/%{name}.conf + +#echo "#Port file options" > $RPM_BUILD_ROOT/etc/nbd-server.conf +mkdir -p %{buildroot}%{_sysconfdir}/nbd-server +touch %{buildroot}%{_sysconfdir}/nbd-server/config +touch %{buildroot}%{_sysconfdir}/nbd-server/allow +install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/nbd-server/config.example +install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.%{name}-server + +%post +%service_add_post %{name}-server.service +%fillup_only -n nbd-server +if test -e %{_sysconfdir}/nbd-server.conf; then + # Do we have to create a generic section? + unset generic + if test -e %{_sysconfdir}/nbd-server/config; then generic=1; fi + grep -vE '^(#|[[:blank:]]*$)' %{_sysconfdir}/nbd-server.conf | + while read port file opts; do + if test -z "$generic"; then + cat >%{_sysconfdir}/nbd-server/config <<-EOF + + [generic] + # No generic options yet + + EOF + generic=1 + fi + FN=${file%/*} + nm="cvt.$port.${FN##*/}.${file##*/}" + echo " ... convert $port $file $opts -> $nm" + %{_bindir}/nbd-server $port $file $opts -o "$nm" >> %{_sysconfdir}/nbd-server/config + done + mv %{_sysconfdir}/nbd-server.conf %{_sysconfdir}/nbd-server.conf.converted +fi + +%postun +%service_del_postun %{name}-server.service + +%pre +%service_add_pre %{name}-server.service + +%preun +%service_del_preun %{name}-server.service + +%files +%{_sbindir}/nbd-client +%{_bindir}/nbd-server +%{_bindir}/nbd-trdump +%{_bindir}/nbd-trplay +%{_sbindir}/min-nbd-client +%{_sbindir}/rcnbd-server +%{_unitdir}/%{name}@.service +%{_unitdir}/%{name}-server.service +%{_mandir}/man1/nbd-server.1%{?ext_man} +%{_mandir}/man1/nbd-trdump.1%{?ext_man} +%{_mandir}/man1/nbd-trplay.1%{?ext_man} +%{_mandir}/man5/nbd-server.5%{?ext_man} +%{_mandir}/man8/nbd-client.8%{?ext_man} +%{_mandir}/man5/nbdtab.5%{?ext_man} +%doc README.md +%dir %{_sysconfdir}/nbd-server +%ghost %config(noreplace) %{_sysconfdir}/nbd-server/config +%ghost %config(noreplace) %{_sysconfdir}/nbd-server/allow +%config %{_sysconfdir}/nbd-server/config.example +%dir %{_prefix}/lib/modules-load.d/ +%{_prefix}/lib/modules-load.d/nbd.conf +%{_fillupdir}/sysconfig.%{name}-server + +%changelog