git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01e563b
)
vfs_gpfs: Preserve errno across unbecome_root call
author
Christof Schmitt
<cs@samba.org>
Thu, 16 Jan 2020 21:15:15 +0000
(14:15 -0700)
committer
Jeremy Allison
<jra@samba.org>
Tue, 21 Jan 2020 22:08:41 +0000
(22:08 +0000)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_gpfs.c
patch
|
blob
|
history
diff --git
a/source3/modules/vfs_gpfs.c
b/source3/modules/vfs_gpfs.c
index 3967a7c723af383be386fc001e3a7312d71dc9d4..1c843db503d263d59ccf079565dcc6107845e490 100644
(file)
--- a/
source3/modules/vfs_gpfs.c
+++ b/
source3/modules/vfs_gpfs.c
@@
-252,6
+252,7
@@
static int vfs_gpfs_setlease(vfs_handle_struct *handle,
if (config->leases) {
int gpfs_lease_type = lease_type_to_gpfs(leasetype);
+ int saved_errno = 0;
/*
* Ensure the lease owner is root to allow
@@
-259,7
+260,14
@@
static int vfs_gpfs_setlease(vfs_handle_struct *handle,
*/
become_root();
ret = gpfswrap_set_lease(fsp->fh->fd, gpfs_lease_type);
+ if (ret < 0) {
+ saved_errno = errno;
+ }
unbecome_root();
+
+ if (saved_errno != 0) {
+ errno = saved_errno;
+ }
}
failure: