bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: coreutils-8.21, some changes needed


From: Joachim Schmitz
Subject: RE: coreutils-8.21, some changes needed
Date: Tue, 19 Feb 2013 10:08:53 +0100

> -----Original Message-----
> From: Joachim Schmitz [mailto:address@hidden
> Sent: Tuesday, February 19, 2013 9:18 AM
> To: 'address@hidden'; 'address@hidden'
> Subject: coreutils-8.21, some changes needed
> 
> Hi folks
> 
> In an attempt to port coreutils 8.21 to HP-NonStop I stumbled accross a 
> couple problems, here are my fixes to them:
> 
> Here another file needs to get adjusted to using the new root-uid.h
> 
> diff -EBbu ./src/copy.c.orig ./src/copy.c
> --- ./src/copy.c.orig   2013-02-07 03:37:05 -0600
> +++ ./src/copy.c        2013-02-18 09:29:22 -0600
> @@ -51,6 +51,7 @@
>  #include "ignore-value.h"
>  #include "ioblksize.h"
>  #include "quote.h"
> +#include "root-uid.h"
>  #include "same.h"
>  #include "savedir.h"
>  #include "stat-size.h"
> @@ -1127,7 +1128,7 @@
>      {
>        bool access_changed = false;
> 
> -      if (!(sb.st_mode & S_IWUSR) && geteuid () != 0)
> +      if (!(sb.st_mode & S_IWUSR) && geteuid () != ROOT_UID)
>          access_changed = fchmod_or_lchmod (dest_desc, dst_name, 0600) == 0;
> 
>        if (!copy_attr (src_name, source_desc, dst_name, dest_desc, x)
> @@ -2718,7 +2719,7 @@
>      priv_freeset (pset);
>    }
>  #else
> -  x->chown_privileges = x->owner_privileges = (geteuid () == 0);
> +  x->chown_privileges = x->owner_privileges = (geteuid () == ROOT_UID);
>  #endif
>  }
> 
> 
> 
> On HP-NonStop we use  0x80000000 instead of -1 for getuid(), getgid() and 
> friends to indicate NO_UID rsp. NO_GID
> Guess that difference could go into gnulibs root-uid.h?
> Such a change would affect coreutils in 
> ...src/{groups,id,install,test,whoami}.c (in addition to root-uid.h of course)
> 
> 
> Here two trailing _ seem missing?
> 
> diff -EBbu ./src/numfmt.c.orig ./src/numfmt.c
> --- ./src/numfmt.c.orig 2013-02-14 08:49:30 -0600
> +++ ./src/numfmt.c      2013-02-18 10:58:27 -0600
> @@ -1195,7 +1195,7 @@
>     Returns a pointer to the *delimiter* of the requested field,
>     or a pointer to NUL (if reached the end of the string).  */
>  static inline char *
> -__attribute ((pure))
> +__attribute__ ((pure))
>  skip_fields (char *buf, int fields)
>  {
>    char *ptr = buf;
> 

And here as a git diff:

diff --git a/src/copy.c b/src/copy.c
index 3f2cc2b..affdda1 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -51,6 +51,7 @@
 #include "ignore-value.h"
 #include "ioblksize.h"
 #include "quote.h"
+#include "root-uid.h"
 #include "same.h"
 #include "savedir.h"
 #include "stat-size.h"
@@ -1127,7 +1128,7 @@ preserve_metadata:
     {
       bool access_changed = false;

-      if (!(sb.st_mode & S_IWUSR) && geteuid () != 0)
+      if (!(sb.st_mode & S_IWUSR) && geteuid () != ROOT_UID)
         access_changed = fchmod_or_lchmod (dest_desc, dst_name, 0600) == 0;

       if (!copy_attr (src_name, source_desc, dst_name, dest_desc, x)
@@ -2718,7 +2719,7 @@ cp_options_default (struct cp_options *x)
     priv_freeset (pset);
   }
 #else
-  x->chown_privileges = x->owner_privileges = (geteuid () == 0);
+  x->chown_privileges = x->owner_privileges = (geteuid () == ROOT_UID);
 #endif
 }

diff --git a/src/numfmt.c b/src/numfmt.c
index 8c21c2b..50f295d 100644
--- a/src/numfmt.c
+++ b/src/numfmt.c
@@ -1195,7 +1195,7 @@ process_suffixed_number (char *text, long double *result,
    Returns a pointer to the *delimiter* of the requested field,
    or a pointer to NUL (if reached the end of the string).  */
 static inline char *
-__attribute ((pure))
+__attribute__ ((pure))
 skip_fields (char *buf, int fields)
 {
   char *ptr = buf;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]