Changeset 29 for trunk/src


Ignore:
Timestamp:
Apr 11, 2006, 1:48:18 PM (19 years ago)
Author:
rainer
Message:

Fixes for test suite, OpenBSD portability, self-resolving, and suidchk patch by Neil

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/make-tests.sh

    r19 r29  
    4949    CuSuiteDetails(suite, output);
    5050    if (suite->failCount > 0)
    51       fprintf(stderr, "%s\n", output->buffer);
     51      fprintf(stderr, "%s%c", output->buffer, 0x0A);
    5252    else
    53       fprintf(stdout, "%s\n", output->buffer);
     53      fprintf(stdout, "%s%c", output->buffer, 0x0A);
    5454    return suite->failCount;
    5555}
  • trunk/src/sh_extern.c

    r22 r29  
    115115  FILE * outf = NULL;
    116116  char * envp[1];
    117   char * argp[1];
     117  char * argp[2];
    118118
    119119  char * errfile;
     
    133133   *         needs a valid *envp[] with envp[0] = NULL;
    134134   *         and similarly for argp
     135   * OpenBSD finally needs non-null argp[0] ...
    135136   */
     137  argp[0] = task->command;
     138  argp[1] = NULL;
    136139  envp[0] = NULL;
    137   argp[0] = NULL;
    138140
    139141  /*
  • trunk/src/sh_suidchk.c

    r22 r29  
    525525              fs = filesystem_type (tmpcat, tmpcat, &buf);
    526526              if (fs != NULL &&
     527                  0 != strncmp (_("afs"),     fs, 3) &&
     528                  0 != strncmp (_("devfs"),   fs, 5) &&
     529                  0 != strncmp (_("iso9660"), fs, 7) &&
     530                  0 != strncmp (_("lustre"),  fs, 6) &&
     531                  0 != strncmp (_("mmfs"),    fs, 4) &&
     532                  0 != strncmp (_("msdos"),   fs, 5) &&
    527533                  0 != strncmp (_("nfs"),     fs, 3) &&
     534                  0 != strncmp (_("nosuid"),  fs, 6) &&
    528535                  0 != strncmp (_("proc"),    fs, 4) &&
    529                   0 != strncmp (_("iso9660"), fs, 7) &&
    530                   0 != strncmp (_("vfat"),    fs, 4) &&
    531                   0 != strncmp (_("msdos"),   fs, 5) &&
    532                   0 != strncmp (_("devfs"),   fs, 5) &&
    533                   0 != strncmp (_("nosuid"),  fs, 6)
     536                  0 != strncmp (_("vfat"),    fs, 4)
    534537                  )
    535538                {
  • trunk/src/sh_unix.c

    r27 r29  
    14511451#include <arpa/inet.h>
    14521452
     1453char * sh_unix_h_name (struct hostent * host_entry)
     1454{
     1455        char ** p;
     1456        if (strchr(host_entry->h_name, '.')) {
     1457                return host_entry->h_name;
     1458        } else {
     1459                for (p = host_entry->h_aliases; *p; ++p) {
     1460                        if (strchr(*p, '.'))
     1461                                return *p;
     1462                }
     1463        }
     1464        return host_entry->h_name;
     1465}
     1466
    14531467/* uname() on FreeBSD is broken, because the 'nodename' buf is too small
    14541468 * to hold a valid (leftmost) domain label.
     
    15211535  else
    15221536    {
    1523       sl_strlcpy (sh.host.name, he1->h_name, SH_PATHBUF);
     1537      sl_strlcpy (sh.host.name, sh_unix_h_name(he1), SH_PATHBUF);
    15241538    }
    15251539 
     
    15691583  if (he1 != NULL)
    15701584    {
    1571       sl_strlcpy (sh.host.name, he1->h_name, SH_PATHBUF);
     1585      sl_strlcpy (sh.host.name, sh_unix_h_name(he1), SH_PATHBUF);
    15721586    }
    15731587  else
  • trunk/src/sh_utils.c

    r25 r29  
    13401340  char * endptr = NULL;
    13411341
    1342   SL_ENTER(_("sh_util_obscure_ex"));
     1342  SL_ENTER(_("sh_util_obscure_ok"));
    13431343
    13441344  if (0 == sl_strncmp("all", str, 3))
     
    13481348          sh_obscure_index[i] = (unsigned char)1;
    13491349        }
    1350       SL_RETURN(0, _("sh_util_obscure_ex"));
     1350      SL_RETURN(0, _("sh_util_obscure_ok"));
    13511351    }
    13521352
     
    13591359  if (i > 255)
    13601360    {
    1361       SL_RETURN(-1, _("sh_util_obscure_ex"));
     1361      SL_RETURN(-1, _("sh_util_obscure_ok"));
    13621362    }
    13631363  sh_obscure_index[i] = (unsigned char)1;
     
    13701370      if (i > 255)
    13711371        {
    1372           SL_RETURN(-1, _("sh_util_obscure_ex"));
     1372          SL_RETURN(-1, _("sh_util_obscure_ok"));
    13731373        }
    13741374      sh_obscure_index[i] = (unsigned char)1;
     
    13761376        ++endptr;
    13771377    }
    1378   SL_RETURN(0, _("sh_util_obscure_ex"));
     1378  SL_RETURN(0, _("sh_util_obscure_ok"));
    13791379}
    13801380
    13811381int sh_util_obscurename (ShErrLevel level, char * name_orig, int flag)
    13821382{
    1383   char * name = name_orig;
     1383  unsigned char * name = (unsigned char *) name_orig;
    13841384  char * safe;
    13851385  unsigned int i;
     
    13931393  while (*name != '\0')
    13941394    {
    1395       if ( (*name) == '"'  || (*name) == '\t' ||
     1395      if ( (*name) >  0x7F || (*name) == '"'  || (*name) == '\t' ||
    13961396           (*name) == '\b' || (*name) == '\f' ||
    13971397           (*name) == '\n' || (*name) == '\r' ||
  • trunk/src/slib.c

    r25 r29  
    19841984    {
    19851985      TPT((0, FIL__, __LINE__,
    1986            _("msg=<Error closing file.>, path=<%s>, fd=<%d>\n"),
    1987            ofiles[fd]->path, fd));
     1986           _("msg=<Error closing file.>, path=<%s>, fd=<%d>, err=<%s>\n"),
     1987           ofiles[fd]->path, fd, strerror(errno)));
    19881988    }
    19891989
Note: See TracChangeset for help on using the changeset viewer.