mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
Doh. I never allocated storate for the struct stat I am using.
There was just a never initialized pointer. -Erik
This commit is contained in:
parent
468f504fd7
commit
ca85cdbe4c
6
chmod.c
6
chmod.c
@ -30,12 +30,12 @@
|
|||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
|
|
||||||
struct stat *theMode;
|
struct stat theMode;
|
||||||
|
|
||||||
|
|
||||||
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
||||||
{
|
{
|
||||||
if (chmod(fileName, theMode->st_mode) == 0)
|
if (chmod(fileName, theMode.st_mode) == 0)
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
perror(fileName);
|
perror(fileName);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
@ -59,7 +59,7 @@ int chmod_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (argc > optind && argc > 2 && argv[optind]) {
|
if (argc > optind && argc > 2 && argv[optind]) {
|
||||||
/* Parse the specified mode */
|
/* Parse the specified mode */
|
||||||
if (parse_mode(argv[optind], &(theMode->st_mode)) == FALSE) {
|
if (parse_mode(argv[optind], &(theMode.st_mode)) == FALSE) {
|
||||||
error_msg_and_die( "unknown mode: %s", argv[optind]);
|
error_msg_and_die( "unknown mode: %s", argv[optind]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -30,12 +30,12 @@
|
|||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
|
|
||||||
struct stat *theMode;
|
struct stat theMode;
|
||||||
|
|
||||||
|
|
||||||
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
||||||
{
|
{
|
||||||
if (chmod(fileName, theMode->st_mode) == 0)
|
if (chmod(fileName, theMode.st_mode) == 0)
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
perror(fileName);
|
perror(fileName);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
@ -59,7 +59,7 @@ int chmod_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (argc > optind && argc > 2 && argv[optind]) {
|
if (argc > optind && argc > 2 && argv[optind]) {
|
||||||
/* Parse the specified mode */
|
/* Parse the specified mode */
|
||||||
if (parse_mode(argv[optind], &(theMode->st_mode)) == FALSE) {
|
if (parse_mode(argv[optind], &(theMode.st_mode)) == FALSE) {
|
||||||
error_msg_and_die( "unknown mode: %s", argv[optind]);
|
error_msg_and_die( "unknown mode: %s", argv[optind]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user