From 873b8b9750ad316169b43f72ebb97f718878303f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 29 May 2002 08:48:35 +0000 Subject: 2002-05-29 Roland McGrath * hashexec.c (check_hashbang): Fix fs id port arg in io_identity call. --- exec/hashexec.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'exec') 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); -- cgit v1.2.3