Bug 384367

Summary: nspluginviewer tries to access /root/.mozilla/plugins/nppdf.so
Product: [openSUSE] openSUSE 11.0 Reporter: Harald Koenig <koenig>
Component: OtherAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 350752    

Description Harald Koenig 2008-04-28 14:10:19 UTC
for the start of this story, pls see bug #382527.

now, nppdf in acroread _only_ works, if my plain uses has access to /root/.mozilla/plugins/nppdf.so.

strace -fv firefox htttp://.../some.pdf shows that there is no attempt 
to access $HOME/.mozilla/plugins/nppdf.so but only /root/...


if I'm not allowed to access /root/.mozilla/plugins/nppdf.so firefox
crashes with the following console log

-------------------------------------------------------------------------------
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)
*** NSPlugin Viewer  *** ERROR: /usr/lib/browser-plugins/nppdf7.so: cannot open shared object file: No such file or directory
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)
*** NSPlugin Viewer  *** ERROR: /root/.mozilla/plugins/nppdf.so: cannot open shared object file: Permission denied
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)
*** NSPlugin Viewer  *** ERROR: /root/.mozilla/plugins/nppdf.so: cannot open shared object file: Permission denied
*** NSPlugin Wrapper *** ERROR: failed to initialize plugin-side RPC client connection
*** NSPlugin Wrapper *** ERROR: NP_Initialize() invoke: Connection was NULL
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)
*** NSPlugin Viewer  *** ERROR: /root/.mozilla/plugins/nppdf.so: cannot open shared object file: Permission denied
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)
*** NSPlugin Viewer  *** ERROR: /root/.mozilla/plugins/nppdf.so: cannot open shared object file: Permission denied
*** NSPlugin Wrapper *** ERROR: failed to initialize plugin-side RPC client connection
*** NSPlugin Wrapper *** ERROR: NP_Initialize() invoke: Connection was NULL

(firefox:6202): Gdk-CRITICAL **: gdk_window_get_user_data: assertion `window != NULL' failed
/usr/bin/firefox: line 123:  6202 Segmentation fault      $MOZ_PROGRAM "$@"
-------------------------------------------------------------------------------

while firefox starts up and displays the PDF after "sudo chmod go+x /root /root/.mozilla" 
with the following console messages:

-------------------------------------------------------------------------------
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)
*** NSPlugin Viewer  *** ERROR: /usr/lib/browser-plugins/nppdf7.so: cannot open shared object file: No such file or directory
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)
which: no soundwrapper in (/home/harald/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/opt/bin:.)

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",

(acroread:6388): Gtk-WARNING **: Unable to locate theme engine in module_path: "xfce",
-------------------------------------------------------------------------------


I found the string /root/.mozilla/plugins/nppdf.so here:

  /usr/lib64/browser-plugins/npwrapper.nppdf.so

so it looks like a bug in nspluginwrapper which runs "/usr/bin/nspluginwrapper -a -i"
at install time as postinstall script ?!?


after running "/usr/bin/nspluginwrapper -a -i" I now got my own prive copy of 
npwrapper.nppdf.so in $HOME/.mozilla/plugins/ and my copy internally refers to
/usr/lib/browser-plugins/nppdf.so 


click click click -- me thinks, the pitfall in my installation is that there exists a copy /root/.mozilla/plugins/nppdf.so for historic reasons and nspluginwrapper slips over this _private_ nppdf.so using it for the _public_ /usr/lib64/browser-plugins/npwrapper.nppdf.so


reality check -- I remove /root/.mozilla/plugins/nppdf.so  and rerun "/usr/bin/nspluginwrapper -a -i" as root, and indeed:


now usr/lib64/browser-plugins/npwrapper.nppdf.so internally refers to /usr/lib/browser-plugins/nppdf.so

and I don't need my local npwrapper.nppdf.so  as plain user anymore :-((


problem solved, nspluginwrapper [setup?] is broken, at least for esoteric environments;-)


thanks for listening -- please fix anyway!
Comment 1 Stanislav Brabec 2008-04-28 16:02:08 UTC
I seen this problem as well, but I believed that it is caused by my experiments.
Comment 2 Stanislav Brabec 2008-06-06 12:51:57 UTC
Looking at the code, author seems to be aware of this problem:

src/npw-config.c:682
  int mode = 0700;
  if (geteuid() == 0 && strcmp(plugin_dir, "/root") != 0)
        mode = 0755;

This apparently does not work, if /root itself is not accessible for users.

I see several possible fixes:

- Disallow installation of custom plugins for root. (Simple, ugly.)

- Implement --system command line option and never touch system paths without --system (and vice versa) (Clean, a bit more complicated, but changes interface.)

- Modify binary to run plugin registration twice for root - once as user, once for system plugins.
Comment 3 Stanislav Brabec 2008-06-12 15:46:12 UTC
Created another solution: Differentiate between user and system paths and never try to install home plugin to system path. It's too late for 11.0.

Not submitting the fix as an online update for 11.0 yet, as it requires more invasive changes to npw-config.c and I am not sure, whether more people are affected. If more people will be affected, I will change my opinion and ask for it.

Submitted to Factory (11.1). Patch sent to upstream.

Fix put into home:sbrabec:backports.
Comment 4 Stanislav Brabec 2008-06-23 16:53:10 UTC
Fix for 10.3 and 11.0 was submitted as a part of larger fix.
Comment 5 Anja Stock 2008-07-04 14:18:35 UTC
released