cifs-utils/8c6268cbbd4202631e5c4b30297adc0088a1d568.diff
Lars Müller bab4f11c74 - mount.cifs: don't pass credentials= option to the kernel.
- doc: update mailing list.
- mount.cifs: don't send a mandatory ver= option to the kernel.
- mount.cifs: remove smb2 multicall binary code.
- doc: remove old XML sources for mount.cifs.8 and cifs.upcall.8.
- mount.cifs: unused variables.

OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=58
2012-05-26 11:44:52 +00:00

71 lines
2.2 KiB
Diff

commit 8c6268cbbd4202631e5c4b30297adc0088a1d568
Author: Jeff Layton <jlayton@samba.org>
Date: Thu Apr 19 07:29:46 2012 -0400
mount.cifs: fix up some -D_FORTIFY_SOURCE=2 warnings
...and add -D_FORTIFY_SOURCE=2 to the default $CFLAGS.
Acked-by: Acked-by: Suresh Jayaraman <sjayaraman@suse.com>
Signed-off-by: Jeff Layton <jlayton@samba.org>
Index: cifs-utils-5.4/Makefile.am
===================================================================
--- cifs-utils-5.4.orig/Makefile.am
+++ cifs-utils-5.4/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = -Wall -Wextra -Werror
+AM_CFLAGS = -Wall -Wextra -Werror -D_FORTIFY_SOURCE=2
ACLOCAL_AMFLAGS = -I aclocal
root_sbindir = $(ROOTSBINDIR)
Index: cifs-utils-5.4/mount.cifs.c
===================================================================
--- cifs-utils-5.4.orig/mount.cifs.c
+++ cifs-utils-5.4/mount.cifs.c
@@ -927,11 +927,11 @@ parse_options(const char *data, struct p
return EX_USAGE;
}
} else {
- /* domain/username%password */
- const int max = MAX_DOMAIN_SIZE +
- MAX_USERNAME_SIZE +
- MOUNT_PASSWD_SIZE + 2;
- if (strnlen(value, max + 1) >= max + 1) {
+ /* domain/username%password + NULL term. */
+ const size_t max = MAX_DOMAIN_SIZE +
+ MAX_USERNAME_SIZE +
+ MOUNT_PASSWD_SIZE + 2 + 1;
+ if (strnlen(value, max) >= max) {
fprintf(stderr, "username too long\n");
return EX_USAGE;
}
@@ -1603,8 +1603,10 @@ add_mtab(char *devname, char *mountpoint
mountent.mnt_passno = 0;
rc = addmntent(pmntfile, &mountent);
if (rc) {
+ int ignore __attribute__((unused));
+
fprintf(stderr, "unable to add mount entry to mtab\n");
- ftruncate(fd, statbuf.st_size);
+ ignore = ftruncate(fd, statbuf.st_size);
rc = EX_FILEIO;
}
tmprc = my_endmntent(pmntfile, statbuf.st_size);
Index: cifs-utils-5.4/mtab.c
===================================================================
--- cifs-utils-5.4.orig/mtab.c
+++ cifs-utils-5.4/mtab.c
@@ -271,8 +271,10 @@ my_endmntent(FILE *stream, off_t size)
/* truncate file back to "size" -- best effort here */
if (rc) {
+ int ignore __attribute__((unused));
+
rc = errno;
- ftruncate(fd, size);
+ ignore = ftruncate(fd, size);
}
endmntent(stream);