Skip to content

Commit 760ecb5

Browse files
authored
Merge branch 'sonic-net:master' into master
2 parents 512cfac + 246f2d2 commit 760ecb5

27 files changed

+1309
-17
lines changed

data/templates/common-auth-sonic.j2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ auth [success=2 default=ignore] pam_exec.so /usr/sbin/cache_radius
6868
# Local
6969
auth [success=done new_authtok_reqd=done default=ignore{{ ' auth_err=die maxtries=die' if not auth['failthrough'] }}] pam_unix.so nullok try_first_pass
7070

71+
{% elif auth['login'] == 'ldap,local' %}
72+
auth [success=2 default=ignore] pam_ldap.so minimum_uid=1000 try_first_pass
73+
auth [success=1 default=ignore] pam_unix.so nullok try_first_pass
74+
{% elif auth['login'] == 'local,ldap' %}
75+
auth [success=2 default=ignore] pam_unix.so nullok try_first_pass
76+
auth [success=1 default=ignore] pam_ldap.so minimum_uid=1000 try_first_pass
77+
{% elif auth['login'] == 'ldap' %}
78+
auth [success=1 default=ignore] pam_ldap.so minimum_uid=1000 try_first_pass
79+
7180
{% else %}
7281
auth [success=1 default=ignore] pam_unix.so nullok try_first_pass
7382

data/templates/ldap.conf.j2

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{ ldap_cfg.cfg_servers(servers) }}
2+
3+
base {{ ldap_cfg.cfg_base(servers) }}
4+
5+
ldap_version {{ ldap_cfg.cfg_version(servers) }}
6+
7+
binddn {{ ldap_cfg.cfg_bind(servers) }}
8+
9+
bindpw {{ ldap_cfg.cfg_bindpw(servers) }}
10+
11+
port {{ ldap_cfg.cfg_port(servers) }}
12+
13+
scope {{ ldap_cfg.cfg_scope(servers) }}
14+
15+
timelimit {{ ldap_cfg.cfg_timeout(servers) }}
16+
17+
bind_timelimit {{ ldap_cfg.cfg_bind_timeout(servers) }}

data/templates/nslcd.conf.j2

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# /etc/nslcd.conf
2+
# nslcd configuration file. See nslcd.conf(5)
3+
# for details.
4+
5+
# The user and group nslcd should run as.
6+
uid nslcd
7+
gid nslcd
8+
9+
# The location at which the LDAP server(s) should be reachable.
10+
{{ ldap_cfg.cfg_servers(servers) }}
11+
12+
# The search base that will be used for all queries.
13+
base {{ ldap_cfg.cfg_base(servers) }}
14+
15+
16+
# The LDAP protocol version to use.
17+
ldap_version {{ ldap_cfg.cfg_version(servers) }}
18+
19+
# The DN to bind with for normal lookups.
20+
binddn {{ ldap_cfg.cfg_bind(servers) }}
21+
bindpw {{ ldap_cfg.cfg_bindpw(servers) }}
22+
23+
# The DN used for password modifications by root.
24+
#rootpwmoddn cn=admin,dc=example,dc=com
25+
26+
# SSL options
27+
#ssl off
28+
#tls_reqcert never
29+
tls_cacertfile /etc/ssl/certs/ca-certificates.crt
30+
31+
# The search scope.
32+
scope {{ ldap_cfg.cfg_scope(servers) }}
33+
34+
timelimit {{ ldap_cfg.cfg_timeout(servers) }}
35+
36+
bind_timelimit {{ ldap_cfg.cfg_bind_timeout(servers) }}
37+
38+
nss_initgroups_ignoreusers ALLLOCAL
39+
40+
nss_min_uid 1000
41+

host_modules/gcu.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,36 @@ def apply_patch_yang(self, patch_text):
3939
break
4040
return result.returncode, msg
4141

42+
@host_service.method(host_service.bus_name(MOD_NAME), in_signature='s', out_signature='is')
43+
def replace_db(self, patch_text):
44+
input_bytes = (patch_text + '\n').encode('utf-8')
45+
cmd = ['/usr/local/bin/config', 'replace', '-f', 'CONFIGDB', '/dev/stdin']
46+
47+
result = subprocess.run(cmd, input=input_bytes, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
48+
msg = ''
49+
if result.returncode:
50+
lines = result.stderr.decode().split('\n')
51+
for line in lines:
52+
if 'Error' in line:
53+
msg = line
54+
break
55+
return result.returncode, msg
56+
57+
@host_service.method(host_service.bus_name(MOD_NAME), in_signature='s', out_signature='is')
58+
def replace_yang(self, patch_text):
59+
input_bytes = (patch_text + '\n').encode('utf-8')
60+
cmd = ['/usr/local/bin/config', 'replace', '-f', 'SONICYANG', '/dev/stdin']
61+
62+
result = subprocess.run(cmd, input=input_bytes, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
63+
msg = ''
64+
if result.returncode:
65+
lines = result.stderr.decode().split('\n')
66+
for line in lines:
67+
if 'Error' in line:
68+
msg = line
69+
break
70+
return result.returncode, msg
71+
4272
@host_service.method(host_service.bus_name(MOD_NAME), in_signature='s', out_signature='is')
4373
def create_checkpoint(self, checkpoint_file):
4474

scripts/featured

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class FeatureHandler(object):
166166
def port_listener(self, key, op, data):
167167
if not key:
168168
return
169-
if op == 'SET' and key == 'PortInitDone' and not self.is_delayed_enabled:
169+
if op == 'SET' and key == 'PortInitDone':
170170
syslog.syslog(syslog.LOG_INFO, "Updating delayed features after port initialization")
171171
self.enable_delayed_services()
172172

0 commit comments

Comments
 (0)