Changeset 7351


Ignore:
Timestamp:
Aug 12, 2011, 1:21:06 AM (8 years ago)
Author:
jow
Message:

libs/nixio: allow building without shadow password support

Location:
luci/trunk/libs/nixio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/nixio/Makefile

    r5954 r7351  
    1111AXTLS_FILE    = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz
    1212NIXIO_TLS    ?= openssl
     13NIXIO_SHADOW ?= $(shell echo 'int main(void){ return !getspnam("root"); }' | $(CC) -include shadow.h -xc -o/dev/null - 2>/dev/null && echo yes)
    1314NIXIO_SO      = nixio.so
    1415NIXIO_LDFLAGS =
     
    4445ifeq ($(NIXIO_TLS),)
    4546    NIXIO_CFLAGS += -DNO_TLS
     47endif
     48
     49ifneq ($(NIXIO_SHADOW),yes)
     50    NIXIO_CFLAGS += -DNO_SHADOW
    4651endif
    4752
  • luci/trunk/libs/nixio/src/user.c

    r5414 r7351  
    2929
    3030#ifndef BSD
     31#ifndef NO_SHADOW
    3132#include <shadow.h>
     33#endif
    3234#include <crypt.h>
    3335#endif
     
    163165
    164166#ifndef BSD
     167#ifndef NO_SHADOW
    165168static int nixio__push_spwd(lua_State *L, struct spwd *sp) {
    166169    lua_createtable(L, 0, 9);
     
    217220    }
    218221}
     222#endif /* !NO_SHADOW */
    219223#endif /* !BSD */
    220224
     
    240244    {"getpw",       nixio_getpw},
    241245#ifndef BSD
     246#ifndef NO_SHADOW
    242247    {"getsp",       nixio_getsp},
     248#endif
    243249#endif
    244250    {NULL,          NULL}
Note: See TracChangeset for help on using the changeset viewer.