#215: Pulse + su + autospawn = root perms on /tmp/pulse-$USER ---------------------+------------------------------------------------------ Reporter: coling | Owner: lennart Type: defect | Status: new Priority: normal | Milestone: Component: daemon | Severity: normal Resolution: | Keywords: ---------------------+------------------------------------------------------ Comment (by coling):
I think that this issue stems from the output of the function pa_get_user_name in [source:trunk/src/pulse/[EMAIL PROTECTED] On my system when I do a plain {{{su}}} $USER == my original username, not "root". I've confirmed this via a small test app: {{{ #!c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> int main() { uid_t uid = getuid(); gid_t gid = getgid(); printf("%d - %d\n", uid, gid); char *p; if (!(p = getenv("USER")) && !(p = getenv("LOGNAME")) && !(p = getenv("USERNAME"))) { printf("Not got env....\n"); } else { printf("Found %s from env\n", p); } return 0; } }}} This produces the following output: {{{ [EMAIL PROTECTED] pulseaudio]$ g++ -o test test.c [EMAIL PROTECTED] pulseaudio]$ ./test 603 - 603 Found colin from env [EMAIL PROTECTED] pulseaudio]$ su Password: [EMAIL PROTECTED] pulseaudio]# ./test 0 - 0 Found colin from env [EMAIL PROTECTED] pulseaudio]# exit [EMAIL PROTECTED] pulseaudio]$ sudo -s [EMAIL PROTECTED] pulseaudio]# ./test 0 - 0 Found root from env [EMAIL PROTECTED] pulseaudio]# exit [EMAIL PROTECTED] pulseaudio]$ pwd /home/colin/Development/Personal/Checkouts/pulseaudio [EMAIL PROTECTED] pulseaudio]$ su - Password: [EMAIL PROTECTED] ~]# cd /home/colin/Development/Personal/Checkouts/pulseaudio [EMAIL PROTECTED] pulseaudio]# ./test 0 - 0 Found root from env [EMAIL PROTECTED] pulseaudio]$ sudo -i [EMAIL PROTECTED] ~]# cd /home/colin/Development/Personal/Checkouts/pulseaudio [EMAIL PROTECTED] pulseaudio]# ./test 0 - 0 Found root from env }}} As can be seen from the above, {{{su}}} is the only one of the four commands that does not set $USER to "root". I have tested this on a Mandriva Cooker system and on a CentOS 5 system with the same results. I've yet to try on any other distros. Col -- Ticket URL: <http://www.pulseaudio.org/ticket/215#comment:2> PulseAudio <http://pulseaudio.org/> The PulseAudio Sound Server _______________________________________________ pulseaudio-tickets mailing list pulseaudio-tickets@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-tickets