From patchwork Sat Aug 20 03:27:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 1082262 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7K3LdTq023075 for ; Sat, 20 Aug 2011 03:22:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754635Ab1HTDWM (ORCPT ); Fri, 19 Aug 2011 23:22:12 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:64769 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753952Ab1HTDWL (ORCPT ); Fri, 19 Aug 2011 23:22:11 -0400 Received: by mail-gw0-f46.google.com with SMTP id a12so2047562gwa.19 for ; Fri, 19 Aug 2011 20:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=i2cTpG+hy7MiqsFLsCC0fQBnxgtzbhpv5eOX+HbAdno=; b=Z0wzgpABwTkH5Q3SZkCi7+fBkVpdeRIBhGCLNd+p5aPcWoruBnOfond5gQoJbHzmwH deUKWaDasWM35JvO+ykqXsIP3jVxppPVMh8H8U0yXXvul2Hp46ekDWsFwXROF5Jsxqnl vXSTmmaTvyLYfvgge0mxfHikpLEOhQkp0YpTo= Received: by 10.150.183.21 with SMTP id g21mr90505ybf.411.1313810530169; Fri, 19 Aug 2011 20:22:10 -0700 (PDT) Received: from localhost ([32.97.110.58]) by mx.google.com with ESMTPS id k17sm728887yba.14.2011.08.19.20.22.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Aug 2011 20:22:09 -0700 (PDT) From: shirishpargaonkar@gmail.com To: jlayton@samba.org Cc: linux-cifs@vger.kernel.org, Shirish Pargaonkar Subject: [PATCH 4/5] cifs-utils: cifsacl utilities: Add configure and make directives Date: Fri, 19 Aug 2011 22:27:47 -0500 Message-Id: <1313810867-2340-1-git-send-email-shirishpargaonkar@gmail.com> X-Mailer: git-send-email 1.6.0.2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 20 Aug 2011 03:22:12 +0000 (UTC) From: Shirish Pargaonkar autoconf and automake directives to build utilities getcifsacl and setcifsacl. Signed-off-by: Shirish Pargaonkar --- Makefile.am | 24 +++++++++++++++++++++++- configure.ac | 25 ++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4938447..7d4bdea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ mount_cifs_LDADD = $(LIBCAP) $(CAPNG_LDADD) man_MANS = mount.cifs.8 sbin_PROGRAMS = -clean-local: clean-local-upcall clean-local-idmap +clean-local: clean-local-upcall clean-local-idmap clean-local-aclprogs if CONFIG_CIFSUPCALL sbin_PROGRAMS += cifs.upcall @@ -50,3 +50,25 @@ clean-local-idmap: if CONFIG_CIFSIDMAP rm -f cifs.idmap.8 cifs.idmap.8-t endif + +if CONFIG_CIFSACL +sbin_PROGRAMS += getcifsacl +getcifsacl_SOURCES = getcifsacl.c +getcifsacl_LDADD = -lkeyutils $(WINB_LDADD) +man_MANS += getcifsacl.8 + +sbin_PROGRAMS += setcifsacl +setcifsacl_SOURCES = setcifsacl.c +setcifsacl_LDADD = -lkeyutils $(WINB_LDADD) +man_MANS += setcifsacl.8 + +getcifsacl.8: getcifsacl.8.in + $(SED) 's,[@]sbindir@,$(sbindir),' $(srcdir)/$@.in > $@-t && mv $@-t $@ +setcifsacl.8: setcifsacl.8.in + $(SED) 's,[@]sbindir@,$(sbindir),' $(srcdir)/$@.in > $@-t && mv $@-t $@ +endif + +clean-local-aclprogs: +if CONFIG_CIFSACL + rm -f getcifsacl.8 getcifsacl.8-t setcifsacl.8 setcifsacl.8-t +endif diff --git a/configure.ac b/configure.ac index 780abe7..5b2bc6d 100644 --- a/configure.ac +++ b/configure.ac @@ -28,13 +28,19 @@ AC_ARG_ENABLE(cifsidmap, enable_cifsidmap=$enableval, enable_cifsidmap="maybe") +AC_ARG_ENABLE(cifsacl, + [AC_HELP_STRING([--enable-cifsacl], + [Create get/set cifsacl binary @<:@default=no@:>@])], + enable_cifsacl=$enableval, + enable_cifsacl="maybe") + # Checks for programs. AC_PROG_CC AC_PROG_SED AC_GNU_SOURCE # Checks for header files. -AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h inttypes.h limits.h mntent.h netdb.h stddef.h stdint.h stdbool.h stdlib.h stdio.h errno.h string.h strings.h sys/mount.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h], , [AC_MSG_ERROR([necessary header(s) not found])]) +AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h inttypes.h limits.h mntent.h netdb.h stddef.h stdint.h stdbool.h stdlib.h stdio.h errno.h string.h strings.h sys/mount.h sys/param.h sys/socket.h sys/time.h sys/xattr.h syslog.h unistd.h], , [AC_MSG_ERROR([necessary header(s) not found])]) if test $enable_cifsupcall != "no"; then AC_CHECK_HEADERS([krb5.h krb5/krb5.h]) @@ -94,6 +100,22 @@ if test $enable_cifsupcall != "no" -o $enable_cifsidmap != "no"; then fi ]) fi +if test $enable_cifsacl != "no"; then + AC_CHECK_HEADERS([wbclient.h], , [ + if test "$enable_cifsupcall" = "yes"; then + AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.]) + else + AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling get/setcifsacl.]) + enable_cifsacl="no" + fi + if test "$enable_cifsacl" = "yes"; then + AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.]) + else + AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling get/setcifsacl.]) + enable_cifsacl="no" + fi + ]) +fi if test $enable_cifsupcall != "no"; then AC_CHECK_LIB([krb5], [krb5_init_context], [ KRB5_LDADD='-lkrb5' ], @@ -156,6 +178,7 @@ LIBS=$cu_saved_libs AM_CONDITIONAL(CONFIG_CIFSUPCALL, [test "$enable_cifsupcall" != "no"]) AM_CONDITIONAL(CONFIG_CIFSCREDS, [test "$enable_cifscreds" = "yes"]) AM_CONDITIONAL(CONFIG_CIFSIDMAP, [test "$enable_cifsidmap" != "no"]) +AM_CONDITIONAL(CONFIG_CIFSACL, [test "$enable_cifsacl" != "no"]) LIBCAP_NG_PATH