Skip to contentSkip to conversation

patch for supporting SMB on Solaris host

Qemu-devel Ben Taylor 2 participants 2 messages Dec 23, 2006

lore
Share & tools
lore

Ben Taylor

author
#0 lore raw
Quoted 12 lines · ---- Paul Brook
Quoted 10 lines · Paul Brook

Review

Quoted 7 lines · Ben Taylor

Seeing as there is some working going on in the Solaris QEMU port again, here's a real short patch to support Samba working on a Solaris Host.

(quoted diff) +2 -0
+#ifdef __sun__
+    snprintf(smb_cmdline, sizeof(smb_cmdline), "/bin/env LC_ALL=C

/usr/sfw/sbin/smbd -s %s",

(quoted diff) +2 -0
+             smb_conf);
+#else

Why does this have anything to do with solaris?

Quoted 3 lines

Sorry, I was unclear. The /usr/swf bif is obviously a Solaris hack, and I think this is a bad way of implementing this.
I don't see why the /bin/env LC_ALL bits have anything to do with Solaris.

Hopefully, you find this patch to be more reasonable.

Ben

configure +4 -0
diff -ruN qemu-ORIG/configure qemu-smb/configure
@@ -30,6 +30,7 @@
 install="install"
 strip="strip"
 cpu=`uname -m`
+smbd=/usr/sbin/smbd
 target_list=""
 case "$cpu" in
   i386|i486|i586|i686|i86pc|BePC)
@@ -150,6 +151,7 @@
     make="gmake"
     install="ginstall"
     solarisrev=`uname -r | cut -f2 -d.`
+    smbd=/usr/sfw/sbin/smbd
 fi
 
 # find source path
@@ -579,6 +581,7 @@
 echo "Documentation     $build_docs"
 [ ! -z "$uname_release" ] && \
 echo "uname -r          $uname_release"
+echo "smbd              $smbd"
 
 if test $sdl_too_old = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -613,6 +616,7 @@
 echo "CFLAGS=$CFLAGS" >> $config_mak
 echo "LDFLAGS=$LDFLAGS" >> $config_mak
 echo "EXESUF=$EXESUF" >> $config_mak
+echo "#define SMBD_BINARY \"$smbd\"" >> $config_h
 if test "$cpu" = "i386" ; then
   echo "ARCH=i386" >> $config_mak
   echo "#define HOST_I386 1" >> $config_h
vl.c +2 -2
diff -ruN qemu-ORIG/vl.c qemu-smb/vl.c
@@ -3069,8 +3069,8 @@
     fclose(f);
     atexit(smb_exit);
 
-    snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s",
-             smb_conf);
+    snprintf(smb_cmdline, sizeof(smb_cmdline), "% -s %s",
+             SMBD_BINARY, smb_conf);
     
     slirp_add_exec(0, smb_cmdline, 4, 139);
 }
#1 lore raw

vl.c line 3073

Quoted 4 lines · Ben Taylor
vl.c +2 -2
-    snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s",
-             smb_conf);
+    snprintf(smb_cmdline, sizeof(smb_cmdline), "% -s %s",
+             SMBD_BINARY, smb_conf);

Doesn't look right to me? (s/%/%s/)