dnl Disable it by "configure --disable-silent-rules" or "make V=1"
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-CFLAGS="${CFLAGS} -Wall -Wformat=2 -Wmissing-prototypes"
+CFLAGS="${CFLAGS} -std=c99 -Wall -Wextra -Wformat=2 -Wmissing-prototypes -Wno-unused-parameter"
CXXFLAGS="${CXXFLAGS} -std=c++0x -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter"
fillupdir=/var/adm/fillup-templates
AC_DEFINE(ENABLE_XATTRS, 1, [Enable extended attributes support])
fi
+AC_ARG_ENABLE([pam], AC_HELP_STRING([--disable-pam],[Disable pam plugin support]),
+ [with_pam=$enableval],[with_pam=yes])
+AM_CONDITIONAL(HAVE_PAM, [test "$with_pam" != "no"])
+
PKG_CHECK_MODULES(DBUS, dbus-1)
AC_SUBST(VERSION)
# Makefile.am for snapper/doc
#
-man_MANS = snapper.8 snapperd.8 pam_snapper.8
+man_MANS = snapper.8 snapperd.8
+
+if HAVE_PAM
+man_MANS += pam_snapper.8
+endif
TXTS = dbus-protocol.txt
* To contact Novell about this file by physical or electronic mail, you may
* find current contact information at www.novell.com.
*/
+
+
#include <dbus/dbus.h>
#include <stdbool.h>
#include <stdint.h>
static void dict_array_print(uint32_t num_dicts,
struct dict *dicts)
{
- int i;
+ uint32_t i;
for (i = 0; i < num_dicts; i++) {
printf("dict (\n"
# Makefile.am for snapper/pam
#
+if HAVE_PAM
+
AM_CFLAGS = -D_GNU_SOURCE
INCLUDES = -I$(top_srcdir) $(DBUS_CFLAGS)
pam_snapper_la_LDFLAGS = -no-undefined -avoid-version -module
pam_snapper_la_LIBADD = -lpam $(DBUS_LIBS)
+endif
+
DBusMessageIter array_iter;
DBusMessageIter struct_iter;
const char *desc = MODULE_NAME;
- uint32_t i;
uint32_t *snap_id = NULL;
bool ret;
const char *modestrings[3] = { "CreateSingleSnapshot", "CreatePreSnapshot", "CreatePostSnapshot" };
pam_syslog( pamh, LOG_ERR, "failed to open array container" );
return -ENOMEM;
}
- for ( i = 0; i < num_user_data; i++ ) {
+ for ( uint32_t i = 0; i < num_user_data; ++i ) {
ret = dbus_message_iter_open_container( &array_iter, DBUS_TYPE_DICT_ENTRY, NULL, &struct_iter );
if ( !ret ) {
pam_syslog( pamh, LOG_ERR, "failed to open struct container" );
{
int fields[4] = { PAM_RUSER, PAM_RHOST, PAM_TTY, PAM_SERVICE };
const char *names[4] = { "ruser", "rhost", "tty", "service" };
- int i;
- for ( i = 0; i < 4; ++i ) {
+ for ( int i = 0; i < 4; ++i ) {
const char *readval = NULL;
int ret = pam_get_item( pamh, fields[i], ( const void ** )&readval );
if ( ret == PAM_SUCCESS && readval ) {
const char *e;
while ( ( e = strchr( s, ',' ) ) ) {
- if ( e - s == l && strncmp( s, needle, l ) == 0 )
+ if ( e == s + l && strncmp( s, needle, l ) == 0 )
return 1;
s = e + 1;
# Makefile.am for snapper/scripts
#
+if HAVE_PAM
+
pam_snapperdir = /usr/lib/pam_snapper
pam_snapper_SCRIPTS = \
pam_snapper_useradd.sh \
pam_snapper_userdel.sh
+endif
+
EXTRA_DIST = snapper-hourly snapper-daily zypp-plugin.py $(pam_snapper_SCRIPTS)
install-data-local:
if HAVE_XATTRS
TMP_XA = XAttributes.cc XAttributes.h
-endif HAVE_XATTRS
+endif
libsnapper_la_SOURCES = \
Factory.cc Factory.h \
$(TMP_XA)
-
if ENABLE_BTRFS
libsnapper_la_SOURCES += \
Btrfs.cc Btrfs.h