[OE-core] [PATCH] base-files: Fix LSB NG Cases.

Li, Xin lixin.fnst at cn.fujitsu.com
Wed Sep 2 02:09:16 UTC 2015


Hi, Richard and Mark,

Thanks for your reply. 

>Subject: Re: [OE-core] [PATCH] base-files: Fix LSB NG Cases.
>
>On 9/1/15 4:13 PM, Richard Purdie wrote:
>> On Thu, 2015-06-04 at 16:52 +0800, Li xin wrote:
>>> -/tset/LSB.fhs/var/tmp/tmp-tc.
>>>
>>> The LSB Core test requires the /var/tmp directory supports creation of files.
>>> And the mount tmpfs on /var/volatile cause the /var/tmp directory
>>> can't be writable for non-root users.
>>
>> This change doesn't look correct to me, its a pretty fundamental
>> change to the way the system operates and certainly needs more thought
>> and justification than the few lines above.
>>
>> Surely if its a non-root users issue, the problem is permissions, not
>> the tmpfs anyway?
>
>I agree.. How is /var/volatile mounted in your environment?
>
>/var/volatile should be mounted as a tmpfs with default root only permissions.
>(basefiles: fstab)
>
>A directory, /var/volatile/tmp should be constructed (after volatile is mounted) with
>perms 01777.  (initscripts: populate-volatile.sh)
>
>/var/tmp should be a symbolic link to /var/volatile/tmp.  (meta/files/fs-perms.txt)
>
>All of this will result in a /var/tmp that permits any user to write to it (as it should),
>but keep it in the volatile area.
>
>You should figure out what part of this is not working properly.  (If I had to guess it's
>the mount of the volatile and create of the tmp dir is not working for you -- or you
>have a system where the default mount rules / init scripts have been modified in
>some way.)
>

On my system:

root # cat /etc/fstab
# stock fstab - you probably want to override this with a machine specific one

/dev/root            /                    auto       defaults              1  1
proc                 /proc                proc       defaults              0  0
devpts               /dev/pts             devpts     mode=0620,gid=5       0  0
usbdevfs             /proc/bus/usb        usbdevfs   noauto                0  0
tmpfs                /run                 tmpfs      mode=0755,nodev,nosuid,strictatime 0  0
tmpfs                /var/volatile        tmpfs      defaults              0  0

# uncomment this if your device has a SD/MMC/Transflash slot
#/dev/mmcblk0p1       /media/card          auto       defaults,sync,noauto  0  0

root #
root # ls /var/tmp -ld
lrwxrwxrwx 1 root root 12 Aug 24 09:24 /var/tmp -> volatile/tmp

root # ls /var/tmp/ -ld
drwxr-xr-x 3 root root 60 Sep  1 08:11 /var/tmp/
root #

This will permit non-root users to write to /var/tmp/ dir,
But the LSB test requires it can be writable for non-root users. So the test result is FAIL.

Regards,
Li

>>
>>> Signed-off-by: Li Xin <lixin.fnst at cn.fujitsu.com>
>>> ---
>>>  meta/recipes-core/base-files/base-files/fstab | 1 -
>>>  1 file changed, 1 deletion(-)
>>>
>>> diff --git a/meta/recipes-core/base-files/base-files/fstab
>>> b/meta/recipes-core/base-files/base-files/fstab
>>> index d79a016..458ec70 100644
>>> --- a/meta/recipes-core/base-files/base-files/fstab
>>> +++ b/meta/recipes-core/base-files/base-files/fstab
>>> @@ -4,7 +4,6 @@
>>>  proc                 /proc                proc       defaults
>0  0
>>>  devpts               /dev/pts             devpts
>mode=0620,gid=5       0  0
>>>  tmpfs                /run                 tmpfs
>mode=0755,nodev,nosuid,strictatime 0  0
>>> -tmpfs                /var/volatile        tmpfs      defaults
>0  0
>>>
>>>  # uncomment this if your device has a SD/MMC/Transflash slot
>>>  #/dev/mmcblk0p1       /media/card          auto
>defaults,sync,noauto  0  0
>>> --
>>> 1.8.4.2
>>>
>>
>>
>
>--
>_______________________________________________
>Openembedded-core mailing list
>Openembedded-core at lists.openembedded.org
>http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list