Skip site navigation (1)Skip section navigation (2)
Date:      15 Dec 2000 19:10:15 +0200
From:      Oleg Borodin <olegb@holmrock.ru>
To:        freebsd-bugs@freebsd.org
Subject:   contrib/amd/amd/amfs_program.c: don't correct execv()?
Message-ID:  <itolpq4o.fsf@star.holmrock>

next in thread | raw e-mail | index | archive | help
Release: 4.2
Map:
--- begin /etc/amd.conf ---
#
# $Id: amd.conf,v 1.2 2000/12/01 09:30:45 ziggi Exp ziggi $
#
# 						-*- text -*-
[global]
browsable_dirs =	yes
map_options =		cache:=all
search_path =		/etc:/etc/amd
auto_dir =		/.a
cache_duration =	300
#debug_options = 	all
dismount_interval =	120
fully_qualified_hosts =	no
local_domain =		holmrock
log_file =		/var/log/amd.log
log_options =		all
nis_domain =		holmrock
normalize_hostnames =	yes
pid_file =		/var/run/amd.pid
show_statfs_entries =	yes
unmount_on_exit =	yes

[cdrom]
map_name =              amd.cdrom

[nw]
map_name =		amd.nw
--- end /etc/amd.conf ---
--- begin /etc/amd.nw ---
#
# $Id: amd.nw,v 1.2 2000/12/01 09:03:58 ziggi Exp ziggi $
#
work 		type:=program;\
		mount:="/etc/mount_nwfs /main:oleg/${key} ${fs}";\
		unmount:="/sbin/umount ${fs}"
sys 		type:=program;\
		mount:="/etc/mount_nwfs /main:oleg/${key} ${fs}";\
		unmount:="/sbin/umount ${fs}"
home 		type:=program;\
		mount:="/etc/mount_nwfs /main:oleg/${key} ${fs}";\
		unmount:="/sbin/umount ${fs}"
--- end /etc/amd.nw ---

Dirty patch:
===================================================================
RCS file: /usr2/CVS/freebsd/src/contrib/amd/amd/amfs_program.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 amfs_program.c
--- amfs_program.c	2000/07/29 10:48:50	1.1.1.2
+++ amfs_program.c	2000/11/30 20:41:44
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: amfs_program.c,v 1.1.1.2 2000/07/29 10:48:50 ziggi Exp $
+ * $Id: amfs_program.c,v 1.1.1.2.8.1 2000/11/30 19:53:22 ziggi Exp $
  *
  */
 
@@ -76,7 +76,7 @@
   0,				/* amfs_program_mounted */
   0,				/* amfs_program_umounted */
   find_amfs_auto_srvr,
-  FS_BACKGROUND | FS_AMQINFO
+  FS_MKMNT | FS_BACKGROUND | FS_AMQINFO
 };
 
 
@@ -117,6 +117,7 @@
 amfs_program_exec(char *info)
 {
   char **xivec;
+  char *path;
   int error;
 
   /*
@@ -157,7 +158,9 @@
     errno = EINVAL;
     plog(XLOG_USER, "1st/2nd args missing to (un)mount program");
   } else {
-    (void) execv(xivec[0], xivec + 1);
+    path = xivec[0];
+    xivec[0] = basename(xivec[0]);
+    (void) execv(path, xivec);
   }
 
   /*

-- 
Borodin Oleg
mailto:olegb@holmrock.ru
ph/fax:+7 0112 593459



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?itolpq4o.fsf>