Changeset 401 in openpam for trunk/include


Ignore:
Timestamp:
Nov 28, 2007, 12:25:53 PM (12 years ago)
Author:
Dag-Erling Smørgrav
Message:

Style cleanup; correct some namespace violations (breaking source
compatibility in the process, but only for OpenPAM-specific features)

Location:
trunk/include/security
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/security/openpam.h

    r400 r401  
    3535 */
    3636
    37 #ifndef _SECURITY_OPENPAM_H_INCLUDED
    38 #define _SECURITY_OPENPAM_H_INCLUDED
     37#ifndef SECURITY_OPENPAM_H_INCLUDED
     38#define SECURITY_OPENPAM_H_INCLUDED
    3939
    4040/*
     
    237237    int argc, const char *argv[])                                       \
    238238{                                                                       \
     239                                                                        \
     240        (void)pamh;                                                     \
     241        (void)flags;                                                    \
     242        (void)argc;                                                     \
     243        (void)argv;                                                     \
    239244        return (PAM_IGNORE);                                            \
    240245}
     
    264269#if defined(PAM_SM_AUTH) || defined(PAM_SM_ACCOUNT) || \
    265270        defined(PAM_SM_SESSION) || defined(PAM_SM_PASSWORD)
    266 #define LINUX_PAM_MODULE
    267 #endif
     271# define LINUX_PAM_MODULE
     272#endif
     273
    268274#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_AUTH)
    269 #define _PAM_SM_AUTHENTICATE    0
    270 #define _PAM_SM_SETCRED         0
    271 #else
    272 #undef PAM_SM_AUTH
    273 #define PAM_SM_AUTH
    274 #define _PAM_SM_AUTHENTICATE    pam_sm_authenticate
    275 #define _PAM_SM_SETCRED         pam_sm_setcred
    276 #endif
     275# define _PAM_SM_AUTHENTICATE   0
     276# define _PAM_SM_SETCRED        0
     277#else
     278# undef PAM_SM_AUTH
     279# define PAM_SM_AUTH
     280# define _PAM_SM_AUTHENTICATE   pam_sm_authenticate
     281# define _PAM_SM_SETCRED        pam_sm_setcred
     282#endif
     283
    277284#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_ACCOUNT)
    278 #define _PAM_SM_ACCT_MGMT       0
    279 #else
    280 #undef PAM_SM_ACCOUNT
    281 #define PAM_SM_ACCOUNT
    282 #define _PAM_SM_ACCT_MGMT       pam_sm_acct_mgmt
    283 #endif
     285# define _PAM_SM_ACCT_MGMT      0
     286#else
     287# undef PAM_SM_ACCOUNT
     288# define PAM_SM_ACCOUNT
     289# define _PAM_SM_ACCT_MGMT      pam_sm_acct_mgmt
     290#endif
     291
    284292#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_SESSION)
    285 #define _PAM_SM_OPEN_SESSION    0
    286 #define _PAM_SM_CLOSE_SESSION   0
    287 #else
    288 #undef PAM_SM_SESSION
    289 #define PAM_SM_SESSION
    290 #define _PAM_SM_OPEN_SESSION    pam_sm_open_session
    291 #define _PAM_SM_CLOSE_SESSION   pam_sm_close_session
    292 #endif
     293# define _PAM_SM_OPEN_SESSION   0
     294# define _PAM_SM_CLOSE_SESSION  0
     295#else
     296# undef PAM_SM_SESSION
     297# define PAM_SM_SESSION
     298# define _PAM_SM_OPEN_SESSION   pam_sm_open_session
     299# define _PAM_SM_CLOSE_SESSION  pam_sm_close_session
     300#endif
     301
    293302#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_PASSWORD)
    294 #define _PAM_SM_CHAUTHTOK       0
    295 #else
    296 #undef PAM_SM_PASSWORD
    297 #define PAM_SM_PASSWORD
    298 #define _PAM_SM_CHAUTHTOK       pam_sm_chauthtok
     303# define _PAM_SM_CHAUTHTOK      0
     304#else
     305# undef PAM_SM_PASSWORD
     306# define PAM_SM_PASSWORD
     307# define _PAM_SM_CHAUTHTOK      pam_sm_chauthtok
    299308#endif
    300309
     
    304313 */
    305314#if defined(__FreeBSD__)
    306 #define PAM_SOEXT ".so"
    307 #else
    308 #ifndef NO_STATIC_MODULES
    309 #define NO_STATIC_MODULES
    310 #endif
    311 #endif
     315# define PAM_SOEXT ".so"
     316#else
     317# undef NO_STATIC_MODULES
     318# define NO_STATIC_MODULES
     319#endif
     320
    312321#if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES)
    313322/* gcc, static linking */
    314 #include <sys/cdefs.h>
    315 #include <linker_set.h>
    316 #define OPENPAM_STATIC_MODULES
    317 #define PAM_EXTERN static
    318 #define PAM_MODULE_ENTRY(name)                                          \
    319 static char _pam_name[] = name PAM_SOEXT;                               \
    320 static struct pam_module _pam_module = { _pam_name, {                   \
    321     _PAM_SM_AUTHENTICATE, _PAM_SM_SETCRED, _PAM_SM_ACCT_MGMT,           \
    322     _PAM_SM_OPEN_SESSION, _PAM_SM_CLOSE_SESSION, _PAM_SM_CHAUTHTOK },   \
    323     NULL, 0, NULL, NULL };                                              \
    324 DATA_SET(_openpam_static_modules, _pam_module)
     323# include <sys/cdefs.h>
     324# include <linker_set.h>
     325# define OPENPAM_STATIC_MODULES
     326# define PAM_EXTERN static
     327# define PAM_MODULE_ENTRY(name)                                         \
     328        static char _pam_name[] = name PAM_SOEXT;                       \
     329        static struct pam_module _pam_module = {                        \
     330                .path = _pam_name,                                      \
     331                .func = {                                               \
     332                        [PAM_SM_AUTHENTICATE] = _PAM_SM_AUTHENTICATE,   \
     333                        [PAM_SM_SETCRED] = _PAM_SM_SETCRED,             \
     334                        [PAM_SM_ACCT_MGMT] = _PAM_SM_ACCT_MGMT,         \
     335                        [PAM_SM_OPEN_SESSION] = _PAM_SM_OPEN_SESSION,   \
     336                        [PAM_SM_CLOSE_SESSION] = _PAM_SM_CLOSE_SESSION, \
     337                        [PAM_SM_CHAUTHTOK] = _PAM_SM_CHAUTHTOK          \
     338                },                                                      \
     339        };                                                              \
     340        DATA_SET(_openpam_static_modules, _pam_module)
    325341#else
    326342/* normal case */
    327 #define PAM_EXTERN
    328 #define PAM_MODULE_ENTRY(name)
     343# define PAM_EXTERN
     344# define PAM_MODULE_ENTRY(name)
    329345#endif
    330346
     
    333349#endif
    334350
    335 #endif
     351#endif /* !SECURITY_OPENPAM_H_INCLUDED */
  • trunk/include/security/openpam_version.h

    r320 r401  
    3535 */
    3636
    37 #ifndef _OPENPAM_VERSION_H_INCLUDED
    38 #define _OPENPAM_VERSION_H_INCLUDED
     37#ifndef SECURITY_OPENPAM_VERSION_H_INCLUDED
     38#define SECURITY_OPENPAM_VERSION_H_INCLUDED
    3939
    40 #define _OPENPAM
    41 #define _OPENPAM_VERSION        20050616
    42 #define _OPENPAM_RELEASE        "Figwort"
     40#define OPENPAM
     41#define OPENPAM_VERSION 20071218
     42#define OPENPAM_RELEASE "Hydrangea"
    4343
    44 #endif
     44#endif /* !SECURITY_OPENPAM_VERSION_H_INCLUDED */
  • trunk/include/security/pam_appl.h

    r400 r401  
    3535 */
    3636
    37 #ifndef _PAM_APPL_H_INCLUDED
    38 #define _PAM_APPL_H_INCLUDED
     37#ifndef SECURITY_PAM_APPL_H_INCLUDED
     38#define SECURITY_PAM_APPL_H_INCLUDED
    3939
    4040#include <security/pam_types.h>
     
    195195#endif
    196196
    197 #endif
     197#endif /* !SECURITY_PAM_APPL_H_INCLUDED */
  • trunk/include/security/pam_attributes.h

    • Property svn:keywords set to Id
    r318 r401  
    1 #ifndef _PAM_ATTRIBUTES_H_INCLUDED
    2 #define _PAM_ATTRIBUTES_H_INCLUDED
     1/*
     2 * $Id$
     3 */
     4
     5#ifndef SECURITY_PAM_ATTRIBUTES_H_INCLUDED
     6#define SECURITY_PAM_ATTRIBUTES_H_INCLUDED
    37
    48/* GCC attributes */
     
    2226#endif
    2327
    24 #endif /* _PAM_ATTRIBUTES_H_INCLUDED */
     28#endif /* !SECURITY_PAM_ATTRIBUTES_H_INCLUDED */
  • trunk/include/security/pam_constants.h

    r320 r401  
    3535 */
    3636
    37 #ifndef _PAM_CONSTANTS_H_INCLUDED
    38 #define _PAM_CONSTANTS_H_INCLUDED
     37#ifndef SECURITY_PAM_CONSTANTS_H_INCLUDED
     38#define SECURITY_PAM_CONSTANTS_H_INCLUDED
    3939
    4040#include <security/openpam_version.h>
     
    133133#endif
    134134
    135 #endif
     135#endif /* !SECURITY_PAM_CONSTANTS_H_INCLUDED */
  • trunk/include/security/pam_modules.h

    r320 r401  
    3535 */
    3636
    37 #ifndef _PAM_MODULES_H_INCLUDED
    38 #define _PAM_MODULES_H_INCLUDED
     37#ifndef SECURITY_PAM_MODULES_H_INCLUDED
     38#define SECURITY_PAM_MODULES_H_INCLUDED
    3939
    4040#include <security/pam_types.h>
     
    158158#endif
    159159
    160 #endif
     160#endif /* !SECURITY_PAM_MODULES_H_INCLUDED */
  • trunk/include/security/pam_types.h

    r320 r401  
    3535 */
    3636
    37 #ifndef _PAM_TYPES_H_INCLUDED
    38 #define _PAM_TYPES_H_INCLUDED
     37#ifndef SECURITY_PAM_TYPES_H_INCLUDED
     38#define SECURITY_PAM_TYPES_H_INCLUDED
    3939
    4040#include <stddef.h>
     
    7878        char    *type;
    7979        void    *scope;
    80         size_t  scope_len;
     80        size_t   scope_len;
    8181} pam_repository_t;
    8282
     
    8585#endif
    8686
    87 #endif
     87#endif /* !SECURITY_PAM_TYPES_H_INCLUDED */
Note: See TracChangeset for help on using the changeset viewer.