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 290086 Details for
Bug 426320
[PATCH] Wrong directory ownership on ext* volumes
[?]
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 to fix directory ownership
fix_dir_ownership.patch (text/plain), 2.20 KB, created by
Nathaniel McCallum
on 2007-12-20 00:50:08 UTC
(
hide
)
Description:
Patch to fix directory ownership
Filename:
MIME Type:
Creator:
Nathaniel McCallum
Created:
2007-12-20 00:50:08 UTC
Size:
2.20 KB
patch
obsolete
>diff -Nru hal-0.5.10.orig/tools/hal-storage-mount.c hal-0.5.10/tools/hal-storage-mount.c >--- hal-0.5.10.orig/tools/hal-storage-mount.c 2007-08-27 13:22:46.000000000 -0400 >+++ hal-0.5.10/tools/hal-storage-mount.c 2007-12-19 19:35:36.000000000 -0500 >@@ -37,7 +37,6 @@ > #include <sys/ucred.h> > #include <sys/mount.h> > #include <limits.h> >-#include <pwd.h> > #elif sun > #include <sys/mnttab.h> > #include <sys/vfstab.h> >@@ -45,6 +44,7 @@ > #include <mntent.h> > #endif > #include <sys/types.h> >+#include <pwd.h> > #include <unistd.h> > #include <errno.h> > #include <syslog.h> >@@ -466,11 +466,9 @@ > gboolean is_remount; > gboolean explicit_mount_point_given; > const char *end; >-#ifdef __FreeBSD__ > struct passwd *pw; > uid_t calling_uid; > gid_t calling_gid; >-#endif > const char *label; > const char *uuid; > >@@ -824,22 +822,6 @@ > printf ("Cannot create '%s'\n", mount_dir); > unknown_error ("Cannot create mount directory"); > } >- >-#ifdef __FreeBSD__ >- calling_uid = (uid_t) strtol (invoked_by_uid, (char **) NULL, 10); >- pw = getpwuid (calling_uid); >- if (pw != NULL) { >- calling_gid = pw->pw_gid; >- } else { >- calling_gid = 0; >- } >- if (chown (mount_dir, calling_uid, calling_gid) != 0) { >- printf ("Cannot chown '%s' to uid: %d, gid: %d\n", mount_dir, >- calling_uid, calling_gid); >- g_rmdir (mount_dir); >- unknown_error ("Failed to chown mount directory"); >- } >-#endif > } > > >@@ -933,7 +915,6 @@ > unknown_error ("Cannot spawn " MOUNT); > } > >- > if (exit_status != 0) { > char errstr[] = "mount: unknown filesystem type"; > >@@ -959,6 +940,21 @@ > } > } > >+ /* Make sure this mount point is owned by the person who asked to mount it */ >+ calling_uid = (uid_t) strtol (invoked_by_uid, (char **) NULL, 10); >+ pw = getpwuid (calling_uid); >+ if (pw != NULL) { >+ calling_gid = pw->pw_gid; >+ } else { >+ calling_gid = 0; >+ } >+ if (chown (mount_dir, calling_uid, calling_gid) != 0) { >+ printf ("Cannot chown '%s' to uid: %d, gid: %d\n", mount_dir, >+ calling_uid, calling_gid); >+ g_rmdir (mount_dir); >+ unknown_error ("Failed to chown mount directory"); >+ } >+ > if (!is_remount) { > if (rename ("/media/.hal-mtab~", "/media/.hal-mtab") != 0) { > printf ("rename(2) failed, errno=%d -> '%s'\n", errno, strerror (errno));
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 426320
:
290086
|
290166