Thank you for maintaining a set of useful utilities like these.

When trying to set the serial number to a value of 0x8000000000000000 
or greater the serial number is set to 0x7FFFFFFFFFFFFFFF instead.

This patch fixes ntfslabel but there may be a problem in any other 
programs that allow a serial number to be specified.

diff -uprN old/ntfs-3g_ntfsprogs-2013.1.13/ntfsprogs/ntfslabel.c 
new/ntfs-3g_ntfsprogs-2013.1.13/ntfsprogs/ntfslabel.c
--- old/ntfs-3g_ntfsprogs-2013.1.13/ntfsprogs/ntfslabel.c       2013-01-13 
00:46:35.000000000 -0600
+++ new/ntfs-3g_ntfsprogs-2013.1.13/ntfsprogs/ntfslabel.c       2013-08-24 
22:39:24.000000000 -0500
@@ -64,7 +64,7 @@ static struct options {
        int      verbose;       /* Extra output */
        int      force;         /* Override common sense */
        int      new_serial;    /* Change the serial number */
-       long long serial;       /* Forced serial number value */
+       unsigned long long serial;      /* Forced serial number value */
        int      noaction;      /* Do not write to disk */
 } opts;
 
@@ -166,7 +166,7 @@ static int parse_options(int argc, char 
                        break;
                case 'I' :      /* not proposed as a short option letter */
                        if (optarg) {
-                               opts.serial = strtoll(optarg, &endserial, 16);
+                               opts.serial = strtoull(optarg, &endserial, 16);
                                if (*endserial)
                                        ntfs_log_error("Bad hexadecimal serial 
number.\n");
                        }
@@ -174,7 +174,7 @@ static int parse_options(int argc, char 
                        break;
                case 'i' :      /* not proposed as a short option letter */
                        if (optarg) {
-                               opts.serial = strtoll(optarg, &endserial, 16)
+                               opts.serial = strtoull(optarg, &endserial, 16)
                                                        << 32;
                                if (*endserial)
                                        ntfs_log_error("Bad hexadecimal serial 
number.\n");

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to