diff options
author | Karel Zak | 2013-02-13 13:44:34 +0100 |
---|---|---|
committer | Karel Zak | 2013-02-13 13:44:34 +0100 |
commit | d86918b6eb854de38a6e02b81466fcc0419cef98 (patch) | |
tree | cd3c94684bbe241411918306bbfb76b2af7d9cc8 /login-utils/libuser.c | |
parent | libmount: correctly propagate ambivalent blkid probing results (diff) | |
download | kernel-qcow2-util-linux-d86918b6eb854de38a6e02b81466fcc0419cef98.tar.gz kernel-qcow2-util-linux-d86918b6eb854de38a6e02b81466fcc0419cef98.tar.xz kernel-qcow2-util-linux-d86918b6eb854de38a6e02b81466fcc0419cef98.zip |
chsh-chfn: fix bugs, improve compilation
* rename --disable-require-password to --disable-chsh-chfn-password
* is_local() is really unnecessary when linked with libuser
* fix set_value_libuser() returns codes
* fix chfn.c, there is no 'pw', but oldf.pw
* don't link with PAM when--disable-chsh-chfn-password
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/libuser.c')
-rw-r--r-- | login-utils/libuser.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/login-utils/libuser.c b/login-utils/libuser.c index 53c7ac9e2..b11fadc1c 100644 --- a/login-utils/libuser.c +++ b/login-utils/libuser.c @@ -23,7 +23,7 @@ static int auth_lu(const char *service_name, struct lu_context *ctx, uid_t uid, static int auth_lu(const char *service_name, struct lu_context *ctx, uid_t uid, const char *username) { - if(!lu_uses_elevated_privileges(ctx)) { + if (!lu_uses_elevated_privileges(ctx)) { /* Drop privileges */ if (setegid(getgid()) == -1) err(EXIT_FAILURE, _("Couldn't drop group privileges")); @@ -47,7 +47,7 @@ int set_value_libuser(const char *service_name, const char *username, uid_t uid, errx(EXIT_FAILURE, _("libuser initialization failed: %s."), lu_strerror(error)); - if(!auth_lu(service_name, ctx, uid, username)) { + if (!auth_lu(service_name, ctx, uid, username)) { errno = EACCES; err(EXIT_FAILURE, _("changing user attribute failed")); } @@ -67,5 +67,6 @@ int set_value_libuser(const char *service_name, const char *username, uid_t uid, } lu_ent_free(ent); lu_end(ctx); - return TRUE; + + return 0; } |