Bug 1021 - fails to build on Debian kFreeBSD
fails to build on Debian kFreeBSD
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.9.9
PC FreeBSD
: low normal
Assigned To: Todd C. Miller
https://bugs.debian.org/cgi-bin/bugre...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-02-03 06:23 MST by Marc Haber
Modified: 2022-03-04 09:15 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Haber 2022-02-03 06:23:09 MST
Hi,

sudo 1.9.9 fails to build on Debian/kFreeBSD. Sadly, the original bug reporter didn't give a build log, but says that the following patch fixes things:

--- sudo-1.9.9.orig/include/sudo_compat.h                                                               
+++ sudo-1.9.9/include/sudo_compat.h                                                                    
@@ -471,7 +471,7 @@ sudo_dso_public time_t sudo_timegm(struc                                            
 #ifndef HAVE_UTIMENSAT                                                                                 
 sudo_dso_public int sudo_utimensat(int fd, const char *file, const struct timespec *times, int flag);  
 # undef utimensat                                                                                      
-# define utimensat(_a, _b, _c, _d) sudo_utimensat((_a), (_b), (_c), (_d))                              
+# define utimensat(_a, _b, _c, _d) sudo_utimensat(_a, _b, _c, _d)                                      
 #endif /* HAVE_UTIMENSAT */                                                                            
 #ifndef HAVE_FCHMODAT                                                                                  
 sudo_dso_public int sudo_fchmodat(int dfd, const char *path, mode_t mode, int flag);                   
@@ -486,7 +486,7 @@ sudo_dso_public int sudo_fstatat(int dfd                                            
 #ifndef HAVE_FUTIMENS                                                                                  
 sudo_dso_public int sudo_futimens(int fd, const struct timespec *times);                               
 # undef futimens                                                                                       
-# define futimens(_a, _b) sudo_futimens((_a), (_b))                                                    
+# define futimens(_a, _b) sudo_futimens(_a, _b)                                                        
 #endif /* HAVE_FUTIMENS */                                                                             
 #if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)                                       
 sudo_dso_public int sudo_snprintf(char *str, size_t n, char const *fmt, ...) __printflike(3, 4);       

Greetings
Marc

(btw, 1.9.9 is not yet selectablein the "Version" list)
Comment 1 Todd C. Miller 2022-02-03 09:27:20 MST
The actual problem is that the Debian kFreeBSD include files include prototypes for the missing functions which are conflicting with sudo's defines that attempt to emulate them.  I don't think that removing the parens is the correct solution.

Those prototypes really should not be present if the underlying functions are not supported but it looks like including sys/stat.h in sudo_compat.h is enough to avoid the problem.
Comment 3 Todd C. Miller 2022-03-04 09:15:14 MST
Fixed in sudo 1.9.10