[3816] in Athena Bugs

home help back first fref pref prev next nref lref last post

tcsh globbing [tytso]

daemon@ATHENA.MIT.EDU (probe@ATHENA.MIT.EDU)
Wed Dec 13 06:20:27 1989

From: probe@ATHENA.MIT.EDU
Date: Wed, 13 Dec 89 06:20:11 -0500
To: bugs@ATHENA.MIT.EDU, changes@ATHENA.MIT.EDU
Reply-To: Richard Basch   <probe@ATHENA.MIT.EDU>


        The globbing code interprets '~' using the value of $home, while
  the file completion code interprets '~' using getpwuid(getuid()).  This
  means that if your /etc/passwd entry is missing (which is what I assumed
  happened), the file completion code will expand ~/ as the root.

  While this is definitely a misfeature of one sort or another (it would
  definitely cause a lot of confusion), it should only happen under
  exceptional circumstances.

[2083] daemon@ATHENA.MIT.EDU  Release_Engineering  12/13/89 03:50 (52 lines)
Subject: Re: possible csh bug, or afs bug, or bug-new-dialup, ...
Date: Wed, 13 Dec 89 03:49:48 -0500
From: Theodore Ts'o <tytso@ATHENA.MIT.EDU>
To: Richard Basch <probe@ATHENA.MIT.EDU>
Cc: geer@ATHENA.MIT.EDU, rel-eng@ATHENA.MIT.EDU, bug-new-dialup@ATHENA.MIT.EDU
In-Reply-To: Richard Basch's message of Wed, 13 Dec 89 03:34:30 -0500,
Reply-To: tytso@ATHENA.MIT.EDU
   From: probe@ATHENA.MIT.EDU
   Date: Wed, 13 Dec 89 03:34:30 -0500

   Yes, we would like the fix.

Here it is....  as promised, quick and easy.  John Carr expressed an
interest for getting it into this release, for the purposes for
improving dialup service.

						- Ted

RCS file: RCS/sh.file.c,v
retrieving revision 1.1
diff -c -r1.1 sh.file.c
*** /tmp/,RCSt1023882   Wed Dec 13 03:47:41 1989
--- sh.file.c   Wed Dec 13 03:23:16 1989
***************
*** 308,320 ****
        *p = '\0';

        if (old[0] == '~') {
!               if (person[0] == '\0')          /* then use current uid */
!                       pw = getpwuid (getuid ());
!               else
                        pw = getpwnam (person);
!               if (pw == NULL)
!                       return (NULL);
!               strcpy (new, pw -> pw_dir);
        } else {                                /* '=' stack expansion */
                new[0] = '\0';
                if (!isdigit (old[1]) && old[1] != '-')
--- 308,321 ----
        *p = '\0';

        if (old[0] == '~') {
!               if (person[0] == '\0') {        /* then use $home */
!                       strcpy(new, value("home"));
!               } else {
                        pw = getpwnam (person);
!                       if (pw == NULL)
!                               return (NULL);
!                       strcpy (new, pw -> pw_dir);
!               }
        } else {                                /* '=' stack expansion */
                new[0] = '\0';
                if (!isdigit (old[1]) && old[1] != '-')
--[2083]--

home help back first fref pref prev next nref lref last post