lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140507145426.GD28814@thunk.org>
Date:	Wed, 7 May 2014 10:54:26 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	Lukáš Czerner <lczerner@...hat.com>
Cc:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH -v2 2/3] mke2fs: print extra information about existing
 ext2/3/4 file systemsGjj

On Wed, May 07, 2014 at 03:43:09PM +0200, Lukáš Czerner wrote:
> so the whole thing should look like:
> 
>  +      if (sb->s_mtime) {
>  +              tm = sb->s_mtime;
>  +              if (sb->s_last_mounted[0]) {
>  +                      memset(buf, 0, sizeof(buf));
>  +                      strncpy(buf, sb->s_last_mounted,
>  +                              sizeof(sb->s_last_mounted));
>  +                      printf(_("\tlast mounted on %s on %s"), buf,
>  +                             ctime(&tm));
>  +              } else
>  +                      printf(_("\tlast mounted on %s"), ctime(&tm));
>  +      } else if (sb->s_mkfs_time) {
>  +              tm = sb->s_mkfs_time;
>  +              printf(_("\tcreated on %s"), ctime(&tm));
>  +      } else if (sb->s_wtime) {
>  +              tm = sb->s_wtime;
>  +              printf(_("\tlast modified on %s"), ctime(&tm));
>  +      }

Sorry, that's in fact what I have.

> Also I wonder whether we need to use 'tm' variable, can't we use the
> sb->s_*time directly ? But that's nitpicking.

That's because sb->s_mkfs_time is a __u32, and time_t isn't
necessarily be a 32-bit type (and in fact isn't on x86_64, x32,
apropos of current discussion happening on ksummit-discuss.)  Yes,
that means the ext4 superblock has a 2038 problem, but that's a
separate issue that we should fix one of these days....

	 	    	  	 	       - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists