After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333641 - Session editing is broken in HEAD
Session editing is broken in HEAD
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
git master
Other Linux
: High major
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-06 18:28 UTC by Vincent Untz
Modified: 2006-03-06 21:28 UTC
See Also:
GNOME target: 2.14.x
GNOME version: ---


Attachments
Proposed patch (4.73 KB, patch)
2006-03-06 18:28 UTC, Vincent Untz
none Details | Review
Updated patch (4.76 KB, patch)
2006-03-06 18:48 UTC, Vincent Untz
none Details | Review

Description Vincent Untz 2006-03-06 18:28:21 UTC
I'm attaching a patch.
Comment 1 Vincent Untz 2006-03-06 18:28:46 UTC
Created attachment 60776 [details] [review]
Proposed patch
Comment 2 Rodrigo Moya 2006-03-06 18:36:03 UTC
Just one comment: in startup_list_disable, shouldn't it break on the "if (g_str_has_prefix (client->desktop_file, system_dirs[i]))" blocks?
Comment 3 Vincent Untz 2006-03-06 18:48:15 UTC
Created attachment 60782 [details] [review]
Updated patch

It's a bit better with the break, indeed :-)
Comment 4 Rodrigo Moya 2006-03-06 19:29:07 UTC
This looks ok to me, please commit and close the bug
Comment 5 Ray Strode [halfline] 2006-03-06 19:34:32 UTC
The patch leaves this line in it:
      path = g_build_filename (PREFIX, "share", "autostart", basename, NULL);
(and the corresponding free)

That looks broken.  It doesn't seem to serve any purpose and you reuse the path
variable, so the free at the end will make bad things happen.

I'd just remove the above line and the free.
Comment 6 Vincent Untz 2006-03-06 19:57:33 UTC
Thanks for catching this, Ray.
I committed the patch with your suggestion.

Thanks
Comment 7 Ray Strode [halfline] 2006-03-06 20:39:12 UTC
Actually, there seem to be a few other problems.

You do get the basename of the desktop file, but you don't ever use it.

So for instance, you have

+           if (g_file_test (path, G_FILE_TEST_EXISTS))

but in this case path isn't a path to a desktop file, but instead a path to an autostart directory.  I don't think that's what you want.

Also, I'm not entirely sure I understand the logic.  Is it something like, "If the program is currently disabled by a desktop file in the user's home directory, and that desktop file shadows one in a system directory, just delete the desktop file and use the system one instead".

If that's the logic, what if the desktop file in the system directory is also disabled?  Is the idea that users shouldn't be able to enable desktop files if the sysadmin has disabled them?
Comment 8 Ray Strode [halfline] 2006-03-06 20:43:26 UTC
(I'm talking about the startup_list_enable function)
Comment 9 Rodrigo Moya 2006-03-06 21:20:42 UTC
If the desktop file in the system directory is disabled, it would stay as is, since we can't modify it from the user's account.

About the idea of enabling files that are disabled in the system directory, that is not implemented right now, so the user can enable/disable what he/she wants.
Comment 10 Vincent Untz 2006-03-06 21:28:10 UTC
(In reply to comment #7)
> Actually, there seem to be a few other problems.
> 
> You do get the basename of the desktop file, but you don't ever use it.
> 
> So for instance, you have
> 
> +           if (g_file_test (path, G_FILE_TEST_EXISTS))
> 
> but in this case path isn't a path to a desktop file, but instead a path to an
> autostart directory.  I don't think that's what you want.

Wow. Sorry for sucking so much in this patch... Fixed.

> Also, I'm not entirely sure I understand the logic.  Is it something like, "If
> the program is currently disabled by a desktop file in the user's home
> directory, and that desktop file shadows one in a system directory, just delete
> the desktop file and use the system one instead".
> 
> If that's the logic, what if the desktop file in the system directory is also
> disabled?  Is the idea that users shouldn't be able to enable desktop files if
> the sysadmin has disabled them?

Well, it doesn't change the behavior that we had. It just makes it more complete. I agree that it's not perfect, though.