bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PAM authentication patch - v2


From: Derek Robert Price
Subject: Re: PAM authentication patch - v2
Date: Tue, 15 Apr 2003 11:11:54 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

Brian Murphy wrote:

Derek Robert Price wrote:

Hrm. Can we get $PROG (see src/sanity.sh) in here? This is the program prefix defined by configure + the string `cvs'. This is the actual name of the CVS executable since the user can set it at configure time. It shouldn't be hard to use AC_DEFINE_UNQUOTED to define PAM_SERVICENAME to the correct string once you figure which shell variable configure is storing the value in.

src/sanity.sh seems to get called with the name "cvs"

brm@brian:~/cvs/cvs/src$ grep sanity.sh Makefile
       sanity.sh
       $(SHELL) $(srcdir)/sanity.sh `pwd`/cvs
       $(SHELL) $(srcdir)/sanity.sh -r `pwd`/cvs

the prefix (name mangling) specified at configuration time is only carried out
when we install with this lovely bit of code:

install-binPROGRAMS: $(bin_PROGRAMS)
       @$(NORMAL_INSTALL)
       $(mkinstalldirs) $(DESTDIR)$(bindir)
       @list='$(bin_PROGRAMS)'; for p in $$list; do \
         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
         if test -f $$p \
         ; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \
         else :; fi; \
        done

I especially like the bit with sed. This means that at the moment there is no variable
which contains the name of the executable as it will be when installed.


That makes sense. install has to change the name of all installed programs and this avoids having configure rewrite all the program name definitions in the makefilse.

You should be able to duplicate the functionality with

   progname=`echo cvs |sed "$program_transform_name"`
   AC_DEFINE_UNQUOTED([PROGNAME],$progname)

in configure.in, as long as this comes after the invocation of AC_ARG_PROGRAM.

You might also use the global program_name variable defined in src/main.c, instead. Then, when a user used a soft link called "mycvs" or a script was run which used exec to call CVS, program_name would be what the user (perhaps the administrator) set it to. I'm not sure whether that's a good thing when dealing with PAM or not, though I suspect it might not be. From src/main.c:

#ifdef ARGV0_NOT_PROGRAM_NAME
    /* On some systems, e.g. VMS, argv[0] is not the name of the command
       which the user types to invoke the program.  */
    program_name = "cvs";
#else
    program_name = last_component (argv[0]);
#endif


Derek

--
               *8^)

Email: derek@ximbiot.com

Get CVS support at <http://ximbiot.com>!
--
I will not fake seizures.
I will not fake seizures.
I will not fake seizures...

         - Bart Simpson on chalkboard, _The Simpsons_







reply via email to

[Prev in Thread] Current Thread [Next in Thread]