A BUGNOTE has been added to this bug.
======================================================================
http://dbmail.org/mantis/bug_view_advanced_page.php?bug_id=0000118
======================================================================
Reported By: seanc
Assigned To:
======================================================================
Project: DBMail
Bug ID: 118
Category: Command-Line programs (dbmail-users, dbmail-util)
Reproducibility: always
Severity: major
Priority: normal
Status: acknowledged
======================================================================
Date Submitted: 15-Nov-04 10:55 CET
Last Modified: 25-Nov-04 10:41 CET
======================================================================
Summary: dbmail-users -c [EMAIL PROTECTED] -W
Description:
The -W flag to dbmail-users doesn't work.
======================================================================
----------------------------------------------------------------------
aaron - 15-Nov-04 11:58 CET
----------------------------------------------------------------------
Try the arguments in reverse. Let me know if that fixes it.
If it does, apply the patch and let me know if that fixes it, too.
If both are true, it's a subtle and stupid FreeBSD extension to POSIX
getopt.
----------------------------------------------------------------------
seanc - 15-Nov-04 12:11 CET
----------------------------------------------------------------------
Reversing the options results in an error:
% dbmail-users -a [EMAIL PROTECTED] -W
Opening connection to database...
Opening connection to authentication...
Ok. Connected
Adding user [EMAIL PROTECTED] with password type ,0 bytes mailbox limit and
clientid 0... Ok, user added id [9]
Adding INBOX for new user
Ok. added
Done
% dbmail-users -c [EMAIL PROTECTED] -W
Opening connection to database...
Opening connection to authentication...
Ok. Connected
Performing changes for user [EMAIL PROTECTED]
Done
% dbmail-users -Wc [EMAIL PROTECTED] -W
*** dbmail-users ***
Use this program to manage your DBMail users.
See the man page for more info. Modes of operation:
-a user add a user
-d user delete a user
-c user change details for a user
-e user empty all mailboxes for a user
-l uspec list information for matching users
-x alias create an external forwarding address
Summary of options for all modes:
-w passwd specify user's password on the command line
-W [file] read from a file or prompt for a user's password
-p pwtype password type may be one of the following:
plaintext, crypt, md5-hash, md5-digest,
crypt-raw, md5-hash-raw, md5-digest-raw
-P [file] pull encrypted password from the shadow file
-u user new username (only useful for -c, change)
-g client assign the user to a client
-m max set the maximum mail quota in <bytes>B,
<kbytes>K, or <mbytes>M, default in bytes
specify 0 to remove any mail quota limits
-s alia.. adds a list of recipient aliases
-S alia.. removes a list of recipient aliases (wildcards supported)
-t fwds.. adds a list of deliver-to forwards
-T fwds.. removes a list of deliver-to forwards (wildcards
supported)
Common options for all DBMail utilities:
-f file specify an alternative config file
-q quietly skip interactive prompts
use twice to suppress error messages
-v verbose details
-V show the version
-h show this help message
Exit 1
% dbmail-users -cW [EMAIL PROTECTED] -W
Opening connection to database...
Opening connection to authentication...
Ok. Connected
Error: user [W] does not exist.
Command failed.
Exit 255
% dbmail-users -cW [EMAIL PROTECTED]
Opening connection to database...
Opening connection to authentication...
Ok. Connected
Error: user [W] does not exist.
Command failed.
I tried futzing with getopt()'s format and removing the double colons and
replacing it with single colons, as well as applying the patch: none of
the above worked. The differences between glibc and BSD's getopt()
wouldn't change the outcome of this.
----------------------------------------------------------------------
aaron - 15-Nov-04 12:14 CET
----------------------------------------------------------------------
Sorry, I'm shooting for this:
dbmail-users -W -c [EMAIL PROTECTED]
----------------------------------------------------------------------
seanc - 15-Nov-04 12:22 CET
----------------------------------------------------------------------
I tried both of the following:
% dbmail-users -W -c [EMAIL PROTECTED]
% dbmail-users -Wc [EMAIL PROTECTED]
% dbmail-users -c [EMAIL PROTECTED] -W
And none of them work.
----------------------------------------------------------------------
aaron - 15-Nov-04 12:33 CET
----------------------------------------------------------------------
Hrmm...
Well, it Works for Me (TM). I'll see about playing with DBMail on a BSD
machine to try and duplicate the problem.
----------------------------------------------------------------------
ilja - 24-Nov-04 15:58 CET
----------------------------------------------------------------------
this will get more attention after the release of dbmail 2.0.1
----------------------------------------------------------------------
aaron - 25-Nov-04 10:41 CET
----------------------------------------------------------------------
On an OpenBSD machine, I can confirm that the BSD version of getopt() is
really, really picky. So dbmail-users -Wc bob fails, as does dbmail-users
-W -c bob. The only one that works is dbmail-users -c bob -W.
That aside, I am properly prompted for a password on OpenBSD.
Guess I'll have to dig up a FreeBSD machine to test this on, too.
Incidentally, I'm testing 2.0.1 right now. You're on HEAD. I'm 99% sure
that the two are identical in user.c, but I'll have to check...
Bug History
Date Modified Username Field Change
======================================================================
15-Nov-04 10:55seanc New Bug
15-Nov-04 11:58aaron Bugnote Added: 0000352
15-Nov-04 11:59aaron File Added: user-reset.diff
15-Nov-04 12:11seanc Bugnote Added: 0000353
15-Nov-04 12:14aaron Bugnote Added: 0000354
15-Nov-04 12:22seanc Bugnote Added: 0000355
15-Nov-04 12:33aaron Bugnote Added: 0000356
24-Nov-04 15:58ilja Bugnote Added: 0000370
24-Nov-04 15:58ilja Status new => acknowledged
25-Nov-04 10:41aaron Bugnote Added: 0000379
======================================================================