3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/kvm/smbd-path-r3.patch

51 lines
1.5 KiB
Diff
Raw Normal View History

diff -rc kvm-86/net.c kvm-86-new/net.c
*** kvm-86/net.c 2009-05-19 18:29:02.000000000 +0200
--- kvm-86-new/net.c 2009-06-02 17:41:15.000000000 +0200
***************
*** 684,694 ****
slirp_init(slirp_restrict, slirp_ip);
}
! /* XXX: better tmp dir construction */
! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
! if (mkdir(smb_dir, 0700) < 0) {
! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
! exit(1);
}
snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf");
--- 684,696 ----
slirp_init(slirp_restrict, slirp_ip);
}
! while (1) {
! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld.%d", (long) getpid(), random());
! if (mkdir(smb_dir, 0700) == 0) break;
! if (errno != EEXIST) {
! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
! exit(1);
! }
}
snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf");
diff -rc kvm-86/net.h kvm-86-new/net.h
*** kvm-86/net.h 2009-05-19 18:29:02.000000000 +0200
--- kvm-86-new/net.h 2009-06-02 17:39:17.000000000 +0200
***************
*** 129,135 ****
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
! #define SMBD_COMMAND "/usr/sbin/smbd"
#endif
#endif
--- 129,135 ----
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
! #define SMBD_COMMAND "smbd"
#endif
#endif