fix(fish): 改用 SourceError 处理 shell 查询失败
This commit is contained in:
+1
-2
@@ -37,8 +37,7 @@ class FishModule(Module):
|
||||
check=False,
|
||||
)
|
||||
if result.returncode != 0:
|
||||
decman.error(f"无法读取用户 {self.user} 的 passwd 信息")
|
||||
return
|
||||
raise decman.SourceError(f"无法读取用户 {self.user} 的 passwd 信息")
|
||||
# passwd 格式: name:x:uid:gid:gecos:home:shell
|
||||
shell = result.stdout.strip().split(":")[-1]
|
||||
if shell != "/usr/bin/fish":
|
||||
|
||||
Reference in New Issue
Block a user