2007-03-20 22:52:18

by Kevin Coffman

[permalink] [raw]
Subject: [PATCH] Fix a couple of problems that crept into mount

From: Kevin Coffman <[email protected]>

Commit 6facb22402a0bd8cd49be2ed1a0856b24fef42f4 changed the allocation
of len to no longer get 20 extra bytes. It needs to get at least one
extra byte for a null character, otherwise a single extra option such
as "sec=krb5" is never copied in parse_opt() and is dropped.

Commit 44a3727a3243e674a1f1fdad5cbbc639aa25d01c added a typo when
checking the program name.
---

utils/mount/mount.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index 487c0a6..b367b64 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -262,7 +262,7 @@ static void parse_opts (const char *opti
if (options != NULL) {
char *opts = xstrdup(options);
char *opt, *p;
- int len = strlen(opts);
+ int len = strlen(opts) + 1; /* include room for a null */
int open_quote = 0;

*extra_opts = xmalloc(len);
@@ -437,7 +437,7 @@ int main(int argc, char *argv[])
exit(1);
}

- if (strcmp(progname, "mount.nfsv4") == 0)
+ if (strcmp(progname, "mount.nfs4") == 0)
nfs_mount_vers = 4;

if (uid != 0) {

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2007-03-20 23:27:22

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH] Fix a couple of problems that crept into mount

On Tuesday March 20, [email protected] wrote:
> From: Kevin Coffman <[email protected]>
>
> Commit 6facb22402a0bd8cd49be2ed1a0856b24fef42f4 changed the allocation
> of len to no longer get 20 extra bytes. It needs to get at least one
> extra byte for a null character, otherwise a single extra option such
> as "sec=krb5" is never copied in parse_opt() and is dropped.
>
> Commit 44a3727a3243e674a1f1fdad5cbbc639aa25d01c added a typo when
> checking the program name.

Thanks Kevin!

Applied.

NeilBrown

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs