/[smeserver]/rpms/sudo/sme9/sudo-1.8.6p3-strunquote.patch
ViewVC logotype

Annotation of /rpms/sudo/sme9/sudo-1.8.6p3-strunquote.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Thu Feb 4 19:44:39 2021 UTC (3 years, 9 months ago) by jpp
Branch: MAIN
CVS Tags: sudo-1_8_6p3-30_el6_sme, sudo-1_8_6p3-29_el6_9, HEAD
Sudo

1 jpp 1.1 diff -up ./common/Makefile.in.strunquote ./common/Makefile.in
2     --- ./common/Makefile.in.strunquote 2012-09-18 15:57:43.000000000 +0200
3     +++ ./common/Makefile.in 2015-12-08 12:55:36.265249583 +0100
4     @@ -59,7 +59,7 @@ SHELL = @SHELL@
5    
6     LTOBJS = alloc.lo atobool.lo fileops.lo fmt_string.lo lbuf.lo list.lo \
7     secure_path.lo setgroups.lo sudo_conf.lo sudo_debug.lo term.lo \
8     - ttysize.lo zero_bytes.lo @COMMON_OBJS@
9     + ttysize.lo zero_bytes.lo strunquote.lo @COMMON_OBJS@
10    
11     all: libcommon.la
12    
13     @@ -160,3 +160,6 @@ ttysize.lo: $(srcdir)/ttysize.c $(top_bu
14     zero_bytes.lo: $(srcdir)/zero_bytes.c $(top_builddir)/config.h \
15     $(incdir)/missing.h
16     $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(DEFS) $(srcdir)/zero_bytes.c
17     +strunquote.lo: $(srcdir)/strunquote.c $(top_builddir)/config.h \
18     + $(incdir)/missing.h
19     + $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/strunquote.c
20     diff -up ./common/strunquote.c.strunquote ./common/strunquote.c
21     --- ./common/strunquote.c.strunquote 2015-12-08 12:53:50.322062865 +0100
22     +++ ./common/strunquote.c 2015-12-08 12:53:50.321062873 +0100
23     @@ -0,0 +1,45 @@
24     +/*
25     + * Copyright (c) 2015 Daniel Kopecek <dkopecek@redhat.com>
26     + *
27     + * Permission to use, copy, modify, and distribute this software for any
28     + * purpose with or without fee is hereby granted, provided that the above
29     + * copyright notice and this permission notice appear in all copies.
30     + *
31     + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
32     + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
33     + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
34     + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
35     + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
36     + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
37     + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
38     + */
39     +#include <string.h>
40     +#include <ctype.h>
41     +
42     +char *strunquote(char *arg)
43     +{
44     + char *str = arg;
45     + if (str == NULL) {
46     + return NULL;
47     + }
48     + const size_t len = strlen(str);
49     + char *strend = str + len - 1;
50     +
51     + /* Remove blanks */
52     + for (; isblank((unsigned char)*str); str++);
53     + for (; isblank((unsigned char)*strend) && strend > str; strend--);
54     + /*
55     + * Check that the string is double-quoted.
56     + * If not, we are done.
57     + */
58     + if (*str != '"' || *strend != '"' || str == strend) {
59     + /* Return the original argument if we didn't touch it */
60     + return arg;
61     + }
62     +
63     + /* Remove the double-quotes */
64     + *strend = '\0';
65     + ++str;
66     +
67     + return str;
68     +}
69     diff -up ./include/strunquote.h.strunquote ./include/strunquote.h
70     --- ./include/strunquote.h.strunquote 2015-12-08 12:53:50.322062865 +0100
71     +++ ./include/strunquote.h 2015-12-08 12:53:50.322062865 +0100
72     @@ -0,0 +1,17 @@
73     +/*
74     + * Copyright (c) 2015 Daniel Kopecek <dkopecek@redhat.com>
75     + *
76     + * Permission to use, copy, modify, and distribute this software for any
77     + * purpose with or without fee is hereby granted, provided that the above
78     + * copyright notice and this permission notice appear in all copies.
79     + *
80     + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
81     + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
82     + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
83     + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
84     + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
85     + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
86     + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
87     + */
88     +
89     +char *strunquote(char *arg);
90     diff -up ./plugins/sudoers/ldap.c.strunquote ./plugins/sudoers/ldap.c
91     --- ./plugins/sudoers/ldap.c.strunquote 2015-12-08 12:53:50.307062980 +0100
92     +++ ./plugins/sudoers/ldap.c 2015-12-08 12:53:50.322062865 +0100
93     @@ -79,6 +79,7 @@
94     #include "sudoers.h"
95     #include "parse.h"
96     #include "lbuf.h"
97     +#include "strunquote.h"
98    
99     /* Older Netscape LDAP SDKs don't prototype ldapssl_set_strength() */
100     #if defined(HAVE_LDAPSSL_SET_STRENGTH) && !defined(HAVE_LDAP_SSL_H) && !defined(HAVE_MPS_LDAP_SSL_H)
101     @@ -942,10 +943,10 @@ sudo_ldap_parse_options(LDAP *ld, LDAPMe
102     if (op == '+' || op == '-') {
103     *(val - 2) = '\0'; /* found, remove extra char */
104     /* case var+=val or var-=val */
105     - set_default(var, val, (int) op);
106     + set_default(var, strunquote(val), (int) op);
107     } else {
108     /* case var=val */
109     - set_default(var, val, true);
110     + set_default(var, strunquote(val), true);
111     }
112     } else if (*var == '!') {
113     /* case !var Boolean False */
114     diff -up ./plugins/sudoers/sssd.c.strunquote ./plugins/sudoers/sssd.c
115     --- ./plugins/sudoers/sssd.c.strunquote 2015-12-08 12:53:50.308062972 +0100
116     +++ ./plugins/sudoers/sssd.c 2015-12-08 12:53:50.322062865 +0100
117     @@ -61,6 +61,7 @@
118     #include "lbuf.h"
119     #include "sudo_debug.h"
120     #include "ipa_hostname.h"
121     +#include "strunquote.h"
122    
123     /* SSSD <--> SUDO interface - do not change */
124     struct sss_sudo_attr {
125     @@ -1000,10 +1001,10 @@ sudo_sss_parse_options(struct sudo_sss_h
126     if (op == '+' || op == '-') {
127     *(val - 2) = '\0'; /* found, remove extra char */
128     /* case var+=val or var-=val */
129     - set_default(v, val, (int) op);
130     + set_default(v, strunquote(val), (int) op);
131     } else {
132     /* case var=val */
133     - set_default(v, val, true);
134     + set_default(v, strunquote(val), true);
135     }
136     } else if (*v == '!') {
137     /* case !var Boolean False */

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed