Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b0f4499e9215
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7e6756af4194
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jun 6, 2019

  1. 2
    Copy the full SHA
    7e6756a View commit details
Showing with 104 additions and 1 deletion.
  1. +3 −1 pkgs/os-specific/linux/nfs-utils/default.nix
  2. +101 −0 pkgs/os-specific/linux/nfs-utils/nfsdcld-sqlite-format.patch
4 changes: 3 additions & 1 deletion pkgs/os-specific/linux/nfs-utils/default.nix
Original file line number Diff line number Diff line change
@@ -47,7 +47,9 @@ stdenv.mkDerivation rec {
]
++ lib.optional (stdenv ? glibc) "--with-rpcgen=${stdenv.glibc.bin}/bin/rpcgen";

patches = lib.optionals stdenv.hostPlatform.isMusl [
patches = [
./nfsdcld-sqlite-format.patch
] ++ lib.optionals stdenv.hostPlatform.isMusl [
(fetchpatch {
url = "https://raw.githubusercontent.com/alpinelinux/aports/cb880042d48d77af412d4688f24b8310ae44f55f/main/nfs-utils/0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch";
sha256 = "0rrddrykz8prk0dcgfvmnz0vxn09dbgq8cb098yjjg19zz6d7vid";
101 changes: 101 additions & 0 deletions pkgs/os-specific/linux/nfs-utils/nfsdcld-sqlite-format.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
diff -ru3 nfs-utils-2.3.4-old/utils/nfsdcld/sqlite.c nfs-utils-2.3.4-new/utils/nfsdcld/sqlite.c
--- nfs-utils-2.3.4-old/utils/nfsdcld/sqlite.c 2019-05-10 22:09:49.000000000 +0300
+++ nfs-utils-2.3.4-new/utils/nfsdcld/sqlite.c 2019-06-06 15:57:54.384549915 +0300
@@ -57,6 +57,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
+#include <inttypes.h>
#include <sqlite3.h>
#include <linux/limits.h>

@@ -535,7 +536,7 @@
xlog(L_ERROR, "Unable to begin transaction: %s", err);
goto rollback;
}
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016" PRIx64 "\";",
current_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -550,7 +551,7 @@
xlog(L_ERROR, "Unable to clear records from current epoch: %s", err);
goto rollback;
}
- ret = snprintf(buf, sizeof(buf), "INSERT INTO \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "INSERT INTO \"rec-%016" PRIx64 "\" "
"SELECT id FROM attached.clients;",
current_epoch);
if (ret < 0) {
@@ -703,7 +704,7 @@
int ret;
sqlite3_stmt *stmt = NULL;

- ret = snprintf(buf, sizeof(buf), "INSERT OR REPLACE INTO \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "INSERT OR REPLACE INTO \"rec-%016" PRIx64 "\" "
"VALUES (?);", current_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -748,7 +749,7 @@
int ret;
sqlite3_stmt *stmt = NULL;

- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016" PRIx64 "\" "
"WHERE id==?;", current_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -798,7 +799,7 @@
int ret;
sqlite3_stmt *stmt = NULL;

- ret = snprintf(buf, sizeof(buf), "SELECT count(*) FROM \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "SELECT count(*) FROM \"rec-%016" PRIx64 "\" "
"WHERE id==?;", recovery_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -873,7 +874,7 @@
tcur++;

ret = snprintf(buf, sizeof(buf), "UPDATE grace "
- "SET current = %ld, recovery = %ld;",
+ "SET current = %" PRId64 ", recovery = %" PRId64 ";",
(int64_t)tcur, (int64_t)trec);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -891,7 +892,7 @@
goto rollback;
}

- ret = snprintf(buf, sizeof(buf), "CREATE TABLE \"rec-%016lx\" "
+ ret = snprintf(buf, sizeof(buf), "CREATE TABLE \"rec-%016" PRIx64 "\" "
"(id BLOB PRIMARY KEY);",
tcur);
if (ret < 0) {
@@ -915,7 +916,7 @@
* values in the grace table, just clear out the records for
* the current reboot epoch.
*/
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016" PRIx64 "\";",
tcur);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -976,7 +977,7 @@
goto rollback;
}

- ret = snprintf(buf, sizeof(buf), "DROP TABLE \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "DROP TABLE \"rec-%016" PRIx64 "\";",
recovery_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");
@@ -1027,7 +1028,7 @@
return -EINVAL;
}

- ret = snprintf(buf, sizeof(buf), "SELECT * FROM \"rec-%016lx\";",
+ ret = snprintf(buf, sizeof(buf), "SELECT * FROM \"rec-%016" PRIx64 "\";",
recovery_epoch);
if (ret < 0) {
xlog(L_ERROR, "sprintf failed!");