mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
lib: Use closefrom() in smbrun.c
INSURE is never defined or used. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
42a3e2e503
commit
25bcf0e789
@ -181,14 +181,9 @@ static int smbrun_internal(const char *cmd, int *outfd, bool sanitize,
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __INSURE__
|
||||
/* close all other file descriptors, leaving only 0, 1 and 2. 0 and
|
||||
2 point to /dev/null from the startup code */
|
||||
{
|
||||
int fd;
|
||||
for (fd=3;fd<256;fd++) close(fd);
|
||||
}
|
||||
#endif
|
||||
closefrom(3);
|
||||
|
||||
{
|
||||
char *newcmd = NULL;
|
||||
@ -347,14 +342,9 @@ int smbrunsecret(const char *cmd, const char *secret)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __INSURE__
|
||||
/* close all other file descriptors, leaving only 0, 1 and 2. 0 and
|
||||
2 point to /dev/null from the startup code */
|
||||
{
|
||||
int fd;
|
||||
for (fd = 3; fd < 256; fd++) close(fd);
|
||||
}
|
||||
#endif
|
||||
closefrom(3);
|
||||
|
||||
execl("/bin/sh", "sh", "-c", cmd, NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user