Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
agent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
7
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
495634e6
authored
Nov 12, 2018
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openbsd: finish password changing
parent
2e3d53de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
openbsd/FEATURES
+1
-1
openbsd/_openbsdcontext.py
+7
-3
No files found.
openbsd/FEATURES
View file @
495634e6
...
@@ -4,5 +4,5 @@ ipv6: ok
...
@@ -4,5 +4,5 @@ ipv6: ok
hostname: ?
hostname: ?
time: ok
time: ok
smb: ok
smb: ok
passwd update:
?
passwd update:
ok
get-ssh-keys: ok
get-ssh-keys: ok
openbsd/_openbsdcontext.py
View file @
495634e6
...
@@ -70,14 +70,18 @@ class Context(BaseContext):
...
@@ -70,14 +70,18 @@ class Context(BaseContext):
libc
.
clock_settime
(
CLOCK_REALTIME
,
ctypes
.
byref
(
ts
))
libc
.
clock_settime
(
CLOCK_REALTIME
,
ctypes
.
byref
(
ts
))
@staticmethod
@staticmethod
def
change_password
(
password
):
def
_change_user_password
(
username
,
password
):
# TODO: root password
enc_proc
=
subprocess
.
Popen
(
enc_proc
=
subprocess
.
Popen
(
[
'/usr/bin/encrypt'
],
[
'/usr/bin/encrypt'
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
enc_password
,
_
=
enc_proc
.
communicate
(
'
%
s
\n
'
%
password
)
enc_password
,
_
=
enc_proc
.
communicate
(
'
%
s
\n
'
%
password
)
subprocess
.
Popen
(
subprocess
.
Popen
(
[
'/usr/sbin/usermod'
,
'-p'
,
enc_password
.
strip
(),
'cloud'
])
[
'/usr/sbin/usermod'
,
'-p'
,
enc_password
.
strip
(),
username
])
@staticmethod
def
change_password
(
password
):
Context
.
_change_user_password
(
'cloud'
,
password
)
Context
.
_change_user_password
(
'root'
,
password
)
@staticmethod
@staticmethod
def
restart_networking
():
def
restart_networking
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment