Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
slapos.core
Commits
9011abf3
Commit
9011abf3
authored
Sep 18, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cygwin: always prefix partition group names with grp_
parent
322bea2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
slapos/format.py
slapos/format.py
+16
-6
No files found.
slapos/format.py
View file @
9011abf3
...
@@ -427,7 +427,7 @@ class Computer(object):
...
@@ -427,7 +427,7 @@ class Computer(object):
# Reconstructing User's
# Reconstructing User's
partition
.
path
=
os
.
path
.
join
(
self
.
instance_root
,
partition
.
reference
)
partition
.
path
=
os
.
path
.
join
(
self
.
instance_root
,
partition
.
reference
)
partition
.
user
.
setPath
(
partition
.
path
)
partition
.
user
.
setPath
(
partition
.
path
)
partition
.
user
.
additional_group_list
=
[
slapsoft
.
name
]
partition
.
user
.
additional_group_list
=
[
slapsoft
.
group
name
]
if
alter_user
:
if
alter_user
:
partition
.
user
.
create
()
partition
.
user
.
create
()
...
@@ -548,6 +548,17 @@ class User(object):
...
@@ -548,6 +548,17 @@ class User(object):
def
setPath
(
self
,
path
):
def
setPath
(
self
,
path
):
self
.
path
=
path
self
.
path
=
path
@
property
def
groupname
(
self
):
"""
Prepend 'grp_' in cygwin, where users and groups
cannot have the same name.
"""
if
sys
.
platform
==
'cygwin'
:
return
'grp_%s'
%
self
.
name
else
:
return
self
.
name
def
create
(
self
):
def
create
(
self
):
"""
"""
Create a user on the system who will be named after the self.name with its
Create a user on the system who will be named after the self.name with its
...
@@ -559,14 +570,13 @@ class User(object):
...
@@ -559,14 +570,13 @@ class User(object):
# XXX: This method shall be no-op in case if all is correctly setup
# XXX: This method shall be no-op in case if all is correctly setup
# This method shall check if all is correctly done
# This method shall check if all is correctly done
# This method shall not reset groups, just add them
# This method shall not reset groups, just add them
grpname
=
'grp_'
+
self
.
name
if
sys
.
platform
==
'cygwin'
else
self
.
name
try
:
try
:
grp
.
getgrnam
(
gr
pname
)
grp
.
getgrnam
(
self
.
grou
pname
)
except
KeyError
:
except
KeyError
:
callAndRead
([
'groupadd'
,
gr
pname
])
callAndRead
([
'groupadd'
,
self
.
grou
pname
])
user_parameter_list
=
[
'-d'
,
self
.
path
,
'-g'
,
self
.
name
]
user_parameter_list
=
[
'-d'
,
self
.
path
,
'-g'
,
self
.
group
name
]
if
self
.
additional_group_list
is
not
None
:
if
self
.
additional_group_list
:
user_parameter_list
.
extend
([
'-G'
,
','
.
join
(
self
.
additional_group_list
)])
user_parameter_list
.
extend
([
'-G'
,
','
.
join
(
self
.
additional_group_list
)])
user_parameter_list
.
append
(
self
.
name
)
user_parameter_list
.
append
(
self
.
name
)
try
:
try
:
...
...
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