* bug#1009: Carbon: posix-file-name-to-mac
@ 2008-09-20 12:33 David Reitter
[not found] ` <wlfxntynt3.wl%mituharu@math.s.chiba-u.ac.jp>
0 siblings, 1 reply; 2+ messages in thread
From: David Reitter @ 2008-09-20 12:33 UTC (permalink / raw)
To: emacs-pretest-bug
[-- Attachment #1: Type: text/plain, Size: 2342 bytes --]
(posix-file-name-to-mac "~emacs/asd")
(posix-file-name-to-mac "/tmp/")
will crash a 22 branch Carbon Emacs.
A fix is below - it disables ~emacs and /tmp expansion when getpwnam
or get_temp_dir_name return NULL, which they seem to do.
(OS X has /tmp, so I'm not sure if the code isn't leftover from MacOS
and stopped working at some point.)
- D
Index: mac.c
===================================================================
RCS file: /sources/emacs/emacs/src/Attic/mac.c,v
retrieving revision 1.77.2.10
diff -c -r1.77.2.10 mac.c
*** mac.c 29 Aug 2008 08:18:07 -0000 1.77.2.10
--- mac.c 20 Sep 2008 12:29:24 -0000
***************
*** 214,237 ****
if (strncmp (p, "~emacs/", 7) == 0)
{
struct passwd *pw = getpwnam ("emacs");
! p += 7;
! if (strlen (pw->pw_dir) + strlen (p) > MAXPATHLEN)
! return 0;
! strcpy (expanded_pathname, pw->pw_dir);
! strcat (expanded_pathname, p);
! p = expanded_pathname;
! /* now p points to the pathname with emacs dir prefix */
}
else if (strncmp (p, "/tmp/", 5) == 0)
{
char *t = get_temp_dir_name ();
! p += 5;
! if (strlen (t) + strlen (p) > MAXPATHLEN)
! return 0;
! strcpy (expanded_pathname, t);
! strcat (expanded_pathname, p);
! p = expanded_pathname;
! /* now p points to the pathname with emacs dir prefix */
}
else if (*p != '/') /* relative pathname */
strcat (mfn, ":");
--- 215,244 ----
if (strncmp (p, "~emacs/", 7) == 0)
{
struct passwd *pw = getpwnam ("emacs");
! if (pw != NULL)
! {
! p += 7;
! if (strlen (pw->pw_dir) + strlen (p) > MAXPATHLEN)
! return 0;
! strcpy (expanded_pathname, pw->pw_dir);
! strcat (expanded_pathname, p);
! p = expanded_pathname;
! /* now p points to the pathname with emacs dir prefix */
! }
}
else if (strncmp (p, "/tmp/", 5) == 0)
{
char *t = get_temp_dir_name ();
! if (t != NULL)
! {
! p += 5;
! if (strlen (t) + strlen (p) > MAXPATHLEN)
! return 0;
! strcpy (expanded_pathname, t);
! strcat (expanded_pathname, p);
! p = expanded_pathname;
! /* now p points to the pathname with emacs dir prefix */
! }
}
else if (*p != '/') /* relative pathname */
strcat (mfn, ":");
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#1009: Carbon: posix-file-name-to-mac
[not found] ` <wlfxntynt3.wl%mituharu@math.s.chiba-u.ac.jp>
@ 2011-03-10 6:47 ` Glenn Morris
0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2011-03-10 6:47 UTC (permalink / raw)
To: 1009-done
Thanks for the report. Emacs 22 is very old and has not been supported
for some time. The latest version is 23.3. Please open new reports for
any issues you have with the new version.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-10 6:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-20 12:33 bug#1009: Carbon: posix-file-name-to-mac David Reitter
[not found] ` <wlfxntynt3.wl%mituharu@math.s.chiba-u.ac.jp>
2011-03-10 6:47 ` Glenn Morris
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.