ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/CCSAdmin/common.c
(Generate patch)

Comparing CCSAdmin/common.c (file contents):
Revision 571 by douglas, 2005-08-28T01:55:06-07:00 vs.
Revision 572 by douglas, 2005-09-25T17:43:17-07:00

# Line 76 | Line 76 | void authenticate(const char *program, j
76          {
77                  check(dup2(pipe_[1], 1), environment);
78                  check(close(pipe_[0]), environment);
79 <                check(execl("/usr/local/bin/ldapwhoami", program, "-D", name, "-W", "-x", "-y", secret, NULL), environment);
79 >                check(execl(LDAPWHOAMI, program, "-D", name, "-W", "-x", "-y", secret, NULL), environment);
80          }
81  
82          check(close(pipe_[1]), environment);
# Line 137 | Line 137 | void get(const char *prompt, regex_t *re
137          }
138          while (regcheck(regexec(regex, *string, 0, NULL, 0), regex, environment));
139   }
140 +
141 + #ifndef __FreeBSD__
142 + size_t strlcpy(char *dst, const char *src, size_t size)
143 + {
144 +        dst[size - 1] = '\0';
145 +
146 +        return strlen(strncpy(dst, src, size - 1));
147 + }
148 +
149 + size_t strlcat(char *dst, const char *src, size_t size)
150 + {
151 +        dst[size - 1] = '\0';
152 +
153 +        size_t size_ = strlen(dst);
154 +
155 +        return strlen(strncpy(dst + size_, src, size - size_ - 1));
156 + }
157 +
158 + char *fgetln(FILE * restrict stream, size_t * restrict len)
159 + {
160 +        static char *line = NULL;
161 +        static size_t size;
162 +
163 +        if ((*len = getline(&line, &size, stream)) == -1)
164 +                return NULL;
165 +
166 +        return line;
167 + }
168 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines