RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm lua Date: 27-Oct-2008 01:38:26 Branch: HEAD Handle: 2008102700382600 Modified files: lua/shadow copydir.c list.c strtoday.c useradd.c rpm CHANGES Log: - jbj: WRlua: preserve forward linkage by avoiding vmefail/get_date. Summary: Revision Changes Path 1.3 +8 -6 lua/shadow/copydir.c 1.4 +20 -8 lua/shadow/list.c 1.5 +5 -2 lua/shadow/strtoday.c 1.5 +22 -17 lua/shadow/useradd.c 1.2628 +1 -0 rpm/CHANGES ____________________________________________________________________________ patch -p0 <<'@@ .' Index: lua/shadow/copydir.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 copydir.c --- lua/shadow/copydir.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/copydir.c 27 Oct 2008 00:38:26 -0000 1.3 @@ -36,18 +36,18 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: copydir.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: copydir.c,v 1.3 2008/10/27 00:38:26 jbj Exp $" -#include <sys/stat.h> -#include <sys/types.h> #include <fcntl.h> -#include <stdio.h> #include "prototypes.h" #include "defines.h" #ifdef WITH_SELINUX #include <selinux/selinux.h> static int selinux_enabled = -1; #endif + +#include "debug.h" + static const char *src_orig; static const char *dst_orig; @@ -125,7 +125,8 @@ if (sb->st_nlink == 1) return 0; - lp = (struct link_name *) xmalloc (sizeof *lp); + lp = (struct link_name *) malloc (sizeof *lp); +assert(lp != NULL); src_len = strlen (src_orig); dst_len = strlen (dst_orig); name_len = strlen (name); @@ -133,7 +134,8 @@ lp->ln_ino = sb->st_ino; lp->ln_count = sb->st_nlink; len = name_len - src_len + dst_len + 1; - lp->ln_name = xmalloc (len); + lp->ln_name = malloc (len); +assert(lp->ln_name != NULL); snprintf (lp->ln_name, len, "%s%s", dst_orig, name + src_len); lp->ln_next = links; links = lp; @@ . patch -p0 <<'@@ .' Index: lua/shadow/list.c ============================================================================ $ cvs diff -u -r1.3 -r1.4 list.c --- lua/shadow/list.c 18 Aug 2008 19:16:10 -0000 1.3 +++ lua/shadow/list.c 27 Oct 2008 00:38:26 -0000 1.4 @@ -39,10 +39,13 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: list.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" +#ident "$Id: list.c,v 1.4 2008/10/27 00:38:26 jbj Exp $" #include "prototypes.h" #include "defines.h" + +#include "debug.h" + /* * add_list - add a member to a list of group members * @@ -69,7 +72,8 @@ * old entries, and the new entries as well. */ - tmp = (char **) xmalloc ((i + 2) * sizeof member); + tmp = (char **) malloc ((i + 2) * sizeof member); +assert(tmp != NULL); /* * Copy the original list to the new list, then append the @@ -80,7 +84,9 @@ for (i = 0; list[i] != (char *) 0; i++) tmp[i] = list[i]; - tmp[i++] = xstrdup (member); + tmp[i] = strdup (member); +assert(tmp[i] != NULL); + i++; tmp[i] = (char *) 0; return tmp; @@ -116,7 +122,8 @@ * old entries. */ - tmp = (char **) xmalloc ((j + 1) * sizeof member); + tmp = (char **) malloc ((j + 1) * sizeof member); +assert(tmp != NULL); /* * Copy the original list except the deleted members to the @@ -140,11 +147,14 @@ for (i = 0; list[i]; i++); - tmp = (char **) xmalloc ((i + 1) * sizeof (char *)); + tmp = (char **) malloc ((i + 1) * sizeof (char *)); +assert(tmp != NULL); i = 0; while (*list) { - tmp[i++] = xstrdup (*list); + tmp[i] = strdup (*list); +assert(tmp[i] != NULL); + i++; list++; } @@ -177,7 +187,8 @@ * Make a copy since we are going to be modifying the list */ - members = xstrdup (comma); + members =strdup (comma); +assert(members != NULL); /* * Count the number of commas in the list @@ -199,7 +210,8 @@ * Allocate the array we're going to store the pointers into. */ - array = (char **) xmalloc (sizeof (char *) * i); + array = (char **) malloc (sizeof (char *) * i); +assert(array != NULL); /* * Empty list is special - 0 members, not 1 empty member. --marekm @@ . patch -p0 <<'@@ .' Index: lua/shadow/strtoday.c ============================================================================ $ cvs diff -u -r1.4 -r1.5 strtoday.c --- lua/shadow/strtoday.c 18 Aug 2008 19:16:10 -0000 1.4 +++ lua/shadow/strtoday.c 27 Oct 2008 00:38:26 -0000 1.5 @@ -42,13 +42,16 @@ #include "defines.h" #include "prototypes.h" -#ident "$Id: strtoday.c,v 1.4 2008/08/18 19:16:10 jbj Exp $" +#ident "$Id: strtoday.c,v 1.5 2008/10/27 00:38:26 jbj Exp $" #ifndef USE_GETDATE #define USE_GETDATE 1 #endif + +#define get_date shadow_get_date +#include "../../rpmio/getdate.c" + #if USE_GETDATE -extern time_t get_date (const char *, const time_t *); /* * strtoday() now uses get_date() (borrowed from GNU shellutils) @@ . patch -p0 <<'@@ .' Index: lua/shadow/useradd.c ============================================================================ $ cvs diff -u -r1.4 -r1.5 useradd.c --- lua/shadow/useradd.c 18 Aug 2008 19:16:10 -0000 1.4 +++ lua/shadow/useradd.c 27 Oct 2008 00:38:26 -0000 1.5 @@ -36,11 +36,8 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: useradd.c,v 1.4 2008/08/18 19:16:10 jbj Exp $" +#ident "$Id: useradd.c,v 1.5 2008/10/27 00:38:26 jbj Exp $" -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> #include <getopt.h> #include <grp.h> #include <lastlog.h> @@ -48,10 +45,6 @@ #ifdef USE_PAM #include "pam_defs.h" #endif /* USE_PAM */ -#include <stdio.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <time.h> #include <setjmp.h> #include "chkname.h" #include "defines.h" @@ -67,6 +60,8 @@ #endif #include "shadowio.h" +#include "debug.h" + #ifndef SKEL_DIR #define SKEL_DIR "/etc/skel" #endif @@ -357,7 +352,8 @@ if (*cp != '\0' && *ep == '\0') { /* valid number */ def_group = val; if ((grp = lcl_getgrgid (def_group))) { - def_gname = xstrdup (grp->gr_name); + def_gname = strdup (grp->gr_name); +assert(def_gname != NULL); } else { fprintf (stderr, _("%s: unknown GID %s\n"), @@ -365,7 +361,8 @@ } } else if ((grp = lcl_getgrnam (cp))) { def_group = grp->gr_gid; - def_gname = xstrdup (cp); + def_gname = strdup (cp); +assert(def_gname != NULL); } else { fprintf (stderr, _("%s: unknown group %s\n"), Prog, cp); @@ -376,14 +373,16 @@ * Default HOME filesystem */ else if (MATCH (buf, HOME)) { - def_home = xstrdup (cp); + def_home = strdup (cp); +assert(def_home != NULL); } /* * Default Login Shell command */ else if (MATCH (buf, SHELL)) { - def_shell = xstrdup (cp); + def_shell = strdup (cp); +assert(def_shell != NULL); } /* @@ -402,7 +401,8 @@ * Default account expiration date */ else if (MATCH (buf, EXPIRE)) { - def_expire = xstrdup (cp); + def_expire = strdup (cp); +assert(def_expire != NULL); } /* @@ -412,7 +412,8 @@ if (*cp == '\0') cp = SKEL_DIR; /* XXX warning: const */ - def_template = xstrdup (cp); + def_template = strdup (cp); +assert(def_template != NULL); } /* @@ -422,7 +423,8 @@ if (*cp == '\0') cp = CREATE_MAIL_SPOOL; /* XXX warning: const */ - def_create_mail_spool = xstrdup (cp); + def_create_mail_spool = strdup (cp); +assert(def_create_mail_spool != NULL); } } } @@ -665,7 +667,9 @@ /* * Add the group name to the user's list of groups. */ - user_groups[ngroups++] = xstrdup (grp->gr_name); + user_groups[ngroups] = strdup (grp->gr_name); +assert(user_groups[ngroups] != NULL); + ngroups++; } while (list); user_groups[ngroups] = (char *) 0; @@ -1350,8 +1354,9 @@ if (!dflg) { char *uh; - uh = xmalloc (strlen (def_home) + + uh = malloc (strlen (def_home) + strlen (user_name) + 2); +assert(uh != NULL); sprintf (uh, "%s/%s", def_home, user_name); user_home = uh; } @@ . patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2627 -r1.2628 CHANGES --- rpm/CHANGES 24 Oct 2008 22:58:39 -0000 1.2627 +++ rpm/CHANGES 27 Oct 2008 00:38:26 -0000 1.2628 @@ -1,5 +1,6 @@ 5.2a2 -> 5.2a3: + - jbj: WRlua: preserve forward linkage by avoiding vmefail/get_date. - jbj: lua: add virgin luasocket-2.0.2 lua bindings (unused atm). - jbj: lua: add license, and compile lxplib. - jbj: lua: add lom.lua wrapper for lxplib. @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org