Bug 92000 - Incomplete list of screensavers for user but not root
Summary: Incomplete list of screensavers for user but not root
Status: RESOLVED WORKSFORME
Alias: None
Product: kscreensaver
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Daniel Molkentin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-24 14:02 UTC by David Spicer
Modified: 2004-11-11 20:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Spicer 2004-10-24 14:02:56 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    Compiled From Sources
Compiler:          gcc 3.3.4 
OS:                Linux

Just updated from KDE 3.3 to 3.3.1.  All installed screensavers are listed in the Control Centre/Configure Deskop when I log in as root but only about a third of them appear in the list when I log in either as an existing user or as a newly created user.  (It's not just one specific grouping of savers that goes missing but individual savers from each group.)  I have absolutely no idea how these are set up so don't know how to investigate further.
Comment 1 Stephan Kulow 2004-10-24 14:32:23 UTC
Perhaps a permission problem? Compare the results of
kbuildsycoca  --menutest | grep "Screen Saver" 
Comment 2 David Spicer 2004-10-24 20:58:26 UTC
Running kbuildsycoca  --menutest | grep "Screen Saver" certainly gives a better handle on the problem.  As a user, 24 screensavers get listed and as root 207 are listed and it looks as though all it's all of the screensavers in /usr/X11R6/lib/xscreensaver/ that are missing from the user's list.  Permissions for the individual desktop files in /opt/kde/share/applnk/System/ScreenSavers/ look to be the same:

For one of the screensavers available as a user:

-rw-r--r--  1 root root 5255 2004-10-03 08:10 /opt/kde/share/applnk/System/ScreenSavers/KBanner.desktop

-rw-r--r--  1 root-rwxr-xr-x  1 root root 52116 2004-10-23 15:16 /opt/kde/bin/kbanner.kss*

For one of the screensavers only available as root:

-rw-r--r--  1 root root 5469 2004-10-03 08:10 /opt/kde/share/applnk/System/ScreenSavers/cage.desktop

-rwxr-xr-x  1 root root 70124 2004-05-13 07:47 /usr/X11R6/lib/xscreensaver/cage*

The full list of screensavers available for a user is:
KPendulum.desktop
KScience.desktop
kpartsaver.desktop
KLorenz.desktop
KSolarWinds.desktop
KSlideshow.desktop
KBlob.desktop
KFiresaver.desktop
KRotation.desktop
KVm.desktop
KSpace.desktop
KBlankscreen.desktop
KRandom.desktop
KPolygon.desktop
KFountain.desktop
ktux.desktop
KLines-saver.desktop
KEuphoria.desktop
KSwarm.desktop
KFlux.desktop
KClock.desktop
KGravity.desktop
KWave.desktop
KBanner.desktop

I guess that the rest of the output from kbuildsycoca is not relevant but here it is just in case:

david@darkstar:~$ kbuildsycoca  --menutest | grep "Screen Saver"
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
kbuildsycoca running...
kio (KSycoca): Trying to open ksycoca from /var/tmp/kdecache-david/ksycoca
Reusing existing ksycoca
kbuildsycoca: Recreating ksycoca file (/var/tmp/kdecache-david/ksycoca, version 75)
kbuildsycoca: WARNING: Property 'X-KDE-Weight' is defined multiple times (KOfficeFilter)
kbuildsycoca: VFolderMenu::mergeFile: /opt/kde/etc/xdg/menus/applications-merged/kde-essential.menu
kbuildsycoca: VFolderMenu::mergeFile: /opt/kde/etc/xdg/menus/applications-merged/kde-multimedia-music.menu
kbuildsycoca: VFolderMenu::mergeFile: /opt/kde/etc/xdg/menus/kde-settings.menu
kbuildsycoca: VFolderMenu::mergeFile: /opt/kde/etc/xdg/menus/kde-information.menu
kbuildsycoca: Directory and kde-information.directory requires combining!
kbuildsycoca: VFolderMenu::mergeFile: /opt/kde/etc/xdg/menus/kde-screensavers.menu
kbuildsycoca: Directory and kde-system-screensavers.directory requires combining!
kbuildsycoca: VFolderMenu::mergeFile: /home/david/.config/menus/applications-kmenuedit.menu
kbuildsycoca: Processing KDE Legacy dirs for <KDE>
kbuildsycoca: processKDELegacyDirs()
kio (KService*): WARNING: The desktop entry file Utilities/kfilereplacepart.desktop has Type=Service but is located under "apps" instead of "services"
kio (KService*): WARNING: Invalid Service : Utilities/kfilereplacepart.desktop
kbuildsycoca: Looking up applications under /usr/share/applications/
kbuildsycoca: Looking up applications under /usr/local/share/applications/
kbuildsycoca: Looking up applications under /opt/kde/share/applications/
kbuildsycoca: Looking up applications under /opt/kde/share/applications/kde/
kbuildsycoca: Looking up applications under /home/david/.local/share/applications/
kbuildsycoca: Menu Jack and More does not specify a directory file.
kbuildsycoca: Menu .hidden does not specify a directory file.
kbuildsycoca: Menu CrossOver does not specify a directory file.
kbuildsycoca: Adding file grip.desktop
kbuildsycoca: Adding file Audacity.desktop
kbuildsycoca: Adding file CdCat.desktop
kbuildsycoca: Adding file CdCat.desktop
kbuildsycoca: Adding file grip.desktop
kbuildsycoca: Adding file Office Setup.desktop
kbuildsycoca: Adding file Simulate Windows Reboot.desktop
kbuildsycoca: Adding file Office Reset.desktop
kbuildsycoca: Adding file Office Uninstall.desktop
kbuildsycoca: Adding file Office Documentation.desktop
kbuildsycoca: Moving Settings/Information to Information

Comment 3 Stephan Kulow 2004-10-24 22:32:43 UTC
do you have xscreensaver in $PATH for both user and root? 
Comment 4 David Spicer 2004-10-25 00:32:53 UTC
I have never had xscreensaver in either the root or user's $PATH (the screensaver selection worked fine in KDE 3.3).

Adding /usr/X11R6/lib/xscreensaver to the user $PATH has no effect.
Comment 5 Stephan Kulow 2004-10-25 13:58:22 UTC
/usr/X11R6/lib/xscreensaver is a directory, I'm talking about the binary xscreensaver
Comment 6 David Spicer 2004-10-25 21:11:33 UTC
Sorry, if you mean /usr/X11R6/bin/ then that's in the $PATH.  Further, executing "kxsconfig anemone" as a user (I took this from /opt/kde/share/applnk/System/ScreenSavers/anemone.desktop) brings up the configuration dialog for anemone and "kxsrun anemone -- -window-id %w" will run anemone in a window.  What am I missing?
Comment 7 Stephan Kulow 2004-10-25 21:17:55 UTC
Perhaps /usr/X11R6/bin isn't in non-interactive shells's $PATH? For a test, remove the TryExec=xscreensaver from anemone.desktop and see if it appears in --menutest
Comment 8 David Spicer 2004-10-25 22:01:15 UTC
Aha, sorted:

david@darkstar:~$ v /usr/X11R6/bin/xscreensaver
-rwxr-s--x  1 root shadow 205228 2004-05-13 07:47 /usr/X11R6/bin/xscreensaver*

As a user I was not in the shadow group, so I added myself and now all of the xscreensavers get listed!  (The only spooky bit, for me anyway, is that xscreensaver would run quite happily before I added myself to the shadow group.)
Comment 9 David Spicer 2004-10-25 22:04:50 UTC
Thanks for all of the helpful suggestions.
Comment 10 Stephan Kulow 2004-10-25 22:44:28 UTC
Hmm, this is indeed a mean side effect of Laurent's TryExec fix. But hopefully not too many will fall into it.
Comment 11 Gregorio Guidi 2004-11-11 16:37:53 UTC
Stephan, why not doing something like this to avoid problems?

RCS file: /home/kde/kdelibs/kdecore/kdesktopfile.cpp,v
retrieving revision 1.48
diff -u -B -r1.48 kdesktopfile.cpp
--- kdecore/kdesktopfile.cpp    17 Oct 2004 18:45:24 -0000      1.48
+++ kdecore/kdesktopfile.cpp    11 Nov 2004 15:37:08 -0000
@@ -254,7 +254,7 @@

   if (!te.isEmpty()) {
     if (!QDir::isRelativePath(te)) {
-      if (::access(QFile::encodeName(te), R_OK | X_OK))
+      if (::access(QFile::encodeName(te), X_OK))
        return false;
     } else {
       // !!! Sergey A. Sukiyazov <corwin@micom.don.ru> !!!
@@ -265,7 +265,7 @@
       bool match = false;
       for (; it != dirs.end(); ++it) {
        QString fName = *it + "/" + te;
-       if (::access(QFile::encodeName(fName), R_OK | X_OK) == 0)
+       if (::access(QFile::encodeName(fName), X_OK) == 0)
Comment 12 Stephan Kulow 2004-11-11 20:29:49 UTC
CVS commit by coolo: 

applying patch to fix permission problems on some systems. Taking that this
is TryExec and not TryReadAndExec, the patch makes sense to me
CCBUG: 92000


  M +3 -3      kdesktopfile.cpp   1.49


--- kdelibs/kdecore/kdesktopfile.cpp  #1.48:1.49
@@ -255,5 +255,5 @@ bool KDesktopFile::tryExec() const
   if (!te.isEmpty()) {
     if (!QDir::isRelativePath(te)) {
-      if (::access(QFile::encodeName(te), R_OK | X_OK))
+      if (::access(QFile::encodeName(te), X_OK))
         return false;
     } else {
@@ -266,5 +266,5 @@ bool KDesktopFile::tryExec() const
       for (; it != dirs.end(); ++it) {
         QString fName = *it + "/" + te;
-        if (::access(QFile::encodeName(fName), R_OK | X_OK) == 0)
+        if (::access(QFile::encodeName(fName), X_OK) == 0)
         {
           match = true;