X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Ffstab.c;h=7668167ba61edaec579c222b5e8ba3cd4d3f6068;hp=e19e58b0d95fa9d246e6a0034adf5480644bf6c2;hb=3724317e223d46908aac2405bbd73ea2de4f36e5;hpb=d62365079f711b25e73522b2af380abc2a7e2788 diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c index e19e58b..7668167 100644 --- a/utils/mount/fstab.c +++ b/utils/mount/fstab.c @@ -546,8 +546,12 @@ update_mtab (const char *dir, struct mntent *instead) * from the present mtab before renaming. */ struct stat sbuf; - if (stat (MOUNTED, &sbuf) == 0) - chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid); + if (stat (MOUNTED, &sbuf) == 0) { + if (chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid) < 0) { + nfs_error(_("%s: error changing owner of %s: %s"), + progname, MOUNTED_TEMP, strerror (errno)); + } + } } /* rename mtemp to mtab */