This was probably cut&paste from add_printer_hook which further down has the
unconditional close(fd). In add_port_hook() we're not interested in the output
of 'addport command', so don't create the out fd.
char *cmd = lp_addport_cmd();
char *command = NULL;
int ret;
- int fd;
SE_PRIV se_printop = SE_PRINT_OPERATOR;
bool is_print_op = False;
if ( is_print_op )
become_root();
- ret = smbrun(command, &fd);
+ ret = smbrun(command, NULL);
if ( is_print_op )
unbecome_root();
TALLOC_FREE(command);
if ( ret != 0 ) {
- if (fd != -1)
- close(fd);
return WERR_ACCESS_DENIED;
}