1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

more syncs from 3.0

(This used to be commit bb7d5ce376)
This commit is contained in:
Gerald Carter 2003-09-24 15:08:05 +00:00
parent 293421f3c6
commit 4b10dd9454
7 changed files with 133 additions and 128 deletions

View File

@ -0,0 +1,17 @@
<samba:parameter name="afs share"
context="S"
advanced="1"
xmlns:samba="http://samba.org/common">
<listitem>
<para>This parameter controls whether special AFS features are enabled
for this share. If enabled, it assumes that the directory exported via
the <parameter>path</parameter> parameter is a local AFS import. The
special AFS features include the attempt to hand-craft an AFS token
if you enabled --with-fake-kaserver in configure.
</para>
<para>Default: <command moreinfo="none">afs share = no</command></para>
<para>Example: <command moreinfo="none">afs share = yes</command></para>
</listitem>
</samba:parameter>

View File

@ -0,0 +1,20 @@
<samba:parameter name="afs username map"
context="G"
advanced="1"
xmlns:samba="http://samba.org/common">
<listitem>
<para>If you are using the fake kaserver AFS feature, you might
want to hand-craft the usernames you are creating tokens for.
For example this is necessary if you have users from several domain
in your AFS Protection Database. One possible scheme to code users
as DOMAIN+User as it is done by winbind with the + as a separator.
</para>
<para>The mapped user name must contain the cell name to log into,
so without setting this parameter there will be no token.</para>
<para>Default: <command moreinfo="none">none</command></para>
<para>Example: <command moreinfo="none">afs username map = %u@afs.samba.org</command></para>
</listitem>
</samba:parameter>

40
docs/htmldocs/index.html Executable file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/perl -w
# This code was developped by IDEALX (http://IDEALX.org/) and
# contributors (their names can be found in the CONTRIBUTORS file).
#
@ -23,6 +23,9 @@
use strict;
use FindBin;
use FindBin qw($RealBin);
use lib "$RealBin/";
use smbldap_tools;
use smbldap_conf;
@ -70,45 +73,30 @@ if (defined($tmp = $Options{'g'}) and $tmp =~ /\d+/) {
}
}
if (!($gid == $tmp)) {
my $tmpldif =
"dn: cn=$groupName,$groupsdn
changetype: modify
replace: gidNumber
gidNumber: $tmp
";
die "$0: error while modifying group $groupName\n"
unless (do_ldapmodify($tmpldif) == 0);
undef $tmpldif;
my $ldap_master=connect_ldap_master();
my $modify = $ldap_master->modify ( "cn=$groupName,$groupsdn",
changes => [
replace => [gidNumber => $tmp]
]
);
$modify->code && die "failed to modify entry: ", $modify->error ;
# take down session
$ldap_master->unbind
}
}
if (defined($newname)) {
my $FILE="|$ldapmodrdn >/dev/null";
open (FILE, $FILE) || die "$!\n";
print FILE <<EOF;
cn=$groupName,$groupsdn
cn=$newname
EOF
;
close FILE;
die "$0: error while modifying group $groupName\n" if ($?);
my $tmpldif =
"dn: cn=$newname,$groupsdn
changetype: modify
delete: cn
-
add: cn
cn: $newname
";
die "$0: error while modifying group $groupName\n"
unless (do_ldapmodify($tmpldif) == 0);
undef $tmpldif;
my $ldap_master=connect_ldap_master();
my $modify = $ldap_master->moddn (
"cn=$groupName,$groupsdn",
newrdn => "cn=$newname",
deleteoldrdn => "1",
newsuperior => "$groupsdn"
);
$modify->code && die "failed to modify entry: ", $modify->error ;
# take down session
$ldap_master->unbind
}
# Add members
@ -117,16 +105,24 @@ if (defined($Options{'m'})) {
my @members = split( /,/, $members );
my $member;
foreach $member ( @members ) {
my $tmpldif =
"dn: cn=$groupName,$groupsdn
changetype: modify
add: memberUid
memberUid: $member
";
die "$0: error while modifying group $groupName\n"
unless (do_ldapmodify($tmpldif) == 0);
undef $tmpldif;
if (is_unix_user($member)) {
if (is_group_member("cn=$groupName,$groupsdn",$member)) {
print "User $member already in the group\n";
} else {
print "adding user $member to group $groupName\n";
my $ldap_master=connect_ldap_master();
my $modify = $ldap_master->modify ( "cn=$groupName,$groupsdn",
changes => [
add => [memberUid => $member]
]
);
$modify->code && warn "failed to add entry: ", $modify->error ;
# take down session
$ldap_master->unbind
}
} else {
print "User $member does not exist: create it first !\n";
}
}
}
@ -136,16 +132,20 @@ if (defined($Options{'x'})) {
my @members = split( /,/, $members );
my $member;
foreach $member ( @members ) {
my $tmpldif =
"dn: cn=$groupName,$groupsdn
changetype: modify
delete: memberUid
memberUid: $member
";
die "$0: error while modifying group $groupName\n"
unless (do_ldapmodify($tmpldif) == 0);
undef $tmpldif;
if (is_group_member("cn=$groupName,$groupsdn",$member)) {
print "deleting user $member from group $groupName\n";
my $ldap_master=connect_ldap_master();
my $modify = $ldap_master->modify ( "cn=$groupName,$groupsdn",
changes => [
delete => [memberUid => $member]
]
);
$modify->code && warn "failed to delete entry: ", $modify->error ;
# take down session
$ldap_master->unbind
} else {
print "User $member is not in the group $groupName!\n";
}
}
}