summaryrefslogtreecommitdiff
path: root/exec/hashexec.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-05-29 08:48:35 +0000
committerRoland McGrath <roland@gnu.org>2002-05-29 08:48:35 +0000
commit873b8b9750ad316169b43f72ebb97f718878303f (patch)
tree9ee92d9a0f8c3ffe00ecce5e03e516dbc9300b25 /exec/hashexec.c
parent60d76f3d32eb44b7712209a5d1e45b8f90c2d80b (diff)
2002-05-29 Roland McGrath <roland@frob.com>
* hashexec.c (check_hashbang): Fix fs id port arg in io_identity call.
Diffstat (limited to 'exec/hashexec.c')
-rw-r--r--exec/hashexec.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/exec/hashexec.c b/exec/hashexec.c
index f4e1f9d3..f880983d 100644
--- a/exec/hashexec.c
+++ b/exec/hashexec.c
@@ -1,5 +1,5 @@
/* GNU Hurd standard exec server, #! script execution support.
- Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000,02 Free Software Foundation, Inc.
Written by Roland McGrath.
This file is part of the GNU Hurd.
@@ -230,8 +230,7 @@ check_hashbang (struct execdata *e,
char *name;
int free_name = 0; /* True if we should free NAME. */
file_t name_file;
- mach_port_t fileid;
- dev_t filedev;
+ mach_port_t fileid, filefsid;
ino_t fileno;
/* Search $PATH for NAME, opening a port NAME_FILE on it.
@@ -261,9 +260,10 @@ check_hashbang (struct execdata *e,
return err;
}
- error = io_identity (file, &fileid, &filedev, &fileno);
+ error = io_identity (file, &fileid, &filefsid, &fileno);
if (error)
goto out;
+ mach_port_deallocate (mach_task_self (), filefsid);
if (memchr (argv, '\0', argvlen) == NULL)
{
@@ -284,11 +284,15 @@ check_hashbang (struct execdata *e,
if (!error && name_file != MACH_PORT_NULL)
{
- mach_port_t id;
- dev_t dev;
+ mach_port_t id, fsid;
ino_t ino;
- error = io_identity (name_file, &id, &dev, &ino);
- mach_port_deallocate (mach_task_self (), id);
+ error = io_identity (name_file, &id, &fsid, &ino);
+ mach_port_deallocate (mach_task_self (), name_file);
+ if (!error)
+ {
+ mach_port_deallocate (mach_task_self (), fsid);
+ mach_port_deallocate (mach_task_self (), id);
+ }
if (!error && id == fileid)
{
file_name = name;
@@ -296,7 +300,6 @@ check_hashbang (struct execdata *e,
}
else if (free_name)
free (name);
- mach_port_deallocate (mach_task_self (), name_file);
}
mach_port_deallocate (mach_task_self (), fileid);