From 0b4c476faa9f0e5ce8d5c7363daa5e81d452814a Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sun, 4 Nov 2018 21:45:24 +0000 Subject: [PATCH] skip chmod on symlinks --- zpm-syncfs.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/zpm-syncfs.c b/zpm-syncfs.c index 06477f1..d21f34f 100644 --- a/zpm-syncfs.c +++ b/zpm-syncfs.c @@ -607,7 +607,9 @@ static int set_md(struct config *conf, struct nitem *item) { int success = 0; if (conf->dryrun) { - printf("chmod %o %s\n", item->mode, item->dest); + if (item->ftype != 'l') { + printf("chmod %o %s\n", item->mode, item->dest); + } if (conf->setuser && conf->setgroup) { printf("chown %d:%d %s\n", item->uid, item->gid, item->dest); @@ -617,11 +619,14 @@ static int set_md(struct config *conf, struct nitem *item) { return success; } - rv = chmod(item->dest, item->mode); + /* can't chmod a symlink */ + if (item->ftype != 'l') { + rv = chmod(item->dest, item->mode); - if (rv == -1) { - setsyserr(conf, "can't chmod %o %s", item->mode, item->dest); - return conf->errabort; + if (rv == -1) { + setsyserr(conf, "can't chmod %o %s", item->mode, item->dest); + return conf->errabort; + } } if (conf->setuser && conf->setgroup) { -- 2.40.0