Changes by: szaka
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2356/libntfs
Modified Files:
dir.c security.c
Log Message:
Optionally create NTFS version 3.0 (W2K) or 3.1 (XP, W2K3, Vista).
Contributed by Erik Sornes. No side-effect for v1.2 NTFS which is still
the default. The implementation needs some minor work: see e.g. the chkdsk
messages and the result of ntfscmp'ing the two images.
Index: dir.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/dir.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -p -r1.29 -r1.30
--- dir.c 16 Oct 2005 23:33:04 -0000 1.29
+++ dir.c 19 Oct 2005 22:04:46 -0000 1.30
@@ -45,11 +45,22 @@
#include "lcnalloc.h"
/*
- * The little endian Unicode string "$I30" as a global constant.
+ * The little endian Unicode strings "$I30", "$SII", "$SDH", "$O"
+ * and "$Q" as global constants.
*/
ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
const_cpu_to_le16('3'), const_cpu_to_le16('0'),
const_cpu_to_le16('\0') };
+ntfschar SII[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'),
+ const_cpu_to_le16('I'), const_cpu_to_le16('I'),
+ const_cpu_to_le16('\0') };
+ntfschar SDH[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'),
+ const_cpu_to_le16('D'), const_cpu_to_le16('H'),
+ const_cpu_to_le16('\0') };
+ntfschar O[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('O'),
+ const_cpu_to_le16('\0') };
+ntfschar Q[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('Q'),
+ const_cpu_to_le16('\0') };
/**
* ntfs_inode_lookup_by_name - find an inode in a directory given its name
Index: security.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/security.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- security.c 28 Sep 2005 13:47:48 -0000 1.8
+++ security.c 19 Oct 2005 22:04:46 -0000 1.9
@@ -248,3 +248,26 @@ err_out:
errno = i;
return NULL;
}
+
+/*
+ * GUID generate_guid(GUID *guid)
+ * generatates a random current guid
+ * perhaps not a very good random number generator though...
+ */
+
+GUID *generate_guid(GUID *guid) {
+
+ int i;
+ static u8 array[16];
+
+ for (i = 0; i < 16; i++) {
+ array[i] = (u8)(random() & 0xFF);
+ if (i == 7)
+ array[7] = (array[7] & 0x0F) | 0x40;
+ if (i == 8)
+ array[8] = (array[8] & 0x3F) | 0x80;
+ }
+ memcpy(guid, array, sizeof(guid));
+ return guid;
+}
+
|