This is a multi-part message in MIME format.
--------------040503050400050604020005
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Okay, so apparently it was a little easier to code than I anticipated.
The supplied patch removes the error message I was seeing. Whether or
not authid-rewrite actually works is a different question which I have
yet to figure out.
The second patch (for config.c) isn't directly related to this bug, but
would be nice.
I've never done a patch before, so I have no idea if I created these
correctly. I used the command:
diff -c oldfile newfile > file.diff
Is this the proper way to do that?
--------------040503050400050604020005
Content-Type: text/x-patch;
name="config.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="config.c.diff"
*** config.c 2009-01-21 17:00:58.000000000 -0700
--- config.c.new 2009-11-21 00:56:08.000000000 -0700
***************
*** 288,294 ****
} else {
Debug( LDAP_DEBUG_ANY,
"[%s:%d] unknown command '%s'\n",
! fname, lineno, "" );
return -1;
}
--- 288,294 ----
} else {
Debug( LDAP_DEBUG_ANY,
"[%s:%d] unknown command '%s'\n",
! fname, lineno, argv[0] );
return -1;
}
--------------040503050400050604020005
Content-Type: text/x-patch;
name="saslauthz.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="saslauthz.c.diff"
*** saslauthz.c 2009-01-21 17:01:03.000000000 -0700
--- saslauthz.c.new 2009-11-21 00:52:15.000000000 -0700
***************
*** 1284,1289 ****
--- 1284,1290 ----
)
{
int rc;
+ int i;
char *savearg0;
/* init at first call */
***************
*** 1291,1300 ****
sasl_rwinfo = rewrite_info_init( REWRITE_MODE_USE_DEFAULT );
}
- /* strip "authid-" prefix for parsing */
savearg0 = argv[0];
argv[0] += STRLENOF( "authid-" );
rc = rewrite_parse( sasl_rwinfo, fname, lineno, argc, argv );
argv[0] = savearg0;
return rc;
--- 1292,1310 ----
sasl_rwinfo = rewrite_info_init( REWRITE_MODE_USE_DEFAULT );
}
savearg0 = argv[0];
+ /* temporarily shift argv to get rid of argv[0] */
+ for ( i = 1; i <= argc; i++ ) {
+ argv[i-1] = argv[i];
+ }
+ argc--;
+ /* strip "authid-" prefix for parsing */
argv[0] += STRLENOF( "authid-" );
rc = rewrite_parse( sasl_rwinfo, fname, lineno, argc, argv );
+ argc++;
+ for ( i = argc; i >= 1; i-- ) {
+ argv[i] = argv[i-1];
+ }
argv[0] = savearg0;
return rc;
--------------040503050400050604020005--