Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 455318 Details for
Bug 601878
sys-auth/consolekit-1.1.0-r1 trap int3 in ck-remove-directory during shutdown
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for consolekit 1.1.0-r1
ConsoleKit2-1.1.0-r1-ck-remove-directory-trap.patch (text/plain), 2.53 KB, created by
Oliver Schwabedissen
on 2016-12-07 05:57:53 UTC
(
hide
)
Description:
Patch for consolekit 1.1.0-r1
Filename:
MIME Type:
Creator:
Oliver Schwabedissen
Created:
2016-12-07 05:57:53 UTC
Size:
2.53 KB
patch
obsolete
>diff -Naur ConsoleKit2-1.1.0.orig/tools/ck-remove-directory.c ConsoleKit2-1.1.0/tools/ck-remove-directory.c >--- ConsoleKit2-1.1.0.orig/tools/ck-remove-directory.c 2016-01-23 02:04:17.000000000 +0100 >+++ ConsoleKit2-1.1.0/tools/ck-remove-directory.c 2016-12-06 06:47:55.595428248 +0100 >@@ -46,7 +46,7 @@ > > > static void >-become_user (uid_t uid, const gchar* dest) >+become_user (uid_t uid) > { > int res; > struct passwd *pwent; >@@ -56,11 +56,6 @@ > exit (1); > } > >- if (dest == NULL) { >- g_critical ("invalid dest"); >- exit (1); >- } >- > errno = 0; > pwent = getpwuid (uid); > if (pwent == NULL) { >@@ -70,17 +65,17 @@ > > /* set the group */ > errno = 0; >- res = setgid (pwent->pw_gid); >+ res = setegid (pwent->pw_gid); > if (res == -1) { >- g_warning ("Error performing setgid: %s", g_strerror (errno)); >+ g_warning ("Error performing setegid: %s", g_strerror (errno)); > exit (1); > } > > /* become the user */ > errno = 0; >- res = setuid (uid); >+ res = seteuid (uid); > if (res == -1) { >- g_warning ("Error performing setuid: %s", g_strerror (errno)); >+ g_warning ("Error performing seteuid: %s", g_strerror (errno)); > exit (1); > } > } >@@ -91,7 +86,7 @@ > int typeflag, > struct FTW *ftwbuf) > { >- int ret = remove (fpath); >+ int ret = ftwbuf->level > 0 ? remove (fpath) : 0; > > if (ret) { > g_error ("Failed to remove %s, reason was: %s", fpath, strerror(errno)); >@@ -104,7 +99,26 @@ > static int > remove_dest_dir (const gchar *dest) > { >- return nftw(dest, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); >+ int ret; >+ >+ if (ret = nftw(dest, unlink_cb, 64, FTW_DEPTH | FTW_PHYS)) { >+ return ret; >+ } >+ >+ errno = 0; >+ ret = seteuid (getuid ()); >+ if (ret == -1) { >+ g_warning ("Error performing seteuid: %s", g_strerror (errno)); >+ exit (1); >+ } >+ >+ ret = remove (dest); >+ if (ret) { >+ g_error ("Failed to remove %s, reason was: %s", dest, strerror (errno)); >+ errno = 0; >+ } >+ >+ return ret; > } > > int >@@ -161,9 +175,7 @@ > exit (1); > } > >- become_user (user_id, dest); >- >- ret = remove_dest_dir (dest); >+ become_user (user_id); > >- return ret != TRUE; >+ return remove_dest_dir (dest) == 0 ? 0 : 1; > }
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 601878
:
455316
| 455318