Re: Bug #60014 Fix



Another way to fix this is to change the logic around the fetching of
the env variable to look for a zero length string.  I prefer this way,
as it actually tries to find a valid shell.  This does what Jacob asked,
but checking for other shells.

So the included patch should fix that.  It's a two-line fix.  I tested
it as best I could, considering I can't get any of the gnome-libs I can
get I hand on to compile. (My db libs might be fscked, it's always in
gnome-metadata.c, wrong number of arguments).  It does compile ;)  If
someone would apply it to their setup, and clobber their SHELL var
(export SHELL=""), then launch a gnome-terminal, I'd appreciate it.

On Fri, 2001-09-14 at 20:29, Cory Watson wrote:
> 
> Currently a NULL shell is handled fine, as the code first checks the env
> var, then the passwd struct for the user, then finally just tries to
> find one on the file system.
> 
> It would be pretty easy to add a check for a zero-length shell var in
> the same logic that checks for a NULL one.  I'll write one tomorrow, as
> I think this is a much more elegant solution, as it fixes the problem
> rather than just throwing an error dialog.
> 
> On Fri, 2001-09-14 at 17:51, Havoc Pennington wrote:
> > 
> > 
> > jacob berkman <jacob ximian com> writes: 
> > > would it be safe / ok to try other probably-good shells before popping
> > > the error message?
> > >
> > 
> > Yeah I think it'd be fine to just fall back to something instead of an
> > error message.
> >  
> > > what's the RH bug #?
> > 
> > I was on crack, I remembered this from the GNOME tracker ;-)
> >   http://bugzilla.gnome.org/show_bug.cgi?id=60014
> > 
> > (which is why Cory fixed it I guess)
> > 
> > Havoc
> > 
> > _______________________________________________
> > gnome-devel-list mailing list
> > gnome-devel-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gnome-devel-list
> > 
> > 
> 
> 
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list
> 
> 

--- gnome-util.c	Sat Sep 15 11:23:33 2001
+++ /root/gnome-util.c	Sat Sep 15 11:49:06 2001
@@ -380,7 +380,8 @@
 		"/bin/csh", "/bin/sh", 0
 	};
 
-	if ((shell = getenv ("SHELL"))){
+	shell = getenv ("SHELL");
+	if ((shell) && (strlen(shell) > 0)) {
 		return g_strdup (shell);
 	}
 	pw = getpwuid(getuid());


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