View | Details | Raw Unified | Return to bug 91569
Collapse All | Expand All

(-)sudo-1.6.8p8/ldap.c (-2 lines)
Lines 278-285 int sudo_ldap_check_command(ld,entry) Link Here
278
    /* Match against ALL ? */
278
    /* Match against ALL ? */
279
    if (!strcasecmp(*p,"ALL")) {
279
    if (!strcasecmp(*p,"ALL")) {
280
      ret=1;
280
      ret=1;
281
      if (safe_cmnd) free (safe_cmnd);
282
      safe_cmnd=estrdup(user_cmnd);
283
      if (ldap_conf.debug>1) printf(" MATCH!\n");
281
      if (ldap_conf.debug>1) printf(" MATCH!\n");
284
      continue;
282
      continue;
285
    }
283
    }
(-)sudo-1.6.8p8/parse.yacc (-4 lines)
Lines 676-685 cmnd : ALL { Link Here
676
			    }
676
			    }
677
677
678
			    $$ = TRUE;
678
			    $$ = TRUE;
679
680
			    if (safe_cmnd)
681
				free(safe_cmnd);
682
			    safe_cmnd = estrdup(user_cmnd);
683
			}
679
			}
684
		|	ALIAS {
680
		|	ALIAS {
685
			    aliasinfo *aip;
681
			    aliasinfo *aip;
(-)sudo-1.6.8p8/sudo.c (-8 / +2 lines)
Lines 275-280 main(argc, argv, envp) Link Here
275
	/* Validate the user but don't search for pseudo-commands. */
275
	/* Validate the user but don't search for pseudo-commands. */
276
	validated = sudoers_lookup(pwflag);
276
	validated = sudoers_lookup(pwflag);
277
    }
277
    }
278
    if (safe_cmnd == NULL)
279
	safe_cmnd = user_cmnd;
278
280
279
    /*
281
    /*
280
     * If we are using set_perms_posix() and the stay_setuid flag was not set,
282
     * If we are using set_perms_posix() and the stay_setuid flag was not set,
Lines 391-404 main(argc, argv, envp) Link Here
391
	    exit(0);
393
	    exit(0);
392
	}
394
	}
393
395
394
	/* This *must* have been set if we got a match but... */
395
	if (safe_cmnd == NULL) {
396
	    log_error(MSG_ONLY,
397
		"internal error, safe_cmnd never got set for %s; %s",
398
		user_cmnd,
399
		"please report this error at http://courtesan.com/sudo/bugs/");
400
	}
401
402
	/* Override user's umask if configured to do so. */
396
	/* Override user's umask if configured to do so. */
403
	if (def_umask != 0777)
397
	if (def_umask != 0777)
404
	    (void) umask(def_umask);
398
	    (void) umask(def_umask);
(-)sudo-1.6.8p8/sudo.tab.c (-24 / +20 lines)
Lines 674-680 short *yyss; Link Here
674
short *yysslim;
674
short *yysslim;
675
YYSTYPE *yyvs;
675
YYSTYPE *yyvs;
676
int yystacksize;
676
int yystacksize;
677
#line 890 "parse.yacc"
677
#line 886 "parse.yacc"
678
678
679
#define MOREALIASES (32)
679
#define MOREALIASES (32)
680
aliasinfo *aliases = NULL;
680
aliasinfo *aliases = NULL;
Lines 1740-1753 case 60: Link Here
1740
			    }
1740
			    }
1741
1741
1742
			    yyval.BOOLEAN = TRUE;
1742
			    yyval.BOOLEAN = TRUE;
1743
1744
			    if (safe_cmnd)
1745
				free(safe_cmnd);
1746
			    safe_cmnd = estrdup(user_cmnd);
1747
			}
1743
			}
1748
break;
1744
break;
1749
case 61:
1745
case 61:
1750
#line 684 "parse.yacc"
1746
#line 680 "parse.yacc"
1751
{
1747
{
1752
			    aliasinfo *aip;
1748
			    aliasinfo *aip;
1753
1749
Lines 1779-1785 case 61: Link Here
1779
			}
1775
			}
1780
break;
1776
break;
1781
case 62:
1777
case 62:
1782
#line 713 "parse.yacc"
1778
#line 709 "parse.yacc"
1783
{
1779
{
1784
			    if (printmatches == TRUE) {
1780
			    if (printmatches == TRUE) {
1785
				if (in_alias == TRUE) {
1781
				if (in_alias == TRUE) {
Lines 1807-1817 case 62: Link Here
1807
			}
1803
			}
1808
break;
1804
break;
1809
case 65:
1805
case 65:
1810
#line 744 "parse.yacc"
1806
#line 740 "parse.yacc"
1811
{ push; }
1807
{ push; }
1812
break;
1808
break;
1813
case 66:
1809
case 66:
1814
#line 744 "parse.yacc"
1810
#line 740 "parse.yacc"
1815
{
1811
{
1816
			    if ((MATCHED(host_matches) || pedantic) &&
1812
			    if ((MATCHED(host_matches) || pedantic) &&
1817
				!add_alias(yyvsp[-3].string, HOST_ALIAS, host_matches)) {
1813
				!add_alias(yyvsp[-3].string, HOST_ALIAS, host_matches)) {
Lines 1822-1828 case 66: Link Here
1822
			}
1818
			}
1823
break;
1819
break;
1824
case 71:
1820
case 71:
1825
#line 762 "parse.yacc"
1821
#line 758 "parse.yacc"
1826
{
1822
{
1827
			    push;
1823
			    push;
1828
			    if (printmatches == TRUE) {
1824
			    if (printmatches == TRUE) {
Lines 1835-1841 case 71: Link Here
1835
			}
1831
			}
1836
break;
1832
break;
1837
case 72:
1833
case 72:
1838
#line 771 "parse.yacc"
1834
#line 767 "parse.yacc"
1839
{
1835
{
1840
			    if ((MATCHED(cmnd_matches) || pedantic) &&
1836
			    if ((MATCHED(cmnd_matches) || pedantic) &&
1841
				!add_alias(yyvsp[-3].string, CMND_ALIAS, cmnd_matches)) {
1837
				!add_alias(yyvsp[-3].string, CMND_ALIAS, cmnd_matches)) {
Lines 1850-1860 case 72: Link Here
1850
			}
1846
			}
1851
break;
1847
break;
1852
case 73:
1848
case 73:
1853
#line 785 "parse.yacc"
1849
#line 781 "parse.yacc"
1854
{ ; }
1850
{ ; }
1855
break;
1851
break;
1856
case 77:
1852
case 77:
1857
#line 793 "parse.yacc"
1853
#line 789 "parse.yacc"
1858
{
1854
{
1859
			    if (printmatches == TRUE) {
1855
			    if (printmatches == TRUE) {
1860
				in_alias = TRUE;
1856
				in_alias = TRUE;
Lines 1866-1872 case 77: Link Here
1866
			}
1862
			}
1867
break;
1863
break;
1868
case 78:
1864
case 78:
1869
#line 801 "parse.yacc"
1865
#line 797 "parse.yacc"
1870
{
1866
{
1871
			    if ((yyvsp[0].BOOLEAN != NOMATCH || pedantic) &&
1867
			    if ((yyvsp[0].BOOLEAN != NOMATCH || pedantic) &&
1872
				!add_alias(yyvsp[-3].string, RUNAS_ALIAS, yyvsp[0].BOOLEAN)) {
1868
				!add_alias(yyvsp[-3].string, RUNAS_ALIAS, yyvsp[0].BOOLEAN)) {
Lines 1880-1890 case 78: Link Here
1880
			}
1876
			}
1881
break;
1877
break;
1882
case 81:
1878
case 81:
1883
#line 818 "parse.yacc"
1879
#line 814 "parse.yacc"
1884
{ push; }
1880
{ push; }
1885
break;
1881
break;
1886
case 82:
1882
case 82:
1887
#line 818 "parse.yacc"
1883
#line 814 "parse.yacc"
1888
{
1884
{
1889
			    if ((MATCHED(user_matches) || pedantic) &&
1885
			    if ((MATCHED(user_matches) || pedantic) &&
1890
				!add_alias(yyvsp[-3].string, USER_ALIAS, user_matches)) {
1886
				!add_alias(yyvsp[-3].string, USER_ALIAS, user_matches)) {
Lines 1896-1914 case 82: Link Here
1896
			}
1892
			}
1897
break;
1893
break;
1898
case 85:
1894
case 85:
1899
#line 833 "parse.yacc"
1895
#line 829 "parse.yacc"
1900
{
1896
{
1901
			    SETMATCH(user_matches, yyvsp[0].BOOLEAN);
1897
			    SETMATCH(user_matches, yyvsp[0].BOOLEAN);
1902
			}
1898
			}
1903
break;
1899
break;
1904
case 86:
1900
case 86:
1905
#line 836 "parse.yacc"
1901
#line 832 "parse.yacc"
1906
{
1902
{
1907
			    SETNMATCH(user_matches, yyvsp[0].BOOLEAN);
1903
			    SETNMATCH(user_matches, yyvsp[0].BOOLEAN);
1908
			}
1904
			}
1909
break;
1905
break;
1910
case 87:
1906
case 87:
1911
#line 841 "parse.yacc"
1907
#line 837 "parse.yacc"
1912
{
1908
{
1913
			    if (userpw_matches(yyvsp[0].string, user_name, sudo_user.pw))
1909
			    if (userpw_matches(yyvsp[0].string, user_name, sudo_user.pw))
1914
				yyval.BOOLEAN = TRUE;
1910
				yyval.BOOLEAN = TRUE;
Lines 1918-1924 case 87: Link Here
1918
			}
1914
			}
1919
break;
1915
break;
1920
case 88:
1916
case 88:
1921
#line 848 "parse.yacc"
1917
#line 844 "parse.yacc"
1922
{
1918
{
1923
			    if (usergr_matches(yyvsp[0].string, user_name, sudo_user.pw))
1919
			    if (usergr_matches(yyvsp[0].string, user_name, sudo_user.pw))
1924
				yyval.BOOLEAN = TRUE;
1920
				yyval.BOOLEAN = TRUE;
Lines 1928-1934 case 88: Link Here
1928
			}
1924
			}
1929
break;
1925
break;
1930
case 89:
1926
case 89:
1931
#line 855 "parse.yacc"
1927
#line 851 "parse.yacc"
1932
{
1928
{
1933
			    if (netgr_matches(yyvsp[0].string, NULL, NULL, user_name))
1929
			    if (netgr_matches(yyvsp[0].string, NULL, NULL, user_name))
1934
				yyval.BOOLEAN = TRUE;
1930
				yyval.BOOLEAN = TRUE;
Lines 1938-1944 case 89: Link Here
1938
			}
1934
			}
1939
break;
1935
break;
1940
case 90:
1936
case 90:
1941
#line 862 "parse.yacc"
1937
#line 858 "parse.yacc"
1942
{
1938
{
1943
			    aliasinfo *aip = find_alias(yyvsp[0].string, USER_ALIAS);
1939
			    aliasinfo *aip = find_alias(yyvsp[0].string, USER_ALIAS);
1944
1940
Lines 1963-1974 case 90: Link Here
1963
			}
1959
			}
1964
break;
1960
break;
1965
case 91:
1961
case 91:
1966
#line 884 "parse.yacc"
1962
#line 880 "parse.yacc"
1967
{
1963
{
1968
			    yyval.BOOLEAN = TRUE;
1964
			    yyval.BOOLEAN = TRUE;
1969
			}
1965
			}
1970
break;
1966
break;
1971
#line 1920 "sudo.tab.c"
1967
#line 1916 "sudo.tab.c"
1972
    }
1968
    }
1973
    yyssp -= yym;
1969
    yyssp -= yym;
1974
    yystate = *yyssp;
1970
    yystate = *yyssp;

Return to bug 91569