* Create the smbd temporary directory properly (don't fail if it
already exists, but just try another name). Should send this upstream... svn path=/nixpkgs/trunk/; revision=12717
This commit is contained in:
parent
bb45f8360f
commit
73a050a804
@ -1,6 +1,33 @@
|
|||||||
diff -rc kvm-57-orig/qemu/vl.c kvm-57/qemu/vl.c
|
diff -rc kvm-57-orig/qemu/vl.c kvm-57/qemu/vl.c
|
||||||
*** kvm-57-orig/qemu/vl.c 2007-12-18 16:57:46.000000000 +0100
|
*** kvm-57-orig/qemu/vl.c 2007-12-18 16:57:46.000000000 +0100
|
||||||
--- kvm-57/qemu/vl.c 2008-03-11 16:17:26.000000000 +0100
|
--- kvm-57/qemu/vl.c 2008-08-26 13:01:39.000000000 +0200
|
||||||
|
***************
|
||||||
|
*** 3828,3838 ****
|
||||||
|
slirp_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
! /* XXX: better tmp dir construction */
|
||||||
|
! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", 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");
|
||||||
|
|
||||||
|
--- 3828,3840 ----
|
||||||
|
slirp_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
! while (1) {
|
||||||
|
! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d.%d", 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");
|
||||||
|
|
||||||
***************
|
***************
|
||||||
*** 3865,3872 ****
|
*** 3865,3872 ****
|
||||||
fclose(f);
|
fclose(f);
|
||||||
@ -11,7 +38,7 @@ diff -rc kvm-57-orig/qemu/vl.c kvm-57/qemu/vl.c
|
|||||||
|
|
||||||
slirp_add_exec(0, smb_cmdline, 4, 139);
|
slirp_add_exec(0, smb_cmdline, 4, 139);
|
||||||
}
|
}
|
||||||
--- 3865,3875 ----
|
--- 3867,3877 ----
|
||||||
fclose(f);
|
fclose(f);
|
||||||
atexit(smb_exit);
|
atexit(smb_exit);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user