-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement planned features #1
Conversation
Agent implements the body of ep-agent program. It watches etcd and synchronizes users and groups of the running system with the entries in the etcd database. Syncer is an interface that abstracts how it modifies the system users and groups. Implementations will be added but planned ones are: * UbuntuSyncer: uses adduser/addgroup to modify local users/groups. * DummySyncer: do not modify local users/groups, but pretends. * MockSyncer: for tests.
agent/sync.go
Outdated
}) | ||
} | ||
|
||
// remove users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ユーザの primary group になっている group は消せないので、
remove users は remove groups より前にやった方がよさそう。
$ sudo groupadd aaa
$ sudo groupadd bbb
$ sudo useradd -g aaa -G bbb -m foo
$ id foo
uid=1001(foo) gid=1002(aaa) groups=1002(aaa),1003(bbb)
$ sudo groupdel aaa
groupdel: cannot remove the primary group of user 'foo'
$ sudo groupdel bbb
# supplementary group を消すのは成功する
$ id foo
uid=1001(foo) gid=1002(aaa) groups=1002(aaa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かに。
auth.go
Outdated
} | ||
|
||
return cmd.CommandContext(ctx, "userdel", "--force", username).Run() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ファイルごと消してくだち。
cmd/etcdpasswd/USAGE.md
Outdated
- `group remove NAME` | ||
- `locker list` | ||
- `locker lock NAME` | ||
- `locker unlock NAME` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここも add/remove で。
cli/user.go
Outdated
f.StringVar(&c.displayName, "display", "", "display name") | ||
f.StringVar(&c.group, "group", "", "primary group") | ||
f.Var(&c.groups, "groups", "comma-separated supplementary groups") | ||
f.StringVar(&c.shell, "shell", etcdpasswd.DefaultShell, "shell program") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
デフォルトシェルは設定で切り替えられるので、フラグのデフォルト値としては group, groups 同様に空文字列が良いかと。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そうします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.