~ubuntu-branches/ubuntu/trusty/uucp/trusty

« back to all changes in this revision

Viewing changes to xcmd.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Palfrader
  • Date: 2004-12-30 15:30:22 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041230153022-mx4cdr9j3u9bldo3
Tags: 1.07-12
Add cs localisation for debconf templates (closes: #287305).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* xcmd.c
2
2
   Routines to handle work requests.
3
3
 
4
 
   Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
 
4
   Copyright (C) 1991, 1992, 1993, 1995, 2002 Ian Lance Taylor
5
5
 
6
6
   This file is part of the Taylor UUCP package.
7
7
 
17
17
 
18
18
   You should have received a copy of the GNU General Public License
19
19
   along with this program; if not, write to the Free Software
20
 
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
20
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
21
21
 
22
 
   The author of the program may be contacted at ian@airs.com or
23
 
   c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
 
22
   The author of the program may be contacted at ian@airs.com.
24
23
   */
25
24
 
26
25
#include "uucp.h"
27
26
 
28
27
#if USE_RCS_ID
29
 
const char xcmd_rcsid[] = "$Id: xcmd.c,v 1.19 1995/06/21 20:20:42 ian Rel $";
 
28
const char xcmd_rcsid[] = "$Id: xcmd.c,v 1.24 2002/03/05 19:10:42 ian Rel $";
30
29
#endif
31
30
 
32
31
#include <errno.h>
70
69
     struct stransfer *qtrans;
71
70
     struct sdaemon *qdaemon;
72
71
{
 
72
  boolean fquote;
 
73
  const struct scmd *qcmd;
 
74
  struct scmd squoted;
73
75
  size_t clen;
74
76
  char *zsend;
75
77
  boolean fret;
77
79
  ulog (LOG_NORMAL, "Requesting work: %s to %s", qtrans->s.zfrom,
78
80
        qtrans->s.zto);
79
81
 
80
 
 
81
82
  qtrans->fcmd = TRUE;
82
83
  qtrans->precfn = flocal_xcmd_await_reply;
83
84
 
 
85
  fquote = fcmd_needs_quotes (&qtrans->s);
 
86
  if (! fquote)
 
87
    qcmd = &qtrans->s;
 
88
  else
 
89
    {
 
90
      if ((qdaemon->ifeatures & FEATURE_QUOTES) == 0)
 
91
        {
 
92
          ulog (LOG_ERROR,
 
93
                "%s: remote system does not support required quoting",
 
94
                qtrans->s.zfrom);
 
95
          (void) fmail_transfer (FALSE, qtrans->s.zuser, (const char *) NULL,
 
96
                                 "remote system does not support required quoting",
 
97
                                 qtrans->s.zfrom, qdaemon->qsys->uuconf_zname,
 
98
                                 qtrans->s.zto, (const char *) NULL,
 
99
                                 (const char *) NULL);
 
100
          (void) fsysdep_did_work (qtrans->s.pseq);
 
101
          utransfree (qtrans);
 
102
          return TRUE;
 
103
        }
 
104
 
 
105
      uquote_cmd (&qtrans->s, &squoted);
 
106
      qcmd = &squoted;
 
107
    }
 
108
 
84
109
  if (! fqueue_receive (qdaemon, qtrans))
85
110
    return FALSE;
86
111
 
87
112
  /* We send the string
88
113
     X from to user options
89
114
     We put a dash in front of options.  */
90
 
  clen = (strlen (qtrans->s.zfrom) + strlen (qtrans->s.zto)
91
 
          + strlen (qtrans->s.zuser) + strlen (qtrans->s.zoptions) + 7);
 
115
  clen = (strlen (qcmd->zfrom) + strlen (qcmd->zto)
 
116
          + strlen (qcmd->zuser) + strlen (qcmd->zoptions) + 7);
92
117
  zsend = zbufalc (clen);
93
 
  sprintf (zsend, "X %s %s %s -%s", qtrans->s.zfrom, qtrans->s.zto,
94
 
           qtrans->s.zuser, qtrans->s.zoptions);
 
118
  sprintf (zsend, "X %s %s %s -%s", qcmd->zfrom, qcmd->zto,
 
119
           qcmd->zuser, qcmd->zoptions);
95
120
 
96
121
  fret = (*qdaemon->qproto->pfsendcmd) (qdaemon, zsend, qtrans->ilocal,
97
122
                                        qtrans->iremote);
98
123
  ubuffree (zsend);
99
124
 
 
125
  if (fquote)
 
126
    ufree_quoted_cmd (&squoted);
 
127
 
100
128
  /* If fret is FALSE, we should free qtrans here, but see the comment
101
129
     at the end of flocal_rec_send_request.  */
102
130
 
111
139
     struct stransfer *qtrans;
112
140
     struct sdaemon *qdaemon;
113
141
     const char *zdata;
114
 
     size_t cdata;
 
142
     size_t cdata ATTRIBUTE_UNUSED;
115
143
{
116
144
  qtrans->precfn = NULL;
117
145
 
359
387
          ssend.ipos = 0;
360
388
 
361
389
          zjobid = zsysdep_spool_commands (qdestsys, BDEFAULT_UUCP_GRADE,
362
 
                                           1, &ssend);
 
390
                                           1, &ssend, (boolean *) NULL);
363
391
          if (zjobid == NULL)
364
392
            break;
365
393
          ubuffree (zjobid);