Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Jun 2016 13:10:01 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 209791] To tunefs utilities I added flag for generate new ufsid (unique filesystem id).
Message-ID:  <bug-209791-8-IpzuLfEfV7@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-209791-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-209791-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209791

--- Comment #1 from Pavel Volkov <pavelivolkov@gmail.com> ---
Hello.
To generate a new ufsid I used an algorithm from a file:

/usr/src/sbin/newfs/mkfs.c

    140                 time(&utime);

    465         sblock.fs_id[0] =3D (long)utime;
    466         sblock.fs_id[1] =3D newfs_random();

   1149 /*
   1150  * For the regression test, return predictable random values.
   1151  * Otherwise use a true random number generator.
   1152  */
   1153 static u_int32_t
   1154 newfs_random(void)
   1155 {
   1156         static int nextnum =3D 1;
   1157
   1158         if (Rflag)
   1159                 return (nextnum++);
   1160         return (arc4random());
   1161 }

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-209791-8-IpzuLfEfV7>