Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 21531 Details for
Bug 26648
Starting X via startx messes up vc perms
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix
8750_all_4.3.99-restore-vc-permissions.patch (text/plain), 1.94 KB, created by
Andrew Bevitt
on 2003-11-30 23:16:18 UTC
(
hide
)
Description:
Patch to fix
Filename:
MIME Type:
Creator:
Andrew Bevitt
Created:
2003-11-30 23:16:18 UTC
Size:
1.94 KB
patch
obsolete
>--- xc-old/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c.orig 2003-12-01 12:10:02.000000000 +1100 >+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c 2003-12-01 13:15:10.312671680 +1100 >@@ -35,6 +35,8 @@ > #include "xf86_OSlib.h" > #include "lnx.h" > >+#include <sys/stat.h> >+ > #ifdef USE_DEV_FB > extern char *getenv(const char *); > #include <linux/fb.h> >@@ -45,13 +47,44 @@ > static int VTnum = -1; > static int activeVT = -1; > >+int vtPermSave[4]; >+char vtname[11]; >+ >+int saveVtPerms(void) >+{ >+ /* We need to use stat to get permissions */ >+ struct stat svtp; >+ >+ /* Do them numerically ordered, hard coded tty0 first */ >+ if ( stat ("/dev/tty0", &svtp) != 0 ) >+ return 0; >+ vtPermSave[0] = (int)svtp.st_uid; >+ vtPermSave[1] = (int)svtp.st_gid; >+ >+ /* Now check the console we are dealing with. */ >+ if ( stat (vtname, &svtp) != 0 ) >+ return 0; >+ vtPermSave[2] = (int)svtp.st_uid; >+ vtPermSave[3] = (int)svtp.st_gid; >+ >+ return 1; >+} >+ >+void restoreVtPerms(void) >+{ >+ /* Set the terminal permissions back to before we started */ >+ chown ("/dev/tty0", vtPermSave[0], vtPermSave[1]); >+ chown (vtname, vtPermSave[2], vtPermSave[3]); >+ >+ return; >+} >+ > void > xf86OpenConsole(void) > { > int i, fd = -1; > int result; > struct vt_mode VT; >- char vtname[11]; > struct vt_stat vts; > MessageType from = X_PROBED; > #ifdef USE_DEV_FB >@@ -124,6 +157,14 @@ > xf86Info.vtno, strerror(errno)); > } > >+ /* >+ * grab the vt ownership before we overwrite it >+ * hard coded /dev/tty0 into this function aswell for below >+ */ >+ if (!saveVtPerms()){ >+ xf86Msg(X_WARNING, "xf86OpenConsole: Couldnt save owenership of vt"); >+ } >+ > /* change ownership of the vt */ > chown(vtname, getuid(), getgid()); > >@@ -247,6 +289,9 @@ > activeVT = -1; > } > close(xf86Info.consoleFd); /* make the vt-manager happy */ >+ >+ restoreVtPerms(); /* restore the permissions */ >+ > return; > } >
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 26648
:
21531
|
61188