[Yaffs] SGID operation with directories
Tom Hansen
tomh at uwm.edu
Mon May 8 18:27:30 BST 2006
Here is a transcript of the test session, in which I compare the
behavior of the ramfs mounted on /tmp with that of YAFFS.
root at ts-7250:~ $ cd /tmp
root at ts-7250:/tmp $ mkdir testsgid
root at ts-7250:/tmp $ chgrp bin testsgid
root at ts-7250:/tmp $ chmod g+s testsgid
root at ts-7250:/tmp $ cd testsgid
root at ts-7250:/tmp/testsgid $ ls -Fla
drwxrwsr-x 1 root bin 0 May 8 12:18 ./
drwxrwxrwt 1 root root 0 Dec 31 1969 ../
root at ts-7250:/tmp/testsgid $ touch testfile
root at ts-7250:/tmp/testsgid $ ls -Fla
drwxrwsr-x 1 root bin 0 May 8 12:18 ./
drwxrwxrwt 1 root root 0 Dec 31 1969 ../
-rw-rw-r-- 1 root bin 0 May 8 12:19 testfile
root at ts-7250:/tmp/testsgid $ cd
root at ts-7250:~ $ mkdir testsgid
root at ts-7250:~ $ chgrp bin testsgid
root at ts-7250:~ $ chmod g+s testsgid
root at ts-7250:~ $ cd testsgid
root at ts-7250:~/testsgid $ ls -Fla
drwxrwsr-x 1 root bin 512 May 8 12:19 ./
drwxr-xr-x 1 root root 512 Oct 26 2005 ../
root at ts-7250:~/testsgid $ touch testfile
root at ts-7250:~/testsgid $ ls -Fla
drwxrwsr-x 1 root bin 512 May 8 12:19 ./
drwxr-xr-x 1 root root 512 Oct 26 2005 ../
-rw-rw-r-- 1 root root 0 May 8 12:20 testfile
root at ts-7250:~/testsgid $
You can see that the new "testfile" has a group ID of "bin" in the first
example, but retains "root" in the second.
Here is the output from /proc/yaffs:
$Id: yaffs_fs.c,v 1.3 2005/01/25 00:38:25 eddie Exp $
$Id: yaffs_guts.c,v 1.2 2005/01/10 18:27:13 eddie Exp $
Device yaffs
startBlock......... 1
endBlock........... 1855
chunkGroupBits..... 0
chunkGroupSize..... 1
nErasedBlocks...... 7
nTnodesCreated..... 7600
nFreeTnodes........ 2513
nObjectsCreated.... 4600
nFreeObjects....... 2511
nFreeChunks........ 2273
nPageWrites........ 1036366
nPageReads......... 2450159
nBlockErasures..... 17124
nGCCopies.......... 393757
garbageCollections. 17122
passiveGCs......... 18
nRetriedWrites..... 0
nRetireBlocks...... 0
eccFixed........... 0
eccUnfixed......... 0
tagsEccFixed....... 0
tagsEccUnfixed..... 8
cacheHits.......... 0
nDeletedFiles...... 7751
nUnlinkedFiles..... 10282
nBackgroudDeletions 0
useNANDECC......... 1
Also, my /etc/fstab:
proc /proc proc defaults 0 0
/dev/mtdblock/1 / yaffs defaults,noatime,grpid 0 0
ramfs /tmp ramfs mode=1777 0 0
Charles Manning wrote:
> On Thursday 27 April 2006 22:25, Tom Hansen wrote:
>
>> I'm using YAFFS with the 2.4.26-ts9 kernel on a Technologics TS-7250.
>>
>
> Is that YAFFS2?
>
>
>> When I set the SGID bit on a directory, files created under it do not
>> inherit the group ID, and directories created under it inherit neither
>> the group ID nor the SGID bit.
>>
>> I have a ramfs mount active at the same time (on /tmp), and the correct
>> SGID behavior occurs there, so it does seem to be a filesystem-specific
>> issue.
>>
>> Is there some mount option I should be using? I tried the 'grpid'
>> mount option, but it had no effect on the problem.
>>
>
> Could you send a bash script that can demo the problem?
>
> YAFFS does not listen to any mount options itself, but the VFS can be doing
> things on its behalf.
>
> -- Charles
>
--
Tom Hansen
Senior Information Processing Consultant
Great Lakes WATER Institute
tomh at uwm.edu
www.glwi.uwm.edu
More information about the yaffs
mailing list