Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
94
Issues
94
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
0392b4a3
Commit
0392b4a3
authored
Sep 14, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Added lookup function for auth_alter_t
parent
4d7a60d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
src/auth.c
src/auth.c
+24
-0
src/auth.h
src/auth.h
+1
-0
No files found.
src/auth.c
View file @
0392b4a3
...
...
@@ -814,6 +814,30 @@ int auth_alter_client(auth_t *auth, auth_client *auth_user, auth_alter_t action,
return
0
;
}
auth_alter_t
auth_str2alter
(
const
char
*
str
)
{
if
(
!
str
)
return
AUTH_ALTER_NOOP
;
if
(
strcasecmp
(
str
,
"noop"
)
==
0
)
{
return
AUTH_ALTER_NOOP
;
}
else
if
(
strcasecmp
(
str
,
"rewrite"
)
==
0
)
{
return
AUTH_ALTER_REWRITE
;
}
else
if
(
strcasecmp
(
str
,
"redirect"
)
==
0
)
{
return
AUTH_ALTER_REDIRECT
;
}
else
if
(
strcasecmp
(
str
,
"redirect_see_other"
)
==
0
)
{
return
AUTH_ALTER_REDIRECT_SEE_OTHER
;
}
else
if
(
strcasecmp
(
str
,
"redirect_temporary"
)
==
0
)
{
return
AUTH_ALTER_REDIRECT_TEMPORARY
;
}
else
if
(
strcasecmp
(
str
,
"redirect_permanent"
)
==
0
)
{
return
AUTH_ALTER_REDIRECT_PERMANENT
;
}
else
if
(
strcasecmp
(
str
,
"send_error"
)
==
0
)
{
return
AUTH_ALTER_SEND_ERROR
;
}
else
{
return
AUTH_ALTER_NOOP
;
}
}
/* these are called at server start and termination */
void
auth_initialise
(
void
)
...
...
src/auth.h
View file @
0392b4a3
...
...
@@ -174,6 +174,7 @@ void auth_stack_add_client(auth_stack_t *stack,
void
*
userdata
);
int
auth_alter_client
(
auth_t
*
auth
,
auth_client
*
auth_user
,
auth_alter_t
action
,
const
char
*
arg
);
auth_alter_t
auth_str2alter
(
const
char
*
str
);
void
auth_stack_release
(
auth_stack_t
*
stack
);
void
auth_stack_addref
(
auth_stack_t
*
stack
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment