s3: Fix bug 7470
authorVolker Lendecke <vl@samba.org>
Sat, 25 Sep 2010 17:56:58 +0000 (10:56 -0700)
committerVolker Lendecke <vl@samba.org>
Sat, 25 Sep 2010 17:59:15 +0000 (10:59 -0700)
S_IREAD and S_IWRITE are not standard.

Thanks to Joachim Schmitz <schmitz@hp.com> for reporting!

source3/registry/reg_api_regf.c
source3/utils/net_rpc_registry.c
source3/utils/profiles.c

index 394e31afcfa470d9f6c17944b3a57eca026f0a6b..b7a9522fe5ba490ae72bcb10d7033f26fa0e255e 100644 (file)
@@ -278,7 +278,7 @@ static WERROR backup_registry_key(struct registry_key_handle *krecord,
        /* open the registry file....fail if the file already exists */
 
        regfile = regfio_open(fname, (O_RDWR|O_CREAT|O_EXCL),
-                             (S_IREAD|S_IWRITE));
+                             (S_IRUSR|S_IWUSR));
        if (regfile == NULL) {
                DEBUG(0,("backup_registry_key: failed to open \"%s\" (%s)\n",
                         fname, strerror(errno) ));
index e10ba008dfe80c6bdba093b9a6bd6e4658ab06e3..5b9f887b330115bf15034e89d1aad190bad7beae 100644 (file)
@@ -1267,7 +1267,8 @@ static int rpc_registry_copy(struct net_context *c, int argc, const char **argv
        d_printf(_("ok\n"));
 
        d_printf(_("Opening %s...."), argv[1]);
-       if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) {
+       if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC),
+                                     (S_IRUSR|S_IWUSR) )) ) {
                d_fprintf(stderr, _("Failed to open %s for writing\n"),argv[1]);
                goto out;
        }
index 35b89112db4a402a97d559d12e23730f15be86a4..6c6c7fdb0137b1591f315aff439561dacd886396 100644 (file)
@@ -279,7 +279,8 @@ int main( int argc, char *argv[] )
                exit (1);
        }
 
-       if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) {
+       if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC),
+                                     (S_IRUSR|S_IWUSR) )) ) {
                fprintf( stderr, "Failed to open new file %s!\n", new_filename );
                fprintf( stderr, "Error was (%s)\n", strerror(errno) );
                exit (1);