Re: migrate python script from sudo to doas

2018-11-03 Thread Markus Rosjat
Hi Vincent, Am 03.11.2018 um 07:22 schrieb vincent delft: Hello Markus, I cannot reproduce your problem. As you can see here under I can create a user "test1" on the command line, and, with the same userid, I can create it with python2 and python3 too. (I'm running 6.4) I see 2 possible

Re: migrate python script from sudo to doas

2018-11-03 Thread vincent delft
Hello Markus, I cannot reproduce your problem. As you can see here under I can create a user "test1" on the command line, and, with the same userid, I can create it with python2 and python3 too. (I'm running 6.4) I see 2 possible cause : - your python script, - or maybe the userid for which

Re: migrate python script from sudo to doas

2018-10-31 Thread Markus Rosjat
Hi Vincent Am 30.10.2018 um 16:03 schrieb Vincent Legoll: Maybe you should try like the following: cmd = ['doas', 'useradd', '-u', user_id, '-g', '=uid', '-s', '/sbin/nologin', '-d', mb_parent_dir, user_name] exit = subprocess.check_call(cmd) this doesn't solve the problem,

Re: migrate python script from sudo to doas

2018-10-30 Thread Vincent Legoll
Hello, On Tue, Oct 30, 2018 at 12:33 PM Markus Rosjat wrote: > exit = subprocess.check_call(['doas', 'useradd', '-u %s' % user_id, > '-g =uid', > '-s /sbin/nologin', > '-d %s' % mb_parent_dir, > user_name]) Maybe you should try like the following: cmd = ['doas', 'useradd', '-u', user_id,

Re: migrate python script from sudo to doas

2018-10-30 Thread Markus Rosjat
Hi, as I stated before on a cmd is no problem, Im using 6.4 release Am 30.10.2018 um 12:56 schrieb Solene Rapenne: Markus Rosjat wrote: hi all, I have some old python scripts that using os.spawnl to execute stuff like useradd  combined with sudo. This worked just fine on systems with sudo

Re: migrate python script from sudo to doas

2018-10-30 Thread Solene Rapenne
Markus Rosjat wrote: > hi all, > > I have some old python scripts that using os.spawnl to execute stuff > like useradd  combined with sudo. This worked just fine on systems with > sudo installed  but these days we have doas and its totally enough for > things I use to do so I said to myself

migrate python script from sudo to doas

2018-10-30 Thread Markus Rosjat
hi all, I have some old python scripts that using os.spawnl to execute stuff like useradd  combined with sudo. This worked just fine on systems with sudo installed  but these days we have doas and its totally enough for things I use to do so I said to myself "lets update these old scripts