Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 871329 Details for
Bug 1073384
gfs2_grow changes mtab permissions to 600
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch backported from RHEL6
0001-libgfs2-Fix-up-remove_mtab_entry.patch (text/plain), 2.06 KB, created by
Andrew Price
on 2014-03-06 10:39:26 UTC
(
hide
)
Description:
Patch backported from RHEL6
Filename:
MIME Type:
Creator:
Andrew Price
Created:
2014-03-06 10:39:26 UTC
Size:
2.06 KB
patch
obsolete
>From 1c64c5311961697a66ba3ee745e7b1d847409c8c Mon Sep 17 00:00:00 2001 >From: Andrew Price <anprice@redhat.com> >Date: Tue, 4 Feb 2014 00:00:05 -0600 >Subject: [PATCH] libgfs2: Fix up remove_mtab_entry > >mkstemp was creating the temporary mtab file with overly tight >permissions causing /etc/mtab to end up with an 0600 mode instead of the >regular 0644. This patch resets the mode to 0644 by calling fchmod on >the file descriptor returned by mkstemp. > >It also removes a superfluous close() call and sets the temp filename >char array on initialisation instead of using strcpy(). > >Resolves: rhbz#1073384 > >Signed-off-by: Andrew Price <anprice@redhat.com> >--- > gfs2/libgfs2/misc.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c >index 6a1f07f..838209e 100644 >--- a/gfs2/libgfs2/misc.c >+++ b/gfs2/libgfs2/misc.c >@@ -227,7 +227,7 @@ static void remove_mtab_entry(struct gfs2_sbd *sdp) > { > FILE *mtab, *mtabnew; > struct mntent *mountent; >- char mtab_tmpfn[PATH_MAX]; >+ char mtab_tmpfn[] = "/etc/mtab.XXXXXX"; > int error, fd; > mode_t mask; > >@@ -235,7 +235,7 @@ static void remove_mtab_entry(struct gfs2_sbd *sdp) > if (mtab == NULL) > die("Couldn't open /etc/mtab for writing: %s\n", > strerror(errno)); >- strcpy(mtab_tmpfn, "/etc/mtab.XXXXXX"); >+ > mask = umask(S_IXUSR | S_IRWXG | S_IRWXO); > fd = mkstemp(mtab_tmpfn); > umask(mask); >@@ -243,6 +243,9 @@ static void remove_mtab_entry(struct gfs2_sbd *sdp) > die("Couldn't open temporary mtab file for writing: %s\n", > strerror(errno)); > >+ if (fchmod(fd, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH)) >+ die("Couldn't change mode of temporary mtab: %s\n", strerror(errno)); >+ > mtabnew = fdopen(fd, "wt"); > if (mtabnew == NULL) > die("Couldn't open %s for writing : %s\n", mtab_tmpfn, >@@ -257,8 +260,7 @@ static void remove_mtab_entry(struct gfs2_sbd *sdp) > } > > endmntent(mtab); >- fclose(mtabnew); >- close(fd); >+ fclose(mtabnew); /* Closes underlying fd */ > if (rename(mtab_tmpfn, "/etc/mtab")) > fprintf(stderr, "Unable to remove mount entry from mtab.\n"); > } >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1073384
: 871329