Link less to smbmnt

Andrew Bartlett abartlet at samba.org
Sun Jul 7 19:20:02 GMT 2002


smbmnt is our (hopefully secure) utility to do the actual kernel
interaction part of the 'smbmount/smbfs' thing.

It is often used setuid root, the only untility in Samba with that
property.

Currently, it links in a fair few objects - but it seems that it doesn't
actually need to:

This patch removes most of that - in an attempt to allow for easier
verification of its security status.  I would also (but not included in
this patch) like to remove its use of includes.h (for the same reason),
but I know tridge has different opinions on things like that.

What do people think?

Andrew Bartlett
-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net
-------------- next part --------------
Index: client/smbmnt.c
===================================================================
RCS file: /data/cvs/samba/source/client/smbmnt.c,v
retrieving revision 1.9
diff -u -r1.9 smbmnt.c
--- client/smbmnt.c	2001/04/08 20:22:36	1.9
+++ client/smbmnt.c	2002/07/08 02:16:01
@@ -111,13 +111,13 @@
    OK then we change into that directory - this prevents race conditions */
 static int mount_ok(char *mount_point)
 {
-	SMB_STRUCT_STAT st;
+	struct stat st;
 
 	if (chdir(mount_point) != 0) {
 		return -1;
 	}
 
-        if (sys_stat(".", &st) != 0) {
+        if (stat(".", &st) != 0) {
 		return -1;
         }
 
Index: Makefile.in
===================================================================
RCS file: /data/cvs/samba/source/Makefile.in,v
retrieving revision 1.494
diff -u -r1.494 Makefile.in
--- Makefile.in	2002/07/03 07:37:50	1.494
+++ Makefile.in	2002/07/08 02:16:01
@@ -379,8 +379,7 @@
 MOUNT_OBJ = client/smbmount.o \
              $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) 
 
-MNT_OBJ = client/smbmnt.o \
-             $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+MNT_OBJ = client/smbmnt.o             	
 
 UMOUNT_OBJ = client/smbumount.o \
              $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)


More information about the samba-technical mailing list