13
13
def get_my_distro (config , os_name = None ):
14
14
if 'FreeBSD' in platform .system ():
15
15
return FreeBSDDistro (config )
16
-
16
+
17
17
if os_name is None :
18
18
if os .path .isfile (constants .os_release ):
19
19
os_name = ext_utils .get_line_starting_with ("NAME" , constants .os_release )
@@ -274,7 +274,7 @@ def __init__(self, config):
274
274
"""
275
275
super (FreeBSDDistro , self ).__init__ (config )
276
276
self .selinux = False
277
- self .ssh_service_name = 'sshd '
277
+ self .ssh_service_name = 'openssh '
278
278
self .sudoers_dir_base = '/usr/local/etc'
279
279
self .distro_name = 'FreeBSD'
280
280
@@ -296,8 +296,8 @@ def create_account(self, user, password, expiration, thumbprint, enable_nopasswd
296
296
pass
297
297
uidmin = None
298
298
try :
299
- if os .path .isfile ("/etc/login.defs " ):
300
- uidmin = int (ext_utils .get_line_starting_with ("UID_MIN " , "/etc/login.defs " ).split ()[1 ])
299
+ if os .path .isfile ("/etc/pw.conf " ):
300
+ uidmin = int (ext_utils .get_line_starting_with ("minuid " , "/etc/pw.conf " ).split ('=' )[1 ]. strip ( ' "' ) )
301
301
except (ValueError , KeyError , AttributeError , EnvironmentError ):
302
302
pass
303
303
pass
@@ -374,9 +374,8 @@ def delete_account(self, user):
374
374
return
375
375
uidmin = None
376
376
try :
377
- if os .path .isfile ("/etc/login.defs" ):
378
- uidmin = int (
379
- ext_utils .get_line_starting_with ("UID_MIN" , "/etc/login.defs" ).split ()[1 ])
377
+ if os .path .isfile ("/etc/pw.conf" ):
378
+ uidmin = int (ext_utils .get_line_starting_with ("minuid" , "/etc/pw.conf" ).split ('=' )[1 ].strip (' "' ))
380
379
except (ValueError , KeyError , AttributeError , EnvironmentError ):
381
380
pass
382
381
if uidmin is None :
0 commit comments