diff options
author | Tobias Stoeckmann <tobias@stoeckmann.org> | 2024-01-01 22:40:52 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-01-02 18:24:08 +0000 |
commit | af8fc2367a1997cf8d2aea95e0e556e8e0e92b04 (patch) | |
tree | b830fdf6545412e949806f1a1d65398267bf9152 /modules/pam_listfile | |
parent | 47420d19940302f00c940da47d8f60a9e45af03e (diff) | |
download | pam-af8fc2367a1997cf8d2aea95e0e556e8e0e92b04.tar.gz pam-af8fc2367a1997cf8d2aea95e0e556e8e0e92b04.tar.bz2 pam-af8fc2367a1997cf8d2aea95e0e556e8e0e92b04.zip |
pam_listfile: fix formatting
The formatting made the code look like there is an "else"-block
followed by an "else if"-block.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'modules/pam_listfile')
-rw-r--r-- | modules/pam_listfile/pam_listfile.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/modules/pam_listfile/pam_listfile.c b/modules/pam_listfile/pam_listfile.c index 3e6a7092..f612cddd 100644 --- a/modules/pam_listfile/pam_listfile.c +++ b/modules/pam_listfile/pam_listfile.c @@ -109,7 +109,7 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, ifname = strdup(myval); if (!ifname) return PAM_BUF_ERR; - } else if(!strcmp(mybuf,"item")) + } else if(!strcmp(mybuf,"item")) { if(!strcmp(myval,"user")) citem = PAM_USER; else if(!strcmp(myval,"tty")) @@ -127,20 +127,21 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, extitem = EI_SHELL; else citem = 0; - } else if(!strcmp(mybuf,"apply")) { - apply_type=APPLY_TYPE_NONE; - if (myval[0]=='@') { - apply_type=APPLY_TYPE_GROUP; - memcpy(apply_val,myval+1,sizeof(myval)-1); - } else { - apply_type=APPLY_TYPE_USER; - memcpy(apply_val,myval,sizeof(myval)); - } + } + } else if(!strcmp(mybuf,"apply")) { + apply_type=APPLY_TYPE_NONE; + if (myval[0]=='@') { + apply_type=APPLY_TYPE_GROUP; + memcpy(apply_val,myval+1,sizeof(myval)-1); } else { - free(ifname); - pam_syslog(pamh,LOG_ERR, "Unknown option: %s",mybuf); - return onerr; + apply_type=APPLY_TYPE_USER; + memcpy(apply_val,myval,sizeof(myval)); } + } else { + free(ifname); + pam_syslog(pamh,LOG_ERR, "Unknown option: %s",mybuf); + return onerr; + } } if(!citem) { |