summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-12-12 16:49:33 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-12-12 17:03:10 -0800
commit99998196017ef38ec88459b50605aa20f628788b (patch)
treeae5f58661dbdf6b3898a18c48fe6d9d1f902d04c /os
parent01834e99e461e2a8354f3b4aef7f14c5e83fa255 (diff)
Constify string for authorization protocol names
gcc was warning from storing string constants in a char *name field: auth.c:64:1: warning: initialization discards qualifiers from pointer target type auth.c:72:1: warning: initialization discards qualifiers from pointer target type auth.c:81:1: warning: initialization discards qualifiers from pointer target type Making the field const requires changing AuthorizationFromID to take a const char ** pointer for the name argument which it sets to point to the matching name entry. Changing that argument requires changing its sole caller in the security extension to pass the address of a const char * variable to it, which it can do, since the only thing it does with the returned name is to pass it back to the RemoveAuthorization function that already expects a const char *name. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'os')
-rw-r--r--os/auth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/auth.c b/os/auth.c
index 768575139..9d36249f2 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -48,7 +48,7 @@ from The Open Group.
struct protocol {
unsigned short name_length;
- char *name;
+ const char *name;
AuthAddCFunc Add; /* new authorization data */
AuthCheckFunc Check; /* verify client authorization data */
AuthRstCFunc Reset; /* delete all authorization data entries */
@@ -236,7 +236,7 @@ int
AuthorizationFromID (
XID id,
unsigned short *name_lenp,
- char **namep,
+ const char **namep,
unsigned short *data_lenp,
char **datap)
{