を実行すると、smb.confのusershare pathに指定したディレクトリに
# cat sharename
#VERSION 2
path=/home/yasuma
comment=
usershare_acl=S-1-1-0:R
guest_ok=n
のような設定ファイルが作成され、共有が利用可能になる。
#VERSION 2
path=/home/yasuma
comment=
usershare_acl=S-1-1-0:R
guest_ok=n
$statbuf = stat($filename);
$w=$statbuf['mode'];
if ($w&0x0800){
suidビットON
} else {
suidビット OFF
}
owner@:-w-p---A-W----:------:allow
owner@:r-----a-R-c---:------:allow
owner@:--x-----------:------:allow
owner@:rwxpd-aARWcC-s:------:allow
owner@:rwxpdDaARWcCos:------:allow
owner@:------------o-:------:allow
owner@:-----------C--:------:allow
owner@:----------c---:------:allow
owner@:----d---------:------:allow
owner@::---------W----:------:allow
owner@:-------A------:------:allow
owner@:---p----------:------:allow
owner@:-w------------:------:allow
owner@:--------R-----:------:allow
owner@:------a-------:------:allow
owner@:r-------------:------:allow
owner@:--x-----------:------:allow
owner@:rwxpdDaARWcCos:------:allow
if (nt4_compatible_acls()) {
/*
* The security mask may be UNIX_ACCESS_NONE which should map into
* no permissions (we overload the WRITE_OWNER bit for this) or it
* should be one of the ALL/EXECUTE/READ/WRITE bits. Arrange for this
* to be so. Any other bits override the UNIX_ACCESS_NONE bit.
*/
/*
* Convert GENERIC bits to specific bits.
*/
se_map_generic(&psa->access_mask, &file_generic_mapping);
psa->access_mask &= (UNIX_ACCESS_NONE|FILE_ALL_ACCESS);
if(psa->access_mask != UNIX_ACCESS_NONE)
psa->access_mask &= ~UNIX_ACCESS_NONE;
}
/*
* Deal with the fact that NT 4.x re-writes the canonical format
* that we return for default ACLs. If a directory ACE is identical
* to a inherited directory ACE then NT changes the bits so that the
* first ACE is set to OI|IO and the second ACE for this SID is set
* to CI. We need to repair this. JRA.
*/
for(i = 0; i < dacl->num_aces; i++) {
SEC_ACE *psa1 = &dacl->aces[i];
for (j = i + 1; j < dacl->num_aces; j++) {
SEC_ACE *psa2 = &dacl->aces[j];
if (psa1->access_mask != psa2->access_mask)
continue;
if (!sid_equal(&psa1->trustee, &psa2->trustee))
continue;
/*
* Ok - permission bits and SIDs are equal.
* Check if flags were re-written.
*/
if (psa1->flags & SEC_ACE_FLAG_INHERIT_ONLY) {
psa1->flags |= (psa2->flags & (SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT));
psa2->flags &= ~(SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT);
} else if (psa2->flags & SEC_ACE_FLAG_INHERIT_ONLY) {
psa2->flags |= (psa1->flags & (SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT));
psa1->flags &= ~(SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT);
}
}
}
if( sid_equal(¤t_ace->trustee, &global_sid_World)) {
current_ace->owner_type = WORLD_ACE;
current_ace->unix_ug.world = -1;
current_ace->type = SMB_ACL_OTHER;
} else if (sid_equal(¤t_ace->trustee, &global_sid_Creator_Owner)) {
current_ace->owner_type = UID_ACE;
current_ace->unix_ug.uid = pst->st_uid;
current_ace->type = SMB_ACL_USER_OBJ;
} else if (sid_equal(¤t_ace->trustee, &global_sid_Creator_Group)) {
current_ace->owner_type = GID_ACE;
current_ace->unix_ug.gid = pst->st_gid;
current_ace->type = SMB_ACL_GROUP_OBJ;
} else if (sid_to_uid( ¤t_ace->trustee, ¤t_ace->unix_ug.uid)) {
current_ace->owner_type = UID_ACE;
/* If it's the owning user, this is a user_obj, not
* a user. */
if (current_ace->unix_ug.uid == pst->st_uid) {
current_ace->type = SMB_ACL_USER_OBJ;
} else {
current_ace->type = SMB_ACL_USER;
}
} else if (sid_to_gid( ¤t_ace->trustee, ¤t_ace->unix_ug.gid)) {
current_ace->owner_type = GID_ACE;
/* If it's the primary group, this is a group_obj, not
* a group. */
if (current_ace->unix_ug.gid == pst->st_gid) {
current_ace->type = SMB_ACL_GROUP_OBJ;
} else {
current_ace->type = SMB_ACL_GROUP;
}
# ldapadd -x -W -D "cn=Manager,dc=osstech,dc=co,dc=jp" -f /home/yasuma/mod1.ldif
Enter LDAP Password:
adding new entry "cn=group6,ou=Groups,dc=osstech,dc=co,dc=jp"
ldap_add: Internal (implementation specific) error (80)
additional info: no structuralObjectClass operational attribute
objectclass ( 1.3.6.1.1.1.2.2 NAME 'posixGroup'
DESC 'Abstraction of a group of accounts'
SUP top STRUCTURAL
MUST ( cn $ gidNumber )
MAY ( userPassword $ memberUid $ description ) )
structuralObjectClass: posixGroup
objectclass ( 1.3.6.1.4.1.7165.2.2.4 NAME 'sambaGroupMapping' SUP top AUXILIARY
DESC 'Samba Group Mapping'
MUST ( gidNumber $ sambaSID $ sambaGroupType )
MAY ( displayName $ description $ sambaSIDList ))
dn: cn=group6,ou=Groups,dc=osstech,dc=co,dc=jp
objectClass: top
objectClass: posixGroup
objectClass: sambaGroupMapping
cn: group6
gidNumber: 1005
structuralObjectClass: posixGroup