Problems with Metadata and Mimetypes



Hi!

I have some troubles using the gnome_metadata_* and
gnome_mime_* functions.

When I run the code below as an ordinary user with the sgid bit cleared,
it works fine, but the application needs to be owned by the group lp and
have
the sgid bit set. If the sgid bit is set, the code does not work, i.e.
the gnome_meta_* and gnome_mime* functions fails to look up the
requested data.

If I, on the other hand, copy the mime-info folder to "the" user .gnome
folder ( cp -R /usr/share/mime-info ~user/.gnome) everything works fine.

Anyone knows what's wrong????

/Peppe

----- 8< ------
PMimeHandler::PMime::PMime(gchar* p_sFileName)
{
   char* sMetaType;
   const char* sMimeIcon;
   int   nSize;

   if(gnome_metadata_get_fast(p_sFileName,"type",&nSize,&sMetaType)!=0)
   {
      PWARNING("Unknown printerjob-type. Using postscript.");

if(gnome_metadata_get_fast("dummy.ps","type",&nSize,&sMetaType)!=0)
      {
         PERROR("Postscript type not found!!!");
         exit(-1);
      }
   }

   m_sMimeDescription=g_strdup(sMetaType);
   g_free(sMetaType);

   if(
(sMimeIcon=gnome_mime_get_value(m_sMimeDescription,"icon-filename"))
==NULL )
   {
      PERROR("Could not load mime-icon");
      exit(-1);
   }

   m_sIconName=g_strdup(sMimeIcon);
  ....





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]