Thomas Leuxner
2010-Dec-28 13:39 UTC
[Dovecot] 'Doveadm user' could use better error codes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The error codes for' doveadm user' should be improved to avoid error handling workarounds when scripting commands: $ doveadm user doveadm user [-a <userdb socket path>] [-x <auth info>] <user mask> [?] $ echo $? 1 $ doveadm user foo userdb lookup: user foo doesn't exist $ echo $? 0 Please compare to ID output: $ id foo id: foo: No such user $ echo $? 1 Regards Thomas - -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) iEYEARECAAYFAk0Z6FkACgkQ+meF/S97aXgxnQCfWk1ECdMoCewbr1O6lAkdksoH 324AoLCTg0dFmFhumEkM936irpcG7YF5 =wuwz - -----END PGP SIGNATURE----- -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) iEYEARECAAYFAk0Z6HQACgkQ+meF/S97aXgGdACfawa02hZxk71CjIsj64sW0xXv CW8AoJRQZLFi4QwbvcDg6rzqzUv/3mE8 =Rt1O -----END PGP SIGNATURE-----
On 28-12-10 14:39, Thomas Leuxner wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > - -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > The error codes for' doveadm user' should be improved to avoid error handling workarounds when scripting commands: > > $ doveadm user > doveadm user [-a<userdb socket path>] [-x<auth info>]<user mask> [?] > $ echo $? > 1 > $ doveadm user foo > userdb lookup: user foo doesn't exist > $ echo $? > 0 > > Please compare to ID output: > > $ id foo > id: foo: No such user > $ echo $? > 1 > > Regards > Thomas > > - -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.16 (Darwin) > > iEYEARECAAYFAk0Z6FkACgkQ+meF/S97aXgxnQCfWk1ECdMoCewbr1O6lAkdksoH > 324AoLCTg0dFmFhumEkM936irpcG7YF5 > =wuwz > - -----END PGP SIGNATURE----- > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.16 (Darwin) > > iEYEARECAAYFAk0Z6HQACgkQ+meF/S97aXgGdACfawa02hZxk71CjIsj64sW0xXv > CW8AoJRQZLFi4QwbvcDg6rzqzUv/3mE8 > =Rt1O > -----END PGP SIGNATURE----- >It behaves just as 'man doveadm' promisses..... EXIT STATUS doveadm will exit with one of the following values: 0 Selected command was executed successful. >0 Command failed in some way. So, this seems to be correct!
On Tue, 2010-12-28 at 14:39 +0100, Thomas Leuxner wrote:> $ doveadm user foo > userdb lookup: user foo doesn't exist > $ echo $? > 0How about: http://hg.dovecot.org/dovecot-2.0/rev/c9b3716e56f7 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20101230/caf654f7/attachment-0002.bin>