On Fri, 5 Mar 2004, Corinna Vinschen wrote:

> On Mar  4 19:49, Igor Pechtchanski wrote:
>
> > > I think this relates to the fact that only services logging in with
> > > the local system account can be configured to interact with the
> > > desktop...so it appears that the --user and --interactive flags are
> > > exclusive.
> >
> > Whoops, you're quite right (confirmed on MSDN).  We should actually catch
> > that in cygrunsrv and print out an appropriate error message.  Corinna,
> > should I prepare a patch, or do I need a copyright assignment for
> > cygrunsrv?
>
> Nope, it's copyrighted by me, not by Red Hat.  Go ahead :-)
> Corinna

On Thu, 4 Mar 2004, Igor Pechtchanski wrote:

> P.S. Corinna, there's a bunch of typos in the cygrunsrv messages as well
> ("neverexists" instead of "neverexits").

On Sat, 13 Mar 2004, Corinna Vinschen wrote:

> On Mar 12 20:53, tony_silva<at>alum<dot>mit<dot>edu wrote:
>
> > The option "--neverexits" is mispelled as "--neverexists" in the help
> > function:
>
> Thanks for the hint.  Fixed for the next version.
> Corinna

Corinna,

Patch attached (fixes the --interactive with --user issue, and some
leftover message typos).  ChangeLog is below.  Ok to commit?
        Igor
==============================================================================
ChangeLog:
2004-03-17  Igor Pechtchanski  <[EMAIL PROTECTED]>

        * cygrunsrv.cc (service_main): Fix typo in comment.
        (main): Check that "--user" is not specified with
        "--interactive" (thanks to Peter Wisnovsky).
        * utils.h (reason_t): Add NoInteractiveWithUser value.
        * utils.cc (reason_list): Add description string for the
        NoInteractiveWithUser value.  Fix typos in descriptions
        for the NeverExitsNotAllowed and OnlyOneNeverExits values.
        * cygrunsrv.README: Add comment about the "--interactive"
        option only being valid with a SYSTEM service.

-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_                [EMAIL PROTECTED]
ZZZzz /,`.-'`'    -.  ;-;;,_            [EMAIL PROTECTED]
     |,4-  ) )-,_. ,\ (  `'-'           Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL     a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton
Index: cygrunsrv.README
===================================================================
RCS file: /cvs/cygwin-apps/cygrunsrv/cygrunsrv.README,v
retrieving revision 1.8
diff -u -p -r1.8 cygrunsrv.README
--- cygrunsrv.README    3 Feb 2004 14:32:37 -0000       1.8
+++ cygrunsrv.README    17 Mar 2004 22:56:21 -0000
@@ -259,6 +259,7 @@ system shutdown.
   Optional flag that allows cygrunsrv to interact with the desktop.
 When in effect, cygrunsrv can open windows and pop up message boxes.
 Equivalent to the "Allow service to interact with desktop" box.
+Cannot be used unless the service runs as SYSTEM.
 
 **********************************************
 General Notes:
Index: cygrunsrv.cc
===================================================================
RCS file: /cvs/cygwin-apps/cygrunsrv/cygrunsrv.cc,v
retrieving revision 1.21
diff -u -p -r1.21 cygrunsrv.cc
--- cygrunsrv.cc        17 Mar 2004 17:01:26 -0000      1.21
+++ cygrunsrv.cc        17 Mar 2004 22:56:21 -0000
@@ -1263,7 +1263,7 @@ service_main (DWORD argc, LPSTR *argv)
       else if (WIFEXITED (status))
         {
          /* Although we're not going to set the service status to stopped,
-            only allow zero exit status if neverexists is not set. */
+            only allow zero exit status if neverexits is not set. */
          if (!neverexits)
            exitval = WEXITSTATUS (status);
          syslog_starterr ("execv", 0, WEXITSTATUS (status));
@@ -1413,6 +1413,8 @@ main (int argc, char **argv)
          return error (InteractiveNotAllowed);
        if (in_interactive)
          return error (OnlyOneInteractive);
+       if (in_user)
+         return error (NoInteractiveWithUser);
        in_interactive = 1;
        break;
       case 's':
@@ -1445,6 +1447,8 @@ main (int argc, char **argv)
          return error (UserNotAllowed);
        if (in_user)
          return error (OnlyOneUser);
+       if (in_interactive)
+         return error (NoInteractiveWithUser);
        in_user = optarg;
        break;
       case 'w':
Index: utils.cc
===================================================================
RCS file: /cvs/cygwin-apps/cygrunsrv/utils.cc,v
retrieving revision 1.13
diff -u -p -r1.13 utils.cc
--- utils.cc    13 Mar 2004 09:28:54 -0000      1.13
+++ utils.cc    17 Mar 2004 22:56:21 -0000
@@ -59,12 +59,13 @@ char *reason_list[] = {
   "--dep is only allowed with --install",
   "--std{in,out,err} are only allowed with --install",
   "Each of --std{in,out,err} is allowed only once",
-  "--neverexists is only allowed with --install",
-  "Only one --neverexists is allowed",
+  "--neverexits is only allowed with --install",
+  "Only one --neverexits is allowed",
   "--shutdown is only allowed with --install",
   "Only one --shutdown is allowed",
   "--interactive is only allowed with --install",
   "Only one --interactive is allowed",
+  "--interactive not allowed with --user",
   "Trailing commandline arguments not allowed",
   "You must specify one of the `-IRSE' options",
   "Error installing a service",
Index: utils.h
===================================================================
RCS file: /cvs/cygwin-apps/cygrunsrv/utils.h,v
retrieving revision 1.10
diff -u -p -r1.10 utils.h
--- utils.h     3 Feb 2004 14:32:37 -0000       1.10
+++ utils.h     17 Mar 2004 22:56:21 -0000
@@ -56,6 +56,7 @@ enum reason_t {
   OnlyOneShutdown,
   InteractiveNotAllowed,
   OnlyOneInteractive,
+  NoInteractiveWithUser,
   TrailingArgs,
   StartAsSvcErr,
   InstallErr,
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to