Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning on startup #39

Open
timsoftgit opened this issue Apr 19, 2022 · 5 comments
Open

warning on startup #39

timsoftgit opened this issue Apr 19, 2022 · 5 comments

Comments

@timsoftgit
Copy link

timsoftgit commented Apr 19, 2022

I get the following warning message on running wsdd2 -d

cannot read additional dns hostnames from testparm
cannot read netbios aliases from testparm

As there are no aliases or hostnames in smb.conf the messages are correct, although running as -d they should be logged to syslog rather than on stdout/err . I would like to suppress these information messages. I couldn't see an option to do so in the program parameters (only increasing the debug level). Is there a make/makefile option to suppress these messages which are likely to be shown on many samba setups, or a runtime way of suppressing them?

@timsoftgit
Copy link
Author

if you change line 604 to read DEBUG(1, W, "cannot read %s from testparm", name); instead of
DEBUG(0, W, "cannot read %s from testparm", name);
then the messages are not printed. However, calling wsdd2 with -d -W -W or after this change should raise the debug level and show the message but it does not.

@whlsxl
Copy link
Contributor

whlsxl commented May 4, 2022

That's not a problem.
Usually, you don't set additional dns hostnames & netbios aliases in samba. wsdd2 will use netbios name as the share name.

@timsoftgit
Copy link
Author

timsoftgit commented May 8, 2022

As you say, usually it is not in smb.conf.
My point was that there appears to be no way to surpress the "cannot load..." warning messages for these (normally unused) optional samba config parameters. wsdd2 should recognise that these are optional samba smb.conf parameters and not complain when they are not present.

@timsoftgit
Copy link
Author

it appears to be because the get_smbparm macro/function has no concept of an optional samba parameter. Adding one to line 584 eg. changing static char *get_smbparm(const char *name, const char *_default) to static char *get_smbparm(const char *name, const char *_default, const int optional) and adding it to 603 if ((!fgets(buf, sizeof(buf), pp) || !buf[0] || buf[0] == '\n')&&!optional) (and adding the optional value each place that get_smbparm is called) would allow wsdd2 to not generate debug messages to stdio for optional samba parameters.

@timsoftgit
Copy link
Author

the optional value could even be a value defaulting to 0, and set to non-zero if a command line option was set, to give the user the option to show or suppress warnings relating to optional samba parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants