Compare commits
7 Commits
11_0_0-7_e
...
master
Author | SHA1 | Date | |
---|---|---|---|
7b8363f96b | |||
980b444bbd | |||
3e818d32b7 | |||
a409c24859 | |||
4177f9666a | |||
f99cce8bae | |||
e61e1a8096 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
*.log
|
*.log
|
||||||
*spec-20*
|
*spec-20*
|
||||||
*.tar.xz
|
*.tar.xz
|
||||||
|
*.bak
|
||||||
|
@@ -6,7 +6,14 @@ SMEServer Koozali developed git repo for smeserver-ibays smeserver
|
|||||||
<br />https://wiki.koozali.org/
|
<br />https://wiki.koozali.org/
|
||||||
|
|
||||||
## Bugzilla
|
## Bugzilla
|
||||||
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-ibays&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)\
|
Show list of outstanding bugs:
|
||||||
|
[All](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=NEEDINFO&bug_status=IN_PROGRESS&bug_status=RESOLVED&bug_status=VERIFIED&cf_package=smeserver-ibays&classification=SME+Server&list_id=105756&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
|
||||||
|
[Confirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=CONFIRMED&cf_package=smeserver-ibays&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
|
||||||
|
[Unconfirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&cf_package=smeserver-ibays&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
|
||||||
|
[Need info](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=NEEDINFO&cf_package=smeserver-ibays&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
|
||||||
|
[In progress](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=IN_PROGRESS&cf_package=smeserver-ibays&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
|
||||||
|
[Resolved](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=RESOLVED&cf_package=smeserver-ibays&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
|
||||||
|
[Verified](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=VERIFIED&cf_package=smeserver-ibays&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
|
||||||
And a list of outstanding Legacy bugs: (e-smith-ibays) [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-ibays&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
|
And a list of outstanding Legacy bugs: (e-smith-ibays) [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-ibays&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
@@ -33,7 +33,6 @@ foreach my $event (qw(ibay-create ibay-modify ibay-modify-files))
|
|||||||
foreach my $event (qw(post-install post-upgrade smeserver-ibays-update))
|
foreach my $event (qw(post-install post-upgrade smeserver-ibays-update))
|
||||||
{
|
{
|
||||||
event_link("init-ibays", $event, "15");
|
event_link("init-ibays", $event, "15");
|
||||||
event_link('store-ldap-smbpasswd', $event, "06");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my $event = "smeserver-ibays-update";
|
my $event = "smeserver-ibays-update";
|
||||||
@@ -44,3 +43,4 @@ safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/nmbd");
|
|||||||
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
|
||||||
event_link("systemd-reload", $event, "89");
|
event_link("systemd-reload", $event, "89");
|
||||||
event_link("systemd-default", $event, "88");
|
event_link("systemd-default", $event, "88");
|
||||||
|
event_link("store-ldap-smbpasswd",$event, "06");
|
||||||
|
@@ -28,8 +28,9 @@ use strict;
|
|||||||
use Errno;
|
use Errno;
|
||||||
use esmith::ConfigDB;
|
use esmith::ConfigDB;
|
||||||
use esmith::util;
|
use esmith::util;
|
||||||
use Net::LDAP;
|
|
||||||
use esmith::AccountsDB;
|
use esmith::AccountsDB;
|
||||||
|
use utf8;
|
||||||
|
use esmith::util::ldap;
|
||||||
|
|
||||||
my $adb = esmith::AccountsDB->open_ro();
|
my $adb = esmith::AccountsDB->open_ro();
|
||||||
|
|
||||||
@@ -41,22 +42,8 @@ unless ($conf->get('ldap')->prop('status') eq "enabled" )
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $domain = $conf->get('DomainName')
|
|
||||||
|| die("Couldn't determine domain name");
|
|
||||||
$domain = $domain->value;
|
|
||||||
|
|
||||||
# prepare LDAP bind
|
# prepare LDAP bind
|
||||||
my $pw = esmith::util::LdapPassword();
|
my $ldap=esmith::util::ldap->new();
|
||||||
my $base = esmith::util::ldapBase ($domain);
|
|
||||||
|
|
||||||
my $ldap = Net::LDAP->new('localhost')
|
|
||||||
or die "$@";
|
|
||||||
|
|
||||||
$ldap->bind(
|
|
||||||
dn => "cn=root,$base",
|
|
||||||
password => $pw
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
my $event = $ARGV [0];
|
my $event = $ARGV [0];
|
||||||
my $ibay = $ARGV [1];
|
my $ibay = $ARGV [1];
|
||||||
@@ -88,10 +75,10 @@ if ( "$ldapauth" ne "enabled" )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $result = $ldap->delete("uid=$ibay,ou=Users,$base");
|
my $result = $ldap->ldapdeluser($ibay);
|
||||||
$result->code && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) ibay account $ibay.\n" );
|
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) ibay account $ibay.\n" );
|
||||||
|
|
||||||
$result = $ldap->delete("cn=$ibay,ou=Groups,$base");
|
$result = $ldap->ldapdelgroup($ibay);
|
||||||
$result->code && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) group account $ibay.\n" );
|
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) group account $ibay.\n" );
|
||||||
|
|
||||||
exit $x
|
exit $x
|
||||||
|
@@ -28,30 +28,18 @@ use esmith::util;
|
|||||||
use esmith::templates;
|
use esmith::templates;
|
||||||
use esmith::AccountsDB;
|
use esmith::AccountsDB;
|
||||||
use esmith::ConfigDB;
|
use esmith::ConfigDB;
|
||||||
use Net::LDAP;
|
use utf8;
|
||||||
|
use esmith::util::ldap;
|
||||||
|
|
||||||
my $conf = esmith::ConfigDB->open_ro
|
my $conf = esmith::ConfigDB->open_ro
|
||||||
or die "Could not open Config DB";
|
or die "Could not open Config DB";
|
||||||
|
|
||||||
my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';
|
my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';
|
||||||
my $x = 0; # exit value
|
my $x = 0; # exit value
|
||||||
|
|
||||||
my $domain = $conf->get('DomainName')
|
|
||||||
|| die("Couldn't determine domain name");
|
|
||||||
$domain = $domain->value;
|
|
||||||
my $result;
|
my $result;
|
||||||
|
|
||||||
# prepare LDAP bind
|
# prepare LDAP bind
|
||||||
my $pw = esmith::util::LdapPassword();
|
my $ldap=esmith::util::ldap->new();
|
||||||
my $base = esmith::util::ldapBase ($domain);
|
|
||||||
|
|
||||||
my $ldap = Net::LDAP->new('localhost')
|
|
||||||
or die "$@";
|
|
||||||
|
|
||||||
$ldap->bind(
|
|
||||||
dn => "cn=root,$base",
|
|
||||||
password => $pw
|
|
||||||
);
|
|
||||||
|
|
||||||
$ENV{'PATH'} = "/bin";
|
$ENV{'PATH'} = "/bin";
|
||||||
|
|
||||||
@@ -108,45 +96,23 @@ if ($event eq 'ibay-create')
|
|||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# add new ibay group to ldap
|
# add new ibay group to ldap
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
$result = $ldap->add("cn=$ibayName,ou=Groups,$base",
|
$result = $ldap->ldapgroup($ibay);
|
||||||
attrs => [
|
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) group $ibayName.\n" );
|
||||||
"cn"=> $ibayName,
|
|
||||||
"gidNumber"=> $ibay->prop("Gid"),
|
|
||||||
"objectClass" => [ 'posixGroup', 'mailboxRelatedObject']
|
|
||||||
]);
|
|
||||||
$result->code && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) group $ibayName.\n" );
|
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# add new ibay user to ldap
|
# add new ibay user to ldap and lock password
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
$result = $ldap->add("uid=$ibayName,ou=Users,$base",
|
$result = $ldap->ldapuser($ibay);
|
||||||
attrs => [
|
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) account $ibayName.\n" );
|
||||||
"uidNumber" => $ibay->prop("Uid"),
|
|
||||||
"gidNumber" => $ibay->prop("Gid"),
|
|
||||||
"cn" => $ibay->prop("Name"),
|
|
||||||
"objectClass" => [ 'account', 'posixAccount', 'shadowAccount'],
|
|
||||||
"homeDirectory" => "/home/e-smith/files/ibays/$ibayName",
|
|
||||||
"loginShell" => "/bin/false",
|
|
||||||
"shadowExpire" => -1,
|
|
||||||
"shadowFlag" => 134538308,
|
|
||||||
"shadowInactive" => -1,
|
|
||||||
"shadowLastChange" => 15997,
|
|
||||||
"shadowMax" => 99999,
|
|
||||||
"shadowMin" => -1,
|
|
||||||
"shadowWarning"=> 7,
|
|
||||||
]
|
|
||||||
);
|
|
||||||
$result->code && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) account $ibayName.\n" );
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# Loop to add new user to groups "shared,". $ibay->prop("Group")
|
# Loop to add new user to groups "shared,". $ibay->prop("Group")
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
foreach my $grp ( 'shared', $ibay->prop("Group") ) {
|
foreach my $grp ( 'shared', $ibay->prop("Group") ) {
|
||||||
$result = $ldap->modify("cn=$grp,ou=Groups,$base",
|
my @groupMembers = ($ibayName);
|
||||||
add => {
|
$result = $ldap->ldapaddgroupmembers($grp,\@groupMembers);
|
||||||
"memberUid"=> [ $ibay->prop("Uid")]
|
|
||||||
});
|
|
||||||
# error code 20 is entry already exits.
|
# error code 20 is entry already exits.
|
||||||
$result->code && ( $result->code != 20 ) && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to add (ldap) account $ibayName to supplementary group $grp.\n" );
|
$result && ( $result != 20 ) && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to add (ldap) account $ibayName to supplementary group $grp.\n" );
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# Create the ibay files and set the password.
|
# Create the ibay files and set the password.
|
||||||
@@ -168,12 +134,6 @@ if ($event eq 'ibay-create')
|
|||||||
or ( $x = 255, warn "Error locking (unix) account $ibayName" );
|
or ( $x = 255, warn "Error locking (unix) account $ibayName" );
|
||||||
}
|
}
|
||||||
|
|
||||||
#------------------------------------------------------------
|
|
||||||
# lock password in ldap
|
|
||||||
#------------------------------------------------------------
|
|
||||||
$result = $ldap->modify("uid=$ibayName,ou=Users,$base",
|
|
||||||
replace => { 'userPassword' => "{crypt}!*"});
|
|
||||||
$result->code && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Error locking (ldap) account $ibayName.\n" );
|
|
||||||
}
|
}
|
||||||
elsif ($event eq 'ibay-modify' and $ibayName ne 'Primary')
|
elsif ($event eq 'ibay-modify' and $ibayName ne 'Primary')
|
||||||
{
|
{
|
||||||
@@ -190,23 +150,17 @@ elsif ($event eq 'ibay-modify' and $ibayName ne 'Primary')
|
|||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# Modify ibay description in ldap"
|
# Modify ibay description in ldap"
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
$result = $ldap->modify("uid=$ibayName,ou=Users,$base",
|
$result = $ldap->ldapuser($ibay);
|
||||||
replace => {
|
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) account $ibayName.\n" );
|
||||||
"cn" => $ibay->prop("Name"),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
$result->code && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify email of (ldap) account $ibayName.\n" );
|
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# Loop to add new user to groups "shared,". $ibay->prop("Group")
|
# Loop to add new user to groups "shared,". $ibay->prop("Group")
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
foreach my $grp ( 'shared', $ibay->prop("Group") ) {
|
foreach my $grp ( 'shared', $ibay->prop("Group") ) {
|
||||||
$result = $ldap->modify("cn=$grp,ou=Groups,$base",
|
my @groupMembers = ($ibayName);
|
||||||
add=> {
|
$result = $ldap->ldapaddgroupmembers($grp,\@groupMembers);
|
||||||
"memberUid"=> [ $ibay->prop("Uid")]
|
|
||||||
} );
|
|
||||||
# error code 20 is entry already exits.
|
# error code 20 is entry already exits.
|
||||||
$result->code && ( $result->code != 20 ) && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to add (ldap) account $ibayName to supplementary group $grp.\n" );
|
$result && ( $result != 20 ) && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to add (ldap) account $ibayName to supplementary group $grp.\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ Summary: smeserver server and gateway - ibays module
|
|||||||
%define name smeserver-ibays
|
%define name smeserver-ibays
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
%define version 11.0.0
|
%define version 11.0.0
|
||||||
%define release 7
|
%define release 10
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}%{?dist}
|
Release: %{release}%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
@@ -13,6 +13,7 @@ Source: %{name}-%{version}.tar.xz
|
|||||||
|
|
||||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
||||||
BuildArchitectures: noarch
|
BuildArchitectures: noarch
|
||||||
|
Requires: smeserver-lib >= 11.0.0-7
|
||||||
Requires: smeserver-base
|
Requires: smeserver-base
|
||||||
Requires: perl(CGI::FormMagick)
|
Requires: perl(CGI::FormMagick)
|
||||||
Requires: smeserver-formmagick
|
Requires: smeserver-formmagick
|
||||||
@@ -27,7 +28,13 @@ Provides: e-smith-ibays
|
|||||||
smeserver server and gateway software - ibays module.
|
smeserver server and gateway software - ibays module.
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sat May 18 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
|
* Sat Jan 18 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-10.sme
|
||||||
|
- cleanup MULTIPLE_RPM_OWNERS on S06store-ldap-smbpasswd [SME: 12860]
|
||||||
|
|
||||||
|
* Tue Aug 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-9.sme
|
||||||
|
- use esmith::util:ldap to manipulate ldap entries [SME: 12687]
|
||||||
|
|
||||||
|
* Sat May 18 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
|
||||||
- edit LDAP entries using Net::LDAP rather than cpu [SME: 12687]
|
- edit LDAP entries using Net::LDAP rather than cpu [SME: 12687]
|
||||||
|
|
||||||
* Sat Apr 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
|
* Sat Apr 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
|
||||||
|
Reference in New Issue
Block a user