Patchwork Declare state directory in smb.conf

login
register
mail settings
Submitter Nikolaus Rath
Date April 25, 2012, 1:57 p.m.
Message ID <87haw79ao0.fsf@inspiron.ap.columbia.edu>
Download mbox | patch
Permalink /patch/154945/
State New
Headers show

Comments

Nikolaus Rath - April 25, 2012, 1:57 p.m.
The smb.conf generated by the userspace networking does not include a state directory
directive. Samba therefore falls back to the default value. Since the user generally
does not have write access to this path, smbd immediately crashes.

The "state directory" option was added in Samba 3.4.0 (commit
http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757).

This patch adds the missing option.

Signed-off-by:  Nikolaus Rath <Nikolaus@rath.org>
---

Best,

   -Nikolaus
Nikolaus Rath - April 29, 2012, 4:19 p.m.
Hi,

It'd be great if someone could take a look at this and apply it if there
are no objections...

Thanks,
-Nikolaus

Nikolaus Rath <Nikolaus@rath.org> writes:
> The smb.conf generated by the userspace networking does not include a state directory
> directive. Samba therefore falls back to the default value. Since the user generally
> does not have write access to this path, smbd immediately crashes.
>
> The "state directory" option was added in Samba 3.4.0 (commit
> http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757).
>
> This patch adds the missing option.
>
> Signed-off-by:  Nikolaus Rath <Nikolaus@rath.org>
> ---
> diff -r -u qemu-kvm-1.0.1.old/net/slirp.c qemu-kvm-1.0.1/net/slirp.c
> --- qemu-kvm-1.0.1.old/net/slirp.c	2012-04-16 22:15:17.000000000 -0400
> +++ qemu-kvm-1.0.1/net/slirp.c	2012-04-24 21:56:41.835745642 -0400
> @@ -511,6 +511,7 @@
>              "socket address=127.0.0.1\n"
>              "pid directory=%s\n"
>              "lock directory=%s\n"
> +            "state directory=%s\n"
>              "log file=%s/log.smbd\n"
>              "smb passwd file=%s/smbpasswd\n"
>              "security = share\n"
> @@ -521,6 +522,7 @@
>              s->smb_dir,
>              s->smb_dir,
>              s->smb_dir,
> +            s->smb_dir,
>              s->smb_dir,
>              s->smb_dir,
>              exported_dir
>
> Best,
>
>    -Nikolaus
>
> -- 
>  »Time flies like an arrow, fruit flies like a Banana.«
>
>   PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C


   -Nikolaus
Jan Kiszka - April 29, 2012, 5 p.m.
Nikolaus Rath <Nikolaus@rath.org> schrieb:

>Hi,
>
>It'd be great if someone could take a look at this and apply it if
>there
>are no objections...

Will do asap when back from vacation.

Jan

>
>Thanks,
>-Nikolaus
>
>Nikolaus Rath <Nikolaus@rath.org> writes:
>> The smb.conf generated by the userspace networking does not include a
>state directory
>> directive. Samba therefore falls back to the default value. Since the
>user generally
>> does not have write access to this path, smbd immediately crashes.
>>
>> The "state directory" option was added in Samba 3.4.0 (commit
>>
>http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757).
>>
>> This patch adds the missing option.
>>
>> Signed-off-by:  Nikolaus Rath <Nikolaus@rath.org>
>> ---
>> diff -r -u qemu-kvm-1.0.1.old/net/slirp.c qemu-kvm-1.0.1/net/slirp.c
>> --- qemu-kvm-1.0.1.old/net/slirp.c	2012-04-16 22:15:17.000000000
>-0400
>> +++ qemu-kvm-1.0.1/net/slirp.c	2012-04-24 21:56:41.835745642 -0400
>> @@ -511,6 +511,7 @@
>>              "socket address=127.0.0.1\n"
>>              "pid directory=%s\n"
>>              "lock directory=%s\n"
>> +            "state directory=%s\n"
>>              "log file=%s/log.smbd\n"
>>              "smb passwd file=%s/smbpasswd\n"
>>              "security = share\n"
>> @@ -521,6 +522,7 @@
>>              s->smb_dir,
>>              s->smb_dir,
>>              s->smb_dir,
>> +            s->smb_dir,
>>              s->smb_dir,
>>              s->smb_dir,
>>              exported_dir
>>
>> Best,
>>
>>    -Nikolaus
>>
>> -- 
>>  »Time flies like an arrow, fruit flies like a Banana.«
>>
>>   PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C
>
>
>   -Nikolaus
>
>-- 
> »Time flies like an arrow, fruit flies like a Banana.«
>
>  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C



--
Sent from an Android - sorry just in case...

Patch

diff -r -u qemu-kvm-1.0.1.old/net/slirp.c qemu-kvm-1.0.1/net/slirp.c
--- qemu-kvm-1.0.1.old/net/slirp.c	2012-04-16 22:15:17.000000000 -0400
+++ qemu-kvm-1.0.1/net/slirp.c	2012-04-24 21:56:41.835745642 -0400
@@ -511,6 +511,7 @@ 
             "socket address=127.0.0.1\n"
             "pid directory=%s\n"
             "lock directory=%s\n"
+            "state directory=%s\n"
             "log file=%s/log.smbd\n"
             "smb passwd file=%s/smbpasswd\n"
             "security = share\n"
@@ -521,6 +522,7 @@ 
             s->smb_dir,
             s->smb_dir,
             s->smb_dir,
+            s->smb_dir,
             s->smb_dir,
             s->smb_dir,
             exported_dir