Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
ca9e3716
D
Dak
项目概览
喜羊羊3508
/
Dak
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ca9e3716
编写于
9月 11, 2010
作者:
J
Joerg Jaspert
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove old code
Signed-off-by:
N
Joerg Jaspert
<
joerg@debian.org
>
上级
3dd38ef3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
32 deletion
+0
-32
dak/add_user.py
dak/add_user.py
+0
-32
未找到文件。
dak/add_user.py
浏览文件 @
ca9e3716
...
...
@@ -126,12 +126,6 @@ def main():
if
not
keyrings
:
keyrings
=
Cnf
.
ValueList
(
"Dinstall::GPGKeyring"
)
# Ignore the PGP keyring for download of new keys. Ignore errors, if key is missing it will
# barf with the next commands.
cmd
=
"gpg --no-secmem-warning --no-default-keyring %s --recv-keys %s"
\
%
(
utils
.
gpg_keyring_args
(
keyrings
),
Cnf
[
"Add-User::Options::Key"
])
(
result
,
output
)
=
commands
.
getstatusoutput
(
cmd
)
cmd
=
"gpg --with-colons --no-secmem-warning --no-auto-check-trustdb --no-default-keyring %s --with-fingerprint --list-key %s"
\
%
(
utils
.
gpg_keyring_args
(
keyrings
),
Cnf
[
"Add-User::Options::Key"
])
...
...
@@ -167,7 +161,6 @@ def main():
continue
emails
.
append
(
e
.
group
(
2
))
print
"0x%s -> %s <%s> -> %s -> %s"
%
(
Cnf
[
"Add-User::Options::Key"
],
name
,
emails
[
0
],
uid
,
primary_key
)
prompt
=
"Add user %s with above data (y/N) ? "
%
(
uid
)
...
...
@@ -176,23 +169,6 @@ def main():
if
yn
==
"y"
:
# Create an account for the user?
summary
=
""
if
Cnf
.
FindB
(
"Add-User::CreateAccount"
)
or
Cnf
[
"Add-User::Options::Create"
]:
password
=
GenPass
()
pwcrypt
=
HashPass
(
password
)
if
Cnf
.
has_key
(
"Add-User::GID"
):
cmd
=
"sudo /usr/sbin/useradd -g users -m -p '%s' -c '%s' -G %s %s"
\
%
(
pwcrypt
,
name
,
Cnf
[
"Add-User::GID"
],
uid
)
else
:
cmd
=
"sudo /usr/sbin/useradd -g users -m -p '%s' -c '%s' %s"
\
%
(
pwcrypt
,
name
,
uid
)
(
result
,
output
)
=
commands
.
getstatusoutput
(
cmd
)
if
(
result
!=
0
):
utils
.
fubar
(
"Invocation of '%s' failed:
\n
%s
\n
"
%
(
cmd
,
output
),
result
)
try
:
summary
+=
createMail
(
uid
,
password
,
Cnf
[
"Add-User::Options::Key"
],
Cnf
[
"Dinstall::GPGKeyring"
])
except
:
summary
=
""
utils
.
warn
(
"Could not prepare password information for mail, not sending password."
)
# Now add user to the database.
# Note that we provide a session, so we're responsible for committing
...
...
@@ -200,14 +176,6 @@ def main():
uid_id
=
uidobj
.
uid_id
session
.
commit
()
# The following two are kicked out in rhona, so we don't set them. kelly adds
# them as soon as she installs a package with unknown ones, so no problems to expect here.
# Just leave the comment in, to not think about "Why the hell aren't they added" in
# a year, if we ever touch uma again.
# maint_id = database.get_or_set_maintainer_id(name)
# session.execute("INSERT INTO fingerprint (fingerprint, uid) VALUES (:fingerprint, uid)",
# {'fingerprint': primary_key, 'uid': uid_id})
# Lets add user to the email-whitelist file if its configured.
if
Cnf
.
has_key
(
"Dinstall::MailWhiteList"
)
and
Cnf
[
"Dinstall::MailWhiteList"
]
!=
""
:
f
=
utils
.
open_file
(
Cnf
[
"Dinstall::MailWhiteList"
],
"a"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录