Skip to contentSkip to conversation

nfs-utils: rpc.svcgssd bug reading /etc/nfs.conf

DISCUSSION [email protected] 2 participants 2 messages Jun 6, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi there,

please don't hesitate to direct me somewhere else in case this is not the right place to report bugs concerning nfs-utils.

I found a bug in nfs-utils concerning the rpc.svcgssd daemon while I was trying to set the principal name in /etc/nfs.conf:

[svcgssd]
principal=nfs/[email protected]

However rpc.svcgssd refused to start - complaining about not being able to find the principal in the keytab.
When specified on command line (using the -p option) things worked however.

So I took a look at the code and found the problem in nfs-utils-2.6.1/utils/gssd/svcgssd.c. The problem seems to be here:

/* We don't need the config anymore */
conf_cleanup();

This is called right after parsing the config file(s), but before calling gssd_acquire_cred(). At the time it is called the variable "principal" does no longer contain the data read from the config file.

Moving conf_cleanup() to the end of the code helps.

As I first encountered this on Ubuntu 22.04 I also opened a Launchpad bug report:
s. https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1977745

Maybe someone can fix this for the next release.

Best regards,
Marcel

#1 lore raw

Hello,

Quoted 25 lines · On 6/6/22 2:14 PM, [email protected] wrote:

Hi there,

please don't hesitate to direct me somewhere else in case this is not the right place to report bugs concerning nfs-utils.

I found a bug in nfs-utils concerning the rpc.svcgssd daemon while I was trying to set the principal name in /etc/nfs.conf:

[svcgssd]
principal=nfs/[email protected]

However rpc.svcgssd refused to start - complaining about not being able to find the principal in the keytab.
When specified on command line (using the -p option) things worked however.

So I took a look at the code and found the problem in nfs-utils-2.6.1/utils/gssd/svcgssd.c. The problem seems to be here:

/* We don't need the config anymore */
conf_cleanup();

This is called right after parsing the config file(s), but before calling gssd_acquire_cred(). At the time it is called the variable "principal" does no longer contain the data read from the config file.

Quoted 5 lines

Moving conf_cleanup() to the end of the code helps.Could you please set a patch that shows where you moved this call?

As I first encountered this on Ubuntu 22.04 I also opened a Launchpad bug report:
s. https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1977745

Unfortunately I don't get notified when these get open....
https://bugzilla.linux-nfs.org/ would be a better place.

Quoted 2 lines

Maybe someone can fix this for the next release.

Sure... send a patch and we can make it happen!

steved.

Quoted 4 lines

Best regards,
Marcel