e2fsprogs (1.35-8) unstable; urgency=low
+ * Remove double "//" when listing attributes in the root directory or
+ when there is a trailing '/' in the directory name. (Closes: #272943)
* Make sure the configure files are newer than configure.in the
debian/rules file so that a dpkg-source created patch won't
trigger an attempt rebuild of the configure script. (Closes: #272558)
* Make sure /usr/lib/e2initrd_helper is in the e2fsprogs package.
(Closes: #272698)
- -- Theodore Y. Ts'o <tytso@mit.edu> Fri, 24 Sep 2004 11:51:36 -0400
+ -- Theodore Y. Ts'o <tytso@mit.edu> Fri, 24 Sep 2004 12:12:44 -0400
e2fsprogs (1.35-7) unstable; urgency=low
2004-09-24 Theodore Ts'o <tytso@mit.edu>
+ * lsattr.c (lsattr_dir_proc): Avoid double // when listing the
+ root directory, or when there is a trailing '/' in the
+ directory name. (Addresses Debian Bug #272943)
+
* Makefile.in: Make sure /usr/lib is created for when we install
e2initrd_helper.
{
STRUCT_STAT st;
char *path;
+ int dir_len = strlen(dir_name);
- path = malloc(strlen (dir_name) + 1 + strlen (de->d_name) + 1);
+ path = malloc(dir_len + strlen (de->d_name) + 2);
- sprintf (path, "%s/%s", dir_name, de->d_name);
+ if (dir_len && dir_name[dir_len-1] == '/')
+ sprintf (path, "%s%s", dir_name, de->d_name);
+ else
+ sprintf (path, "%s/%s", dir_name, de->d_name);
if (LSTAT (path, &st) == -1)
perror (path);
else {