~vorlon/ubuntu/natty/sudo/keep_home_by_default

« back to all changes in this revision

Viewing changes to toke.l

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-07-06 11:43:05 UTC
  • mfrom: (1.3.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100706114305-9fhggputpq3j1kxp
Tags: 1.7.2p7-1ubuntu1
* Merge from debian unstable.  Remaining changes:
 - debian/rules:
   - compile with --without-lecture --with-tty-tickets (Ubuntu specific)
   - install man/man8/sudo_root.8 (Ubuntu specific)
   - install apport hooks
 - debian/sudo-ldap.dirs, debian/sudo.dirs: add
   usr/share/apport/package-hooks
 - debian/patches/ubuntu-sudo-as-admin-successful.patch: adjust sudo.c so
   that if the user successfully authenticated and he is in the 'admin'
   group, then create a stamp ~/.sudo_as_admin_successful. Our default bash
   profile checks for this and displays a short intro about sudo if the flag
   is not present
* Dropped the following, now included upstream:
  - fix for CVE-2010-1163
  - fix for CVE-2010-0426
  - debian/sudo.postinst, debian/sudo-ldap.postinst: update description to
    match behavior in sudoers file
  - don't install init script. Debian moved to /var/lib/sudo from
    /var/run/sudo, so Ubuntu's tmpfs usage won't clean those out
    automatically any more, so we now need the initscript.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
#include "parse.h"
72
72
#include <gram.h>
73
73
 
74
 
#ifndef lint
75
 
__unused static const char rcsid[] = "$Sudo: toke.l,v 1.38 2009/07/18 13:55:37 millert Exp $";
76
 
#endif /* lint */
77
 
 
78
74
extern YYSTYPE yylval;
 
75
extern int parse_error;
79
76
int sudolineno = 1;
80
77
char *sudoers;
81
78
static int sawspace = 0;
253
250
 
254
251
                            LEXTRACE("INCLUDEDIR\n");
255
252
 
256
 
                            /* Push current buffer and switch to include file */
257
 
                            if (!push_includedir(path))
 
253
                            /*
 
254
                             * Push current buffer and switch to include file.
 
255
                             * We simply ignore empty directories.
 
256
                             */
 
257
                            if (!push_includedir(path) && parse_error)
258
258
                                yyterminate();
259
259
                        }
260
260
 
748
748
 
749
749
    if (!(dir = opendir(dirpath))) {
750
750
        yyerror(dirpath);
751
 
        return(FALSE);
 
751
        return(NULL);
752
752
    }
753
753
    while ((dent = readdir(dir))) {
754
754
        /* Ignore files that end in '~' or have a '.' in them. */
840
840
            efree(pl);
841
841
        }
842
842
        efree(istack[idepth].path);
843
 
        if (!istack[idepth].keepopen)
 
843
        if (idepth && !istack[idepth].keepopen)
844
844
            fclose(istack[idepth].bs->yy_input_file);
845
845
        yy_delete_buffer(istack[idepth].bs);
846
846
    }
865
865
        }
866
866
        istacksize += SUDOERS_STACK_INCREMENT;
867
867
        istack = (struct include_stack *) realloc(istack,
868
 
            sizeof(istack) * istacksize);
 
868
            sizeof(*istack) * istacksize);
869
869
        if (istack == NULL) {
870
870
            yyerror("unable to allocate memory");
871
871
            return(FALSE);
873
873
    }
874
874
    if (isdir) {
875
875
        if (!(path = switch_dir(&istack[idepth], path))) {
876
 
            yyerror(path);
 
876
            /* switch_dir() called yyerror() for us */
877
877
            return(FALSE);
878
878
        }
879
879
        if ((fp = open_sudoers(path, FALSE, &keepopen)) == NULL) {
880
880
            yyerror(path);
881
 
            return(FALSE); /* XXX - just to go next one? */
 
881
            return(FALSE); /* XXX - just to go next one */
882
882
        }
883
883
    } else {
884
884
        if ((fp = open_sudoers(path, TRUE, &keepopen)) == NULL) {
918
918
        istack[idepth - 1].more = pl->next;
919
919
        if ((fp = open_sudoers(pl->path, FALSE, &keepopen)) == NULL) {
920
920
            yyerror(pl->path);
921
 
            return(FALSE); /* XXX - just to go next one? */
 
921
            return(FALSE); /* XXX - just to go next one */
922
922
        }
923
923
        efree(sudoers);
924
924
        sudoers = pl->path;