~ubuntu-branches/ubuntu/trusty/postfix/trusty-updates

« back to all changes in this revision

Viewing changes to src/util/vstream_popen.c

Tags: upstream-2.3.1
ImportĀ upstreamĀ versionĀ 2.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
/*      list of name, value, name, value, ... elements. By default only the
39
39
/*      command search path is initialized to _PATH_DEFPATH.
40
40
/* .IP "VSTREAM_POPEN_EXPORT (char **)"
 
41
/*      This argument is passed to clean_env().
41
42
/*      Null-terminated array of names of environment parameters
42
43
/*      that can be exported. By default, everything is exported.
43
 
/* .IP "VSTREAM_POPEN_UID (int)"
 
44
/* .IP "VSTREAM_POPEN_UID (uid_t)"
44
45
/*      The user ID to execute the command as. The user ID must be non-zero.
45
 
/* .IP "VSTREAM_POPEN_GID (int)"
 
46
/* .IP "VSTREAM_POPEN_GID (gid_t)"
46
47
/*      The group ID to execute the command as. The group ID must be non-zero.
47
48
/* .IP "VSTREAM_POPEN_SHELL (char *)"
48
49
/*      The shell to use when executing the command specified with
123
124
 
124
125
static void vstream_parse_args(VSTREAM_POPEN_ARGS *args, va_list ap)
125
126
{
126
 
    char   *myname = "vstream_parse_args";
 
127
    const char *myname = "vstream_parse_args";
127
128
    int     key;
128
129
 
129
130
    /*
156
157
            break;
157
158
        case VSTREAM_POPEN_UID:
158
159
            args->privileged = 1;
159
 
            args->uid = va_arg(ap, int);
 
160
            args->uid = va_arg(ap, uid_t);
160
161
            break;
161
162
        case VSTREAM_POPEN_GID:
162
163
            args->privileged = 1;
163
 
            args->gid = va_arg(ap, int);
 
164
            args->gid = va_arg(ap, gid_t);
164
165
            break;
165
166
        case VSTREAM_POPEN_ENV:
166
167
            args->env = va_arg(ap, char **);
191
192
 
192
193
VSTREAM *vstream_popen(int flags,...)
193
194
{
194
 
    char   *myname = "vstream_popen";
 
195
    const char *myname = "vstream_popen";
195
196
    VSTREAM_POPEN_ARGS args;
196
197
    va_list ap;
197
198
    VSTREAM *stream;
217
218
        (void) close(sockfd[1]);
218
219
        return (0);
219
220
    case 0:                                     /* child */
 
221
        (void) msg_cleanup((MSG_CLEANUP_FN) 0);
220
222
        if (close(sockfd[1]))
221
223
            msg_warn("close: %m");
222
224
        for (fd = 0; fd < 2; fd++)