35#define NMB_BROADCAST 2
63 for (t = s; *t !=
'\0'; ++t) {
87main(
int argc,
char *argv[])
100 if (setvbuf(stdout,
nullptr, _IOLBF, 0) != 0)
104 for (i = 1; i < argc; ++i) {
105 if (strcmp(argv[i],
"-d") == 0) {
113 if (strcmp(argv[i],
"-W") == 0) {
133 if (strcmp(argv[i],
"-w") == 0) {
138 if (strcmp(argv[i],
"-P") == 0) {
143 if (strcmp(argv[i],
"-B") == 0) {
150 if (strcmp(argv[i],
"-U") == 0) {
157 if (strcmp(argv[i],
"-S") == 0) {
180 shcmd =
debug_enabled ? HELPERSCRIPT : HELPERSCRIPT
" > /dev/null 2>&1";
184 if ((s = strchr(buf,
'\n')) ==
nullptr)
188 if ((s = strchr(buf,
' ')) ==
nullptr) {
201 if ((s = strchr(user,
'\\')) !=
nullptr) {
207 if (domname !=
nullptr && strlen(domname) > 0) {
209 if (strcasecmp(dom->
sname, domname) == 0)
214 if (dom ==
nullptr) {
218 if ((p = popen(shcmd,
"w")) ==
nullptr) {
222 (void) fprintf(p,
"%s\n", dom->
name);
224 (void) fprintf(p,
"%s\n", dom->
nmbaddr);
225 (void) fprintf(p,
"%d\n", dom->
nmbcast);
226 (void) fprintf(p,
"%s\n", dom->
authshare);
227 (void) fprintf(p,
"%s\n", dom->
authfile);
228 (void) fprintf(p,
"%s\n", user);
231 (void) fputc(
'\n', p);
#define HELPER_INPUT_BUFFER
int main(int argc, char *argv[])
struct SMBDOMAIN * firstdom
struct SMBDOMAIN * lastdom
static void print_esc(FILE *p, char *s)
void rfc1738_unescape(char *url)