File libnfs-5.0.3-glibc-2_43.patch of Package libnfs
Taken from https://github.com/sahlberg/libnfs/pull/576
https://github.com/sahlberg/libnfs/pull/576/commits/89a795fee97a3da348c28dbd58500100a13dcec0
https://github.com/sahlberg/libnfs/pull/576/commits/6a06cb6dba0065705179329729cca2f95a842a63
Index: libnfs-libnfs-5.0.3/lib/libnfs.c
===================================================================
--- libnfs-libnfs-5.0.3.orig/lib/libnfs.c
+++ libnfs-libnfs-5.0.3/lib/libnfs.c
@@ -336,9 +336,8 @@ nfs_set_context_args(struct nfs_context
} else if (!strcmp(arg, "mountport")) {
nfs_set_mountport(nfs, atoi(val));
} else if (!strcmp(arg, "readdir-buffer")) {
- char *strp = strchr(val, ',');
+ const char *strp = strchr(val, ',');
if (strp) {
- *strp = 0;
strp++;
nfs_set_readdir_max_buffer_size(nfs, atoi(val), atoi(strp));
} else {
Index: libnfs-libnfs-5.0.3/lib/nfs_v3.c
===================================================================
--- libnfs-libnfs-5.0.3.orig/lib/nfs_v3.c
+++ libnfs-libnfs-5.0.3/lib/nfs_v3.c
@@ -3218,7 +3218,7 @@ int
nfs3_mknod_async(struct nfs_context *nfs, const char *path, int mode, int dev,
nfs_cb cb, void *private_data)
{
- char *ptr;
+ const char *ptr;
struct mknod_cb_data *cb_data;
cb_data = malloc(sizeof(struct mknod_cb_data));
@@ -3236,8 +3236,8 @@ nfs3_mknod_async(struct nfs_context *nfs
"buffer for mknod path");
return -1;
}
- ptr = strrchr(cb_data->path, '/');
- *ptr = 0;
+ char *ptr2 = strrchr(cb_data->path, '/');
+ *ptr2 = 0;
} else {
cb_data->path = malloc(strlen(path) + 2);
if (cb_data->path == NULL) {
@@ -3327,7 +3327,7 @@ nfs3_unlink_async(struct nfs_context *nf
void *private_data)
{
char *new_path;
- char *ptr;
+ const char *ptr;
ptr = strrchr(path, '/');
if (ptr) {
@@ -3337,8 +3337,8 @@ nfs3_unlink_async(struct nfs_context *nf
"buffer for unlink path");
return -1;
}
- ptr = strrchr(new_path, '/');
- *ptr = 0;
+ char *ptr2 = strrchr(new_path, '/');
+ *ptr2 = 0;
} else {
new_path = malloc(strlen(path) + 2);
if (new_path == NULL) {
@@ -3693,7 +3693,7 @@ nfs3_rmdir_async(struct nfs_context *nfs
void *private_data)
{
char *new_path;
- char *ptr;
+ const char *ptr;
ptr = strrchr(path, '/');
if (ptr) {
@@ -3703,8 +3703,8 @@ nfs3_rmdir_async(struct nfs_context *nfs
"buffer for rmdir path");
return -1;
}
- ptr = strrchr(new_path, '/');
- *ptr = 0;
+ char *ptr2 = strrchr(new_path, '/');
+ *ptr2 = 0;
} else {
new_path = malloc(strlen(path) + 2);
if (new_path == NULL) {
@@ -3795,7 +3795,7 @@ nfs3_mkdir2_async(struct nfs_context *nf
nfs_cb cb, void *private_data)
{
char *new_path;
- char *ptr;
+ const char *ptr;
ptr = strrchr(path, '/');
if (ptr) {
@@ -3805,8 +3805,8 @@ nfs3_mkdir2_async(struct nfs_context *nf
"buffer for mkdir path");
return -1;
}
- ptr = strrchr(new_path, '/');
- *ptr = 0;
+ char *ptr2 = strrchr(new_path, '/');
+ *ptr2 = 0;
} else {
new_path = malloc(strlen(path) + 2);
if (new_path == NULL) {