]> git.saurik.com Git - apple/system_cmds.git/commitdiff
system_cmds-336.20.tar.gz mac-os-x-10410x86 mac-os-x-1049x86 v336.20
authorApple <opensource@apple.com>
Fri, 12 Jan 2007 02:05:03 +0000 (02:05 +0000)
committerApple <opensource@apple.com>
Fri, 12 Jan 2007 02:05:03 +0000 (02:05 +0000)
atrun.tproj/atrun.c
zic.tproj/datfiles/tzdata2006a.tar.gz [deleted file]
zic.tproj/datfiles/tzdata2007a.tar.gz [new file with mode: 0644]

index 9d52ffa888ecfc55b845f75b41bdeab1b1c1b7ab..4eac2cc87b9916038f3a0c6be255be272c516a7f 100644 (file)
@@ -55,11 +55,7 @@ static const char rcsid[] =
 #include <getopt.h>
 #endif
 
-#if (MAXLOGNAME-1) > UT_NAMESIZE
-#define LOGNAMESIZE UT_NAMESIZE
-#else
 #define LOGNAMESIZE (MAXLOGNAME-1)
-#endif
 
 /* Local headers */
 
@@ -119,7 +115,8 @@ run_file(const char *filename, uid_t uid, gid_t gid)
     pid_t pid;
     int fd_out, fd_in;
     int queue;
-    char mailbuf[LOGNAMESIZE + 1], fmt[49];
+    char mailbuf[LOGNAMESIZE + 1];
+    char *fmt = NULL;
     char *mailname = NULL;
     FILE *stream;
     int send_mail = 0;
@@ -208,13 +205,15 @@ run_file(const char *filename, uid_t uid, gid_t gid)
 
     fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC);
 
-    snprintf(fmt, sizeof(fmt),
-       "#!/bin/sh\n# atrun uid=%%ld gid=%%ld\n# mail %%%ds %%d",
-                          LOGNAMESIZE);
+    asprintf(&fmt, "%s%d%s",
+            "#!/bin/sh\n# atrun uid=%ld gid=%ld\n# mail %",
+            LOGNAMESIZE,
+            "s %d");
     if (fscanf(stream, fmt, &nuid, &ngid, mailbuf, &send_mail) != 4) {
        syslog(LOG_ERR,"File %s is in wrong format - aborting", filename);
        exit(EXIT_FAILURE);
     }
+    free(fmt);
     if (mailbuf[0] == '-') {
        syslog(LOG_ERR,"illegal mail name %s in %s",mailbuf,filename);
        exit(EXIT_FAILURE);
diff --git a/zic.tproj/datfiles/tzdata2006a.tar.gz b/zic.tproj/datfiles/tzdata2006a.tar.gz
deleted file mode 100644 (file)
index 3e4e878..0000000
Binary files a/zic.tproj/datfiles/tzdata2006a.tar.gz and /dev/null differ
diff --git a/zic.tproj/datfiles/tzdata2007a.tar.gz b/zic.tproj/datfiles/tzdata2007a.tar.gz
new file mode 100644 (file)
index 0000000..b242def
Binary files /dev/null and b/zic.tproj/datfiles/tzdata2007a.tar.gz differ