How to change a users name (r->connection->user) in a module

How to change a users name (r->connection->user) in a module

Post by Sridhar Muppid » Sun, 31 Mar 2002 07:45:06



Hi,

Am using on the only the "check_access" handler and would like to
change/set the r->connection->user value. I've tried setting it as
follows but does not seem to work.
    char *username = "TestUser";
    r->connection->user = username;

I'am  testing the setting by calling the snoop servlet on tomcat and
checking the Remote User value.

All of the example modules I've seen (including mod_digest, etc) do this
in the "check_auth" handler. So, wondering if one can change the user
name in "check_access" handler. If so, am I missing something?

Help help would be appreciated

Regards,
-Sridhar

 
 
 

How to change a users name (r->connection->user) in a module

Post by Sridhar Muppid » Mon, 01 Apr 2002 01:40:49


I have changed the handler to "check_user" but still can't seem to set the
"user" value. Here's the code segment ...

r->connection->user=ap_pstrdup(r->connection->pool,username);
r->connection->ap_auth_type="distauth";

I can see the auth_type but not the user in the snoop output.

Thanks for any pointers to resolve this problem.

Regards,
-Sridhar


> Hi,

> Am using on the only the "check_access" handler and would like to
> change/set the r->connection->user value. I've tried setting it as
> follows but does not seem to work.
>     char *username = "TestUser";
>     r->connection->user = username;

> I'am  testing the setting by calling the snoop servlet on tomcat and
> checking the Remote User value.

> All of the example modules I've seen (including mod_digest, etc) do this
> in the "check_auth" handler. So, wondering if one can change the user
> name in "check_access" handler. If so, am I missing something?

> Help help would be appreciated

> Regards,
> -Sridhar



 
 
 

1. Problem setting r->connection->user with new cookie auth module

Hi,

I'm working on an Apache module for authentication using cookies. This
far I have managed to read a cookie and look up a username in a table.
However, setting the r->connection->user to this value doesn't affect
anything. While trying to access a protected directory I get a message
"Document contains no data" and in the log file I see the value of
remote_user is "-". Would anyone familiar with writing authentication
modules like to take a look? Is there some good documentation out there
about the Apache C-API and how it all works?

I've set up a page for my new module at

http://linus.radioaf.com/mysql_cookie_auth_module.html

Best Regards
/Hans

2. ndd ?

3. scoadmin -> Account Manager -> Users -> Add New Users breaks /etc/password symlink

4. Improving Fonts In The Linux Desktop, What I learned

5. Qube3 user administration - length of user name > 12

6. Program slows startup of Linux

7. user id -> user name?

8. Mach32 (XFree 2.0) problem

9. fixing localhost -> DNS Server -> NAMED -> NDC -> NOTFOUND

10. <><><> MOUNTING EXTENDED PARTITION <><><>

11. rsh <hostname> -n -l <user> <command> hangs on Solaris 8

12. Wanted: <><><> Unix Specialist <><><>

13. LILO help <><><><><><>