diff --git a/ChangeLog b/ChangeLog index 2a5fa4582..05c4f4be4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1999-09-20 Federico Mena Quintero + + * lib/startup.links: Changed the news link to Gnotices + 1999-09-19 David Martin * gtkedit/editcmd.c (edit_print_string): Use unsigned char so that diff --git a/configure.in b/configure.in index e0d6ceaf4..e0f50acb4 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(create_vcs) AC_CONFIG_HEADER(config.h) PACKAGE=mc -VERSION=4.5.39-pre1 +VERSION=4.5.39-pre2 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(VERSION) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index dbafe1a2d..fcb41c89e 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,18 @@ +1999-09-20 Federico Mena Quintero + + * gdesktop.c (desktop_rescan_devices): Call gmount_setup_devices(). + + * gdesktop-init.c (gdesktop_links_init): Renamed from + gdesktop_init(). Only set up customizable links here. + + * gdesktop.c (create_desktop_dir): Do the default setup of desktop + icons here. + + * gmount.c (option_has_owner): New function to see if a mount + entry has the "owner" flag and its uid matches our euid. + (is_block_device_mountable): Use option_has_owner(). + (get_mountable_devices): Likewise. + 1999-09-17 Federico Mena Quintero * gmain.c (x_init_dlg): Display a warning if the GtkTed code path diff --git a/gnome/gdesktop-init.c b/gnome/gdesktop-init.c index b5ead0dd4..fb4ae5c92 100644 --- a/gnome/gdesktop-init.c +++ b/gnome/gdesktop-init.c @@ -1,4 +1,4 @@ -/* +/* Customizable desktop links for the Midnight Commander * * Copyright (C) 1998-1999 The Free Software Foundation * @@ -20,7 +20,7 @@ desktop_load_init_from (const char *file) { void *iterator_handle; char *config_path = g_strconcat ("=", file, "=", NULL); - + iterator_handle = gnome_config_init_iterator_sections (config_path); do { @@ -45,7 +45,7 @@ desktop_load_init_from (const char *file) int used; char *icon = NULL, *url; char *icon2 = NULL; - + url = gnome_config_get_string ("url"); icon = gnome_config_get_string_with_default ("icon=", &used); if (!icon) @@ -57,9 +57,8 @@ desktop_load_init_from (const char *file) } if (url && *url){ char *filename = g_concat_dir_and_file (desktop_directory, key); - - desktop_create_url (filename, title, url, icon2); + desktop_create_url (filename, title, url, icon2); g_free (filename); } @@ -132,7 +131,7 @@ desktop_init_at (const char *dir) } void -gdesktop_init (void) +gdesktop_links_init (void) { char *dir; @@ -143,7 +142,4 @@ gdesktop_init (void) desktop_init_at (dir); g_free (dir); } - gmount_setup_devices (); - gprint_setup_devices (); } - diff --git a/gnome/gdesktop-init.h b/gnome/gdesktop-init.h index baa8a4cb3..9bffede64 100644 --- a/gnome/gdesktop-init.h +++ b/gnome/gdesktop-init.h @@ -1,6 +1,13 @@ +/* Customizable desktop links for the Midnight Commander + * + * Copyright (C) 1998-1999 The Free Software Foundation + * + * Authors: Miguel de Icaza + */ + #ifndef GDESKTOP_INIT_H #define GDESKTOP_INIT_H -void gdesktop_init (void); +void gdesktop_links_init (void); #endif diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index 60109cd08..8311a330f 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -27,6 +27,7 @@ #include "gcmd.h" #include "gdnd.h" #include "gpopup.h" +#include "gprint.h" #include "gscreen.h" #include "../vfs/vfs.h" #include "main.h" @@ -2211,7 +2212,11 @@ create_desktop_dir (void) } g_free (home_link_name); - gdesktop_init (); + /* Create the default set of icons */ + + gdesktop_links_init (); + gmount_setup_devices (); + gprint_setup_devices (); } } @@ -2551,7 +2556,7 @@ void desktop_rescan_devices (void) { desktop_cleanup_devices (); - gdesktop_init (); + gmount_setup_devices (); desktop_reload_icons (FALSE, 0, 0); } @@ -2633,7 +2638,7 @@ GnomeUIInfo desktop_popup_items[] = { GNOMEUIINFO_SUBTREE (N_("_Arrange Icons"), desktop_arrange_icons_items), GNOMEUIINFO_ITEM_NONE (N_("Create _New Window"), NULL, handle_new_window), GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_ITEM_NONE (N_("Recreate Desktop _Shortcuts"), NULL, handle_rescan_devices), + GNOMEUIINFO_ITEM_NONE (N_("Rescan Desktop _Devices"), NULL, handle_rescan_devices), GNOMEUIINFO_ITEM_NONE (N_("Rescan _Desktop"), NULL, handle_rescan_desktop), GNOMEUIINFO_ITEM_NONE (N_("Configure _Background Image"), NULL, set_background_image), GNOMEUIINFO_END diff --git a/gnome/gmount.c b/gnome/gmount.c index acaa324b4..219a1b3a4 100644 --- a/gnome/gmount.c +++ b/gnome/gmount.c @@ -135,6 +135,27 @@ option_has_user (char *str) #ifdef MOUNTED_GETMNTENT1 +/* Returns whether the mount entry has the owner flag and our euid matches the + * device file. + */ +static gboolean +option_has_owner (struct mntent *mnt) +{ + char *p; + struct stat st; + + if (strstr (mnt->mnt_opts, "owner") == NULL) + return FALSE; + + if (stat (mnt->mnt_fsname, &st) != 0) + return FALSE; + + if (st.st_uid != geteuid ()) + return FALSE; + + return TRUE; +} + /* Returns whether devname is mountable: NULL if it is not or g_strdup()ed * string with the mount point. */ @@ -163,7 +184,7 @@ is_block_device_mountable (char *mount_point) break; } - if (option_has_user (mnt->mnt_opts)) { + if (option_has_user (mnt->mnt_opts) || option_has_owner (mnt)) { retval = g_strdup (mnt->mnt_dir); break; } @@ -207,7 +228,7 @@ get_mountable_devices (void) } while ((mnt = getmntent (f)) != NULL) { - if (option_has_user (mnt->mnt_opts)) { + if (option_has_user (mnt->mnt_opts) || option_has_owner (mnt)) { devname_info_t *dit; dit = g_new0 (devname_info_t, 1); @@ -295,7 +316,7 @@ automounter_is_running (void) gboolean result = FALSE; CORBA_exception_init (&ev); - + server = goad_server_activate_with_id (NULL, "GOAD:magicdev:19990913", GOAD_ACTIVATE_EXISTING_ONLY, @@ -305,12 +326,12 @@ automounter_is_running (void) result = GNOME_MagicDev_is_running (server, &ev); if (ev._major != CORBA_NO_EXCEPTION) result = FALSE; - + CORBA_Object_release (server, &ev); } return result; - + #else /* !HAVE_CORBA */ return FALSE; #endif /* HAVE_CORBA */ diff --git a/gnome/gprint.c b/gnome/gprint.c index 5719a9491..8fa4ce5d9 100644 --- a/gnome/gprint.c +++ b/gnome/gprint.c @@ -1,4 +1,4 @@ -/* +/* Printing support for the Midnight Commander * * Copyright (C) 1998-1999 The Free Software Foundation * @@ -18,7 +18,7 @@ gprint_setup_devices (void) static char *gprint_path; char *desktop_quoted; char *command; - + if (!gprint_path) gprint_path = gnome_is_program_in_path ("g-print"); @@ -28,9 +28,7 @@ gprint_setup_devices (void) desktop_quoted = name_quote (desktop_directory, 0); command = g_strconcat (gprint_path, " --desktop-dir ", desktop_quoted, NULL); g_free (desktop_quoted); - + my_system (EXECUTE_WAIT | EXECUTE_AS_SHELL, shell, command); g_free (command); } - - diff --git a/lib/startup.links b/lib/startup.links index 4925135f2..201f70d6c 100644 --- a/lib/startup.links +++ b/lib/startup.links @@ -1,9 +1,9 @@ -[gnews] +[gnotices] title=GNOME News type=url -url=http://www.gnome.org/news +url=http://news.gnome.org/gnome-news [slashdot] title=Slashdot type=url -url=http://slashdot.org \ No newline at end of file +url=http://slashdot.org