Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F222908
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/plugins/password/drivers/dbmail.php b/plugins/password/drivers/dbmail.php
index 529027b8d..5cfe92cd7 100644
--- a/plugins/password/drivers/dbmail.php
+++ b/plugins/password/drivers/dbmail.php
@@ -1,42 +1,42 @@
<?php
/**
* DBMail Password Driver
*
* Driver that adds functionality to change the users DBMail password.
* The code is derrived from the Squirrelmail "Change SASL Password" Plugin
* by Galen Johnson.
*
* It only works with dbmail-users on the same host where Roundcube runs
* and requires shell access and gcc in order to compile the binary.
*
* For installation instructions please read the README file.
*
* @version 1.0
*/
class rcube_dbmail_password
{
- function password_save($currpass, $newpass)
+ function save($currpass, $newpass)
{
$curdir = RCUBE_PLUGINS_DIR . 'password/helpers';
$username = escapeshellcmd($_SESSION['username']);
$args = rcmail::get_instance()->config->get('password_dbmail_args', '');
exec("$curdir/chgdbmailusers -c $username -w $newpass $args", $output, $returnvalue);
if ($returnvalue == 0) {
return PASSWORD_SUCCESS;
}
else {
rcube::raise_error(array(
'code' => 600,
'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Password plugin: Unable to execute $curdir/chgdbmailusers"
), true, false);
}
return PASSWORD_ERROR;
}
}
diff --git a/plugins/password/helpers/chgdbmailusers.c b/plugins/password/helpers/chgdbmailusers.c
index 28f79c100..22793857d 100644
--- a/plugins/password/helpers/chgdbmailusers.c
+++ b/plugins/password/helpers/chgdbmailusers.c
@@ -1,48 +1,47 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
// set the UID this script will run as (root user)
#define UID 0
#define CMD "/usr/sbin/dbmail-users"
-#define RCOK 0x100
/* INSTALLING:
gcc -o chgdbmailusers chgdbmailusers.c
chown root.apache chgdbmailusers
strip chgdbmailusers
chmod 4550 chgdbmailusers
*/
main(int argc, char *argv[])
{
int cnt,rc,cc;
char cmnd[255];
strcpy(cmnd, CMD);
if (argc > 1)
{
for (cnt = 1; cnt < argc; cnt++)
{
strcat(cmnd, " ");
strcat(cmnd, argv[cnt]);
}
}
else
{
fprintf(stderr, "__ %s: failed %d %d\n", argv[0], rc, cc);
return 255;
}
cc = setuid(UID);
rc = system(cmnd);
- if ((rc != RCOK) || (cc != 0))
+ if ((rc != 0) || (cc != 0))
{
fprintf(stderr, "__ %s: failed %d %d\n", argv[0], rc, cc);
return 1;
}
return 0;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Mar 1, 12:19 AM (57 m, 57 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
165201
Default Alt Text
(2 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment