[1865] in Moira Commits

home help back first fref pref prev next nref lref last post

/svn/moira r4009 - trunk/moira/clients/chsh

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Tue Jun 22 01:50:54 2010

Date: Tue, 22 Jun 2010 01:50:47 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201006220550.o5M5olQn000436@drugstore.mit.edu>
To: moira-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2010-06-22 01:50:47 -0400 (Tue, 22 Jun 2010)
New Revision: 4009

Added:
   trunk/moira/clients/chsh/shells.moira
Modified:
   trunk/moira/clients/chsh/Makefile.in
   trunk/moira/clients/chsh/chsh.c
Log:
Install our owns shells file and check it in preference to /etc/shells.

Modified: trunk/moira/clients/chsh/Makefile.in
===================================================================
--- trunk/moira/clients/chsh/Makefile.in	2010-06-01 22:27:06 UTC (rev 4008)
+++ trunk/moira/clients/chsh/Makefile.in	2010-06-22 05:50:47 UTC (rev 4009)
@@ -4,7 +4,7 @@
 @SET_MAKE@
 
 CC=@CC@
-CPPFLAGS=@CPPFLAGS@
+CPPFLAGS=@CPPFLAGS@ -DSHELLS_LIST=\"$(sysconfdir)/shells.moira\"
 CFLAGS=@CFLAGS@
 DEFS=@DEFS@
 ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
@@ -23,6 +23,7 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
+sysconfdir=@sysconfdir@
 
 TARGET=chsh
 
@@ -45,6 +46,7 @@
 
 install: all
 	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir)
+	$(INSTALL) shells.moira $(DESTDIR)$(sysconfdir)
 
 $(TARGET): $(OBJS) ../lib/libmrclient.la $(MR_LIBDEP)
 	$(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $@.o $(LIBS)

Modified: trunk/moira/clients/chsh/chsh.c
===================================================================
--- trunk/moira/clients/chsh/chsh.c	2010-06-01 22:27:06 UTC (rev 4008)
+++ trunk/moira/clients/chsh/chsh.c	2010-06-22 05:50:47 UTC (rev 4009)
@@ -343,7 +343,9 @@
 
   if (!shells)
     {
-      shells = fopen("/etc/shells", "r");
+      shells = fopen(SHELLS_LIST, "r");
+      if (!shells && errno == ENOENT)
+	shells = fopen("/etc/shells", "r");
       if (!shells)
 	{
 	  fprintf(stderr, "%s: Can't open /etc/shells. Unable to determine if "


home help back first fref pref prev next nref lref last post