1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

s3: smbd: Convert print_svid code to use file_lines_ploadv().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2019-05-16 22:18:40 -07:00
parent d6453e1ffd
commit f9ccf1cc3d

@ -41,6 +41,7 @@ bool sysv_cache_reload(struct pcap_cache **_pcache)
char **lines;
int i;
struct pcap_cache *pcache = NULL;
char **argl = NULL;
#if defined(HPUX)
DEBUG(5, ("reloading hpux printcap cache\n"));
@ -48,7 +49,23 @@ bool sysv_cache_reload(struct pcap_cache **_pcache)
DEBUG(5, ("reloading sysv printcap cache\n"));
#endif
lines = file_lines_pload(talloc_tos(), "/usr/bin/lpstat -v", NULL);
argl = talloc_zero_array(talloc_tos(), char *, 3);
if (argl == NULL) {
return false;
}
argl[0] = talloc_strdup(argl, "/usr/bin/lpstat");
if (argl[0] == NULL) {
TALLOC_FREE(argl);
return false;
}
argl[1] = talloc_strdup(argl, "-v");
if (argl[1] == NULL) {
TALLOC_FREE(argl);
return false;
}
argl[2] = NULL;
lines = file_lines_ploadv(talloc_tos(), argl, NULL);
if (lines == NULL) {
#if defined(HPUX)
@ -59,7 +76,14 @@ bool sysv_cache_reload(struct pcap_cache **_pcache)
*/
char **scheduler;
scheduler = file_lines_pload("/usr/bin/lpstat -r", NULL);
argl[1] = talloc_strdup(argl, "-r");
if (argl[1] == NULL) {
TALLOC_FREE(argl);
return false;
}
scheduler = file_lines_ploadv(talloc_tos(), argl, NULL);
TALLOC_FREE(argl);
if(!strcmp(*scheduler,"scheduler is running")){
DEBUG(3,("No Printers found!!!\n"));
TALLOC_FREE(scheduler);
@ -75,6 +99,7 @@ bool sysv_cache_reload(struct pcap_cache **_pcache)
return False;
#endif
}
TALLOC_FREE(argl);
for (i = 0; lines[i]; i++) {
char *name, *tmp;