aboutsummaryrefslogtreecommitdiffstats
path: root/mount.cifs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2012-01-16 13:22:28 -0500
committerJeff Layton <jlayton@samba.org>2012-01-16 13:22:28 -0500
commit92be8b6775958814d39fb19247ff85947a2e4f9e (patch)
tree1591c2a50b33440a8109889f1862aac3bb41e8ed /mount.cifs.c
parentf46dd7661cfb87257c95081fc2071c934bfbbb16 (diff)
downloadcifs-utils-92be8b6775958814d39fb19247ff85947a2e4f9e.tar.gz
cifs-utils-92be8b6775958814d39fb19247ff85947a2e4f9e.tar.xz
cifs-utils-92be8b6775958814d39fb19247ff85947a2e4f9e.zip
mount.cifs: handle errors from rename() in del_mtab
The new del_mtab code ignored errors from rename(). Make it handle that error as well like it does other errors. Cc: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'mount.cifs.c')
-rw-r--r--mount.cifs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index af071c1..78a4811 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -1700,7 +1700,11 @@ del_mtab(char *mountpoint)
goto del_mtab_error;
}
- rename(mtabtmpfile, MOUNTED);
+ if (rename(mtabtmpfile, MOUNTED)) {
+ fprintf(stderr, "del_mtab: error %d when renaming mtab in place\n", errno);
+ rc = EX_FILEIO;
+ goto del_mtab_error;
+ }
del_mtab_exit:
unlock_mtab();